Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace scipy.sparse with PyData/sparse? #34

Open
aufdenkampe opened this issue Sep 13, 2023 · 2 comments
Open

Replace scipy.sparse with PyData/sparse? #34

aufdenkampe opened this issue Sep 13, 2023 · 2 comments
Assignees

Comments

@aufdenkampe
Copy link
Member

It appears that the PyData/sparse library more natively integrates with Xarray and Dask than the scipy.sparce subpackage, because it was designed from the ground up to natively use arrays instead of matrices. See:

It's possible that this is being solved by the recent refactoring of scipy.sparce, but Xarray and Dask are already integrated with PyData/sparse.

It might be worth exploring if migrating to PyData/sparse would provide any benefits to performance or code simplicity.

On the other hand, development doesn't appear very active, so it's possible that momentum has shifted away from this effort. See: https://sparse.pydata.org/en/stable/changelog.html

@aufdenkampe aufdenkampe changed the title Replace scipy.sparse with PyData/sparse Replace scipy.sparse with PyData/sparse? Sep 13, 2023
@aufdenkampe
Copy link
Member Author

aufdenkampe commented Dec 19, 2023

@sjordan29, if this enables us to more easily leverage Dask, then it may be connected to

That said, there really does appear to be substantially less development activity at https://github.com/pydata/sparse compared to https://github.com/scipy/scipy, especially given that scipy v1.11 introduced "A new public base class scipy.sparse.sparray was introduced, allowing further extension of the sparse array API.". See https://docs.scipy.org/doc/scipy/release/1.11.0-notes.html#scipy-sparse-improvements

Given that Dask implements numpy.ndarray under the hood, then it may be that Dask would work perfectly well with the new scipy.sparse.sparray.

This person is wondering the same thing: https://dask.discourse.group/t/confused-about-working-with-sparse-arrays/1762

@aufdenkampe
Copy link
Member Author

aufdenkampe commented Jun 11, 2024

Quick update: pyData/sparse appears to be re-activated, with the release of v0.15 in Jan 2024, https://sparse.pydata.org/en/stable/changelog.html. A v0.16 has gotten a bunch of alpha releases since April: https://github.com/pydata/sparse/tags. Last, the xarray community survey just asked if they should prioritize work on sparse.

Meanwhile, scipy 1.14 also improves: "scipy.sparse.linalg.spsolve_triangular is now more than an order of magnitude faster in many cases."

It's still unclear which is the best library at this moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants