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

[python] Inconsistency in to_anndata density/sparsity of obsp/varp #3360

Closed
johnkerl opened this issue Nov 21, 2024 · 2 comments · Fixed by #3387
Closed

[python] Inconsistency in to_anndata density/sparsity of obsp/varp #3360

johnkerl opened this issue Nov 21, 2024 · 2 comments · Fixed by #3387

Comments

@johnkerl
Copy link
Member

johnkerl commented Nov 21, 2024

While tiledbsoma.io.to_anndata() exports obsp/varp as a scipy.sparse matrix, ExperimentAxisQuery.to_anndata() exports it as a dense ndarray.

The AnnData API suggests the dense ndarray.

Update on #3362: @ivirshup points out that the AnnData docs are wrong and these should be sparse in all cases.

[sc-59632]

@johnkerl johnkerl self-assigned this Nov 21, 2024
@johnkerl johnkerl added for-release-1.15 bug Something isn't working python-api labels Nov 21, 2024
@johnkerl johnkerl changed the title [python] to_anndata inconsistency in handling of obsp/varp [python] Inconsistency in to_anndata handling of obsp/varp Nov 21, 2024
@johnkerl johnkerl removed the bug Something isn't working label Nov 21, 2024
@johnkerl johnkerl changed the title [python] Inconsistency in to_anndata handling of obsp/varp [python] Inconsistency in to_anndata density/sparsity of obsp/varp Nov 22, 2024
@ivirshup
Copy link
Collaborator

Oh let me clarify, it's not that it should be sparse in all cases. It's just that in the majority of cases it should be sparse. If the user really needs a dense array (maybe for a correlation matrix), they can do that.

Ideally you support both. I think the user would decide which they want by what format they stored it in.

@johnkerl johnkerl assigned bkmartinjr and unassigned johnkerl Nov 25, 2024
@johnkerl
Copy link
Member Author

Back to @bkmartinjr as discussed -- thanks @bkmartinjr ! :)

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

Successfully merging a pull request may close this issue.

3 participants