You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@joshua-gould, that seems wrong, thanks for the report! (btw: I think you're missing an import numpy as np)
@falexwolf or @flying-sheep: this should be creating a copy of s then assigning df2 to that, right? The setter looks like it's trying to do the modification in-place:
In the commit that introduced the view functionality, 542edcc, the AnnDataAttributeView and ArrayView classes already had copy-on-write behavior (their __setitem__ methods called adata_view._init_as_actual(…))
That was also the last commit that touched the last two lines of obs.setter and so on, not introducing COW behavior for those.
I also think that the only sound behavior would be to be consistent here.
Activity
ivirshup commentedon May 9, 2019
@joshua-gould, that seems wrong, thanks for the report! (btw: I think you're missing an
import numpy as np)@falexwolf or @flying-sheep: this should be creating a copy of s then assigning
df2to that, right? The setter looks like it's trying to do the modification in-place:https://github.com/theislab/anndata/blob/fc7f3cb06c191aff4fcad6af88f0c3012d7d1a65/anndata/base.py#L1090-L1098
(ditto with var)
flying-sheep commentedon May 9, 2019
In the commit that introduced the view functionality, 542edcc, the
AnnDataAttributeViewandArrayViewclasses already had copy-on-write behavior (their__setitem__methods calledadata_view._init_as_actual(…))That was also the last commit that touched the last two lines of
obs.setterand so on, not introducing COW behavior for those.I also think that the only sound behavior would be to be consistent here.
ivirshup commentedon May 9, 2019
Agreed.
I just keep running into code that's definitely trying to make modifications in-place.
Aside on the formatting above:
In[2]:flying-sheep commentedon May 9, 2019
Sadly just a table. It was an experiment to see how much work it is, and the answer is: too much (I had to do the HTML markup manually)
I think this format is probably the most practical to show input and output:
obs, var now copy on set
obs, var now copy on set
obs, var now copy on set
obs, var now copy on set