-
Notifications
You must be signed in to change notification settings - Fork 155
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
anndata.concat()
merging of uns
doesn't work for None
values
#711
Comments
Thanks for the bug report, and sorry about the time it took to respond. I'm not able to reproduce with either 0.7.8 or 0.8.0. Are you still seeing this? import anndata as ad
import numpy as np
a = ad.AnnData(np.ones((3, 3)), uns={"property": {"0": None}})
b = ad.AnnData(np.ones((3, 3)), uns={"property": {"1": None}})
ad.concat([a, b], uns_merge="unique").uns["property"]
# {'0': None, '1': None} ad.__version__
# '0.7.8' |
Okay, I guess I reported the bug slightly incorrectly. The result is correct after concatenating, but after I write to an HDF5 file with import anndata as ad
import numpy as np
a = ad.AnnData(np.ones((3, 3)), uns={"property": {"0": None}})
b = ad.AnnData(np.ones((3, 3)), uns={"property": {"1": None}})
merged_dataset = ad.concat([a, b], uns_merge="unique")
merged_dataset.uns["property"]
# {'0': None, '1': None}
merged_dataset.write("issue.h5")
reloaded_dataset = ad.read_h5ad("issue.h5")
reloaded_dataset.uns["property"]
# {}
ad.__version__
# '0.8.0' |
This issue has been automatically marked as stale because it has not had recent activity. |
I'm trying to use
anndata.concat()
to merge two AnnData objects with the following structure:When I merge them using
uns_merge="unique"
, the"property"
key is missing from the merged AnnData object. However, when I replace theNone
value with a value like-1
, it works fine. Is this the expected behavior, and if so why?The text was updated successfully, but these errors were encountered: