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
Example of how using the .filename setter looses X:
importanndataasadadata=ad.AnnData(
X=np.array([[1, 2], [3, 4]]),
obs=pd.DataFrame({"cell_type": ["A", "B"]}),
)
adata.write_h5ad("sample_data.h5ad")
adata=ad.read_h5ad("sample_data.h5ad", backed="r")
# This should just put the anndata object to memory mode I supposeadata.filename=Noneadata.XisNone
True
Running this on the main branch.
might become irrelevant in the future, but the fix seems to be a simple bug in _to_memory_mode.
Please make sure these conditions are met
Report
When setting the
filename
of a backed anndata object toNone
, it's.X
gets lost.Reproducible example of how
to_memory()
works as expected:Example of how using the
.filename
setter looses X:Running this on the main branch.
might become irrelevant in the future, but the fix seems to be a simple bug in
_to_memory_mode
.Versions
anndata 0.11.0rc4.dev4+g3260222
awkward 2.6.8
numpy 2.0.0
pandas 2.2.2
scanpy 1.10.0rc2.dev126+g48706caa
session_info 1.0.0
The text was updated successfully, but these errors were encountered: