scverse / anndata

Annotated data.
http://anndata.readthedocs.io
BSD 3-Clause "New" or "Revised" License
521 stars 149 forks source link

Fix assigning and initializing with h5py datasets #1537

Closed flying-sheep closed 4 days ago

flying-sheep commented 1 week ago

Fixes an unreleased bug introduced in #1516

AnnData’s StorageType enum doesn’t contain h5py.Dataset, but in scanpy’s tests we set adata.obsm["thing"] = h5py_file["some_dataset"] My path unified handling of AlignedArrays and X so now that “anndata dev” test job in Scanpy throws an error.

How should we do this with backed?

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 84.44%. Comparing base (f87f3a8) to head (9138d94).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1537 +/- ## ======================================= Coverage 84.43% 84.44% ======================================= Files 36 36 Lines 5745 5747 +2 ======================================= + Hits 4851 4853 +2 Misses 894 894 ``` | [Files](https://app.codecov.io/gh/scverse/anndata/pull/1537?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scverse) | Coverage Δ | | |---|---|---| | [src/anndata/\_core/anndata.py](https://app.codecov.io/gh/scverse/anndata/pull/1537?src=pr&el=tree&filepath=src%2Fanndata%2F_core%2Fanndata.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scverse#diff-c3JjL2FubmRhdGEvX2NvcmUvYW5uZGF0YS5weQ==) | `84.78% <ø> (ø)` | | | [src/anndata/\_core/storage.py](https://app.codecov.io/gh/scverse/anndata/pull/1537?src=pr&el=tree&filepath=src%2Fanndata%2F_core%2Fstorage.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scverse#diff-c3JjL2FubmRhdGEvX2NvcmUvc3RvcmFnZS5weQ==) | `100.00% <100.00%> (ø)` | | | [src/anndata/tests/helpers.py](https://app.codecov.io/gh/scverse/anndata/pull/1537?src=pr&el=tree&filepath=src%2Fanndata%2Ftests%2Fhelpers.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scverse#diff-c3JjL2FubmRhdGEvdGVzdHMvaGVscGVycy5weQ==) | `86.23% <100.00%> (+0.03%)` | :arrow_up: |
ilan-gold commented 5 days ago

I'm also going to do a fix for that test.

flying-sheep commented 4 days ago

The “use zarr arrays as .X” came in #38, which was a different time for sure. No tests, so I’ll add some