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

Inplace subset of anndata object doesn't update AxisArrays #373

Open
fhausmann opened this issue May 14, 2020 · 1 comment
Open

Inplace subset of anndata object doesn't update AxisArrays #373

fhausmann opened this issue May 14, 2020 · 1 comment

Comments

@fhausmann
Copy link

Inplace subsetting of an anndata object does not update obsm or varm. They updated anndata objects gets new AxisArrays objects (with the correct shape), but the old objects don't get updated and even if they are still referencing the updated anndata object.

from anndata.tests.helpers import gen_adata

a = gen_adata((200, 100))
o1 = a.obsm
a._inplace_subset_obs(slice(50))
o2 = a.obsm

assert o1.parent is o2.parent
assert o1["array"].shape == o2["array"].shape
id(o1) == id(o2) # False

Originally posted by @ivirshup in #363

@fhausmann
Copy link
Author

As @ivirshup was mentioning here (#363 (comment)) possible fixes include:

it would either make sense that it change, or it no longer referred to the parent of the wrong shape.

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