wrap scipy matrixes in Rust
kno10 opened this issue · 3 comments
It would be great if one could use this to access scipy csr_matrix/csc_matrix from Rust for writing extensions.
There is rust-numpy to work with numpy arrays from rust, but that does not include scipy sparse matrixes.
But it would be great to write performance-critical operations in rust, and allow "driving" them from Python.
Are you looking for a python wrapper around this (#200) or something different? The crate is generic on storage type so you should be able to regenerate the matrix on the rust side if you have the raw buffers.
No, the opposite. Process scipy csr matrixes with rust without copying them first.
Use case: a user does the preprocessing into tf-idf matrix in python, then calls a fast rust library for the analysis.
A TryInto<CsMatViewI>
impl? A direct implementation seems out of scope for this crate, as we have to pull in so many dependencies. This should be as simple as calling
new_unchecked using the buffers given by scipy
. Just make sure the indices are sorted on the python side.