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

Assigning adata_view.X writes through instead of #1838

Open
3 tasks done
flying-sheep opened this issue Jan 23, 2025 · 0 comments
Open
3 tasks done

Assigning adata_view.X writes through instead of #1838

flying-sheep opened this issue Jan 23, 2025 · 0 comments

Comments

@flying-sheep
Copy link
Member

flying-sheep commented Jan 23, 2025

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of anndata.
  • (optional) I have confirmed this bug exists on the master branch of anndata.

Report

It’s confusing that it only(?) happens with X and doesn’t happen with other arrays like that (e.g. .obsm["key"])

import dask.array as da
from anndata import AnnData

adata_src = AnnData(da.array(...))
adata = adata_src[:5]
adata.X = adata.X.compute()  # should raise ImplicitModificationWarning
assert isinstance(adata.X, np.array)  # AssertionError: adata.X is a Dask Array

cc @jan-engelmann

Versions

0.11.3
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

2 participants