-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add compute and internal modules * implement concat * simplify return * Add to_python methods * Add README file
- Loading branch information
1 parent
ee244ae
commit 913ca39
Showing
43 changed files
with
2,681 additions
and
116 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "arro3-compute" | ||
version = "0.1.0" | ||
authors = ["Kyle Barron <[email protected]>"] | ||
edition = "2021" | ||
description = "Rust-based compute kernels for Arrow in Python." | ||
readme = "README.md" | ||
repository = "https://github.com/kylebarron/arro3" | ||
license = "MIT OR Apache-2.0" | ||
keywords = ["python", "arrow"] | ||
categories = [] | ||
rust-version = "1.75" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[lib] | ||
name = "_rust" | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
arrow-array = "51" | ||
arrow-buffer = "51" | ||
arrow-schema = "51" | ||
arrow-select = "51" | ||
arrow = { version = "51", features = ["ffi"] } | ||
pyo3 = { version = "0.20.0", features = ["abi3-py38"] } | ||
thiserror = "1" | ||
arro3-internal = { path = "../arro3-internal" } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[build-system] | ||
requires = ["maturin>=1.4.0,<2.0"] | ||
build-backend = "maturin" | ||
|
||
[project] | ||
name = "arro3-compute" | ||
requires-python = ">=3.8" | ||
dependencies = ["arro3-core"] | ||
classifiers = [ | ||
"Programming Language :: Rust", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
|
||
[tool.maturin] | ||
features = ["pyo3/extension-module"] | ||
module-name = "arro3.compute._rust" | ||
python-source = "python" | ||
|
||
[tool.poetry] | ||
name = "arro3-compute" | ||
version = "0.0.0" | ||
description = "" | ||
authors = [] | ||
packages = [{ include = "python/arro3/compute" }] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from ._rust import * | ||
from ._rust import ___version | ||
|
||
__version__: str = ___version() |
File renamed without changes.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use arro3_internal::array::PyArray; | ||
use arro3_internal::chunked::PyChunkedArray; | ||
use arro3_internal::error::PyArrowResult; | ||
use pyo3::prelude::*; | ||
|
||
#[pyfunction] | ||
pub fn concat(input: PyChunkedArray) -> PyArrowResult<PyObject> { | ||
let (chunks, field) = input.into_inner(); | ||
let array_refs = chunks.iter().map(|arr| arr.as_ref()).collect::<Vec<_>>(); | ||
let concatted = arrow_select::concat::concat(array_refs.as_slice())?; | ||
Python::with_gil(|py| PyArray::new(concatted, field).to_python(py)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use pyo3::prelude::*; | ||
|
||
pub mod concat; | ||
|
||
const VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
#[pyfunction] | ||
fn ___version() -> &'static str { | ||
VERSION | ||
} | ||
|
||
/// A Python module implemented in Rust. | ||
#[pymodule] | ||
fn _rust(_py: Python, m: &PyModule) -> PyResult<()> { | ||
m.add_wrapped(wrap_pyfunction!(___version))?; | ||
|
||
m.add_wrapped(wrap_pyfunction!(concat::concat))?; | ||
|
||
Ok(()) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,9 @@ name = "arro3-core" | |
version = "0.1.0" | ||
authors = ["Kyle Barron <[email protected]>"] | ||
edition = "2021" | ||
description = "Efficient, vectorized geospatial operations in Python." | ||
description = "Core library for representing Arrow data in Python." | ||
readme = "README.md" | ||
repository = "https://github.com/geoarrow/geoarrow-rs" | ||
repository = "https://github.com/kylebarron/arro3" | ||
license = "MIT OR Apache-2.0" | ||
keywords = ["python", "arrow"] | ||
categories = [] | ||
|
@@ -17,10 +17,11 @@ name = "_rust" | |
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
arrow-array = "51" | ||
arrow-buffer = "51" | ||
arrow-schema = "51" | ||
arrow = { version = "51", features = ["ffi"] } | ||
arro3-internal = { path = "../arro3-internal" } | ||
# arrow-array = "51" | ||
# arrow-buffer = "51" | ||
# arrow-schema = "51" | ||
# arrow = { version = "51", features = ["ffi"] } | ||
pyo3 = { version = "0.20.0", features = ["abi3-py38"] } | ||
numpy = { version = "0.20", features = ["half"] } | ||
thiserror = "1" | ||
# numpy = { version = "0.20", features = ["half"] } | ||
# thiserror = "1" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.