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

Add support for sparse arrays (pydata) to .varp and .obsp fields #1731

Open
jkobject opened this issue Oct 22, 2024 · 5 comments
Open

Add support for sparse arrays (pydata) to .varp and .obsp fields #1731

jkobject opened this issue Oct 22, 2024 · 5 comments

Comments

@jkobject
Copy link

Please describe your wishes and possible alternatives to achieve the desired result.

scipy.sparse only supports 2D arrays. Whereas varp and obsp support N-D arrays.
Most of the time we would want them to be sparse.
But right now anndata prevent the varp and obsp fields to contain the pydata/sparse formats.

Not all but many features are available on these matrix formats. Are there missing features that would be required as of now that would prevent this integration?

@flying-sheep flying-sheep changed the title make multidimensional sparse arrays work with the .varp and .obsp fields Add support for sparse arrays (pydata) to .varp and .obsp fields Oct 25, 2024
@flying-sheep
Copy link
Member

Ah, you’re talking about https://sparse.pydata.org/en/stable/.

We haven’t talked about this much yet, but it’s definitely worth discussing.

@jkobject
Copy link
Author

Let me know if I can help since it doesn't seem like too complicated to add and would be worth it for some applications :)

If you can point me to some of files to be looking at for updates I can have a look

@ilan-gold
Copy link
Contributor

@jkobject If I remember, our main stumbling block with this up until now has been the dependency on numba, which is too much for anndata.

But we could do this as an optional dep. In this case, we should think more broadly about a registration mechanism for choosing which array type gets returned from i/o. This would be helpful for GPU.

@ivirshup
Copy link
Member

ivirshup commented Nov 7, 2024

I would add that last I talked to the authors of pydata/sparse they were looking at a full rewrite. So it might be in a rocky state for a while.

@ilan-gold
Copy link
Contributor

@ivirshup it loooks like the package has a backend for finch now...could be worth trying out actually...would be huge for array-api compat!

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

No branches or pull requests

4 participants