rust-numpy
rust-numpy copied to clipboard
PyO3-based Rust bindings of the NumPy C-API
Python 3.8 is about to reach EOL. PyO3 is offering extended support for 3.7 and 3.8 (mostly to meet the needs of `cryptography`), however perhaps it's time to drop 3.7...
Hi! I have a question about why the following code seems to work without throwing an assert error. On the Rust side: ``` #[pyfunction] fn sum_up, array: PyArrayLike1
See - https://numpy.org/doc/stable/reference/random/c-api.html - https://numpy.org/doc/stable/reference/random/extending.html Fixes #498 The idea is to have a safe wrapper around the `npy_bitgen` struct that implements [`rand::RngCore`](https://docs.rs/rand/latest/rand/trait.RngCore.html). That way pyo3 functions could be passed a...
Resolves #491 There seems to be a minor breaking change with this fix where some conversions to `PyArrayLikeDyn` may now require `AllowTypeChange` where it wasn't needed previously (which can be...
Greetings, My goal is to implement an efficient (and safe) way to wrap a Rust function, using numpy::PyReadonlyArray, with zero-copy and GIL release during computation. My question is general, but...
We should allow a way to pass a `numpy.random.Generator` to a pyo3 function and use it on the Rust side by something requiring a `rand::Rng` by implementing [`rand::RngCore`](https://docs.rs/rand/latest/rand/trait.RngCore.html). See -...
# Bug Description When using `PyArrayLikeDyn` with `AllowTypeChange`, trailing singleton axes may be removed from inputs that are `ndarray`s but have the wrong dtype. # Steps to Reproduce ## `Cargo.toml`...
Interoperability with faer (https://github.com/sarah-quinones/faer-rs) Mats. Related faer-ext PR for numpy-to-faer direction: https://github.com/sarah-quinones/faer-ext/pull/6 . For bi-directional interoperability of faer with python/numpy. @sarah-quinones
I have a `cv::Mat` in Rust, but want to convey the data to Python, I have checked the doc and gone to `PyArray3`, but it requires a `Vec`, which means...
`PyUntypedArrayMethods::as_array_ptr` doesn’t describe under which circumstances the returned pointer is [convertible into a reference](https://doc.rust-lang.org/stable/core/ptr/index.html#pointer-to-reference-conversion). Since the requirements are rather hairy, it would be great to have a way to access...