numpy-0.4.0-alpha.1 doesn't have any documentation.
rust-numpy
Rust bindings for the NumPy C-API
API documentation
Requirements
- current nightly rust (see https://github.com/PyO3/pyo3/issues/5 for nightly features, and https://github.com/PyO3/pyo3/blob/master/build.rs for minimum required version)
- some rust libraries
- ndarray for rust-side matrix library
- pyo3 for cpython binding
- and more (see Cargo.toml)
- numpy installed in your python environments (e.g., via
pip install numpy
)
Note Starting from 0.3, rust-numpy migrated from rust-cpython to pyo3. If you want to use rust-cpython, use version 0.2.1 from crates.io.
Example
Execute a Python program from Rust and get results
[]
= "numpy-test"
[]
= "^0.5.0-alpha.2"
= "0.4.0-alpha.1"
extern crate numpy;
extern crate pyo3;
use ;
use ;
use PyDict;
Write a Python module in Rust
Please see the example directory for a complete example
[]
= "rust_ext"
= ["cdylib"]
[]
= "0.4.0-alpha.1"
= "0.12"
[]
= "^0.5.0-alpha.2"
= ["extension-module"]
extern crate ndarray;
extern crate numpy;
extern crate pyo3;
use ;
use ;
use ;
Contribution
This project is still in pre-alpha. We need your feedback. Don't hesitate to open issues!
Version
-
v0.4.0(coming soon)
- Duplicate
PyArrayModule
and import Numpy API automatically - Fix memory leak of
IntoPyArray
and addToPyArray
crate - PyArray has dimension as type parameter. Now it looks like
PyArray<T, D>
- Use
ndarray::IntoDimension
to specify dimension
- Duplicate
-
v0.3.1, v0.3.2
- Just update dependencies
-
v0.3.0
- Breaking Change: Migrated to pyo3 from rust-cpython
- Some api addition
- Static type checking with PhantomData
-
v0.2.1
- NEW: trait
IntoPyErr
,IntoPyResult
for error translation
- NEW: trait
-
v0.2.0
- NEW: traits
IntoPyArray
,ToPyArray
- MOD: Interface of
PyArray
creation functions are changed
- NEW: traits
-
v0.1.1
- Update documents
-
v0.1.0
- First Release
- Expose unsafe interfase of Array and UFunc API