Skip to content

add tests for reading of legacy files (closes #92) - #168

Merged
ilia-kats merged 2 commits into
mainfrom
backwards_compat
Jul 15, 2026
Merged

ilia-kats merged 2 commits into
mainfrom
backwards_compat

Conversation

@ilia-kats

@ilia-kats ilia-kats commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Reference files are generated with src/mudata/tests/reference.py. This is based on the mudata fixture in tests/conftest.py, but it had to be modified, since NumPy does not guarantee stability of its random number generator across versions, so this needs to be completely deterministic.

See also the discussion in #92 .

@ilia-kats
ilia-kats force-pushed the backwards_compat branch 2 times, most recently from 99c7722 to 94ed597 Compare July 10, 2026 10:15
@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.11%. Comparing base (2147f72) to head (69606bf).

Files with missing lines Patch % Lines
src/mudata/tests/reference.py 87.09% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
- Coverage   91.12%   91.11%   -0.02%     
==========================================
  Files          11       12       +1     
  Lines        1826     1857      +31     
==========================================
+ Hits         1664     1692      +28     
- Misses        162      165       +3     
Files with missing lines Coverage Δ
src/mudata/_core/utils.py 93.97% <100.00%> (-1.21%) ⬇️
src/mudata/tests/reference.py 87.09% <87.09%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ilia-kats
ilia-kats force-pushed the backwards_compat branch 6 times, most recently from d6530c7 to 804ccd1 Compare July 11, 2026 15:10
@ilia-kats
ilia-kats requested review from gtca and ilan-gold July 11, 2026 15:13
Reference files are generated with src/mudata/tests/reference.py.
This is based on the mudata fixture in tests/conftest.py, but it had to
be modified, since NumPy does not guarantee stability of its random
number generator across versions, so this needs to be completely
deterministic.

@ilan-gold ilan-gold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main question is: why not use h5diff for the newer file versions? #92 (comment) seems to only say some subset of the older verisons would not work under this (I think only the v0.1.2?)

@ilia-kats

Copy link
Copy Markdown
Collaborator Author

v0.2.4 was generated with AnnData 0.10.8, so that would also be affected (although I guess I could regenerate with AnnData 0.11, but I specifically tried to use the oldest supported versions). Also from a conceptual point of view, we only care about reading old files, nobody guarantees that writing will generate the same file as some previous version, so h5diff doesn't seem like the right approach. Finally, I think this approach is more future-proof: Suppose MuData or AnnData add additional attributes in the future, say another mapping (for example, if we decide to integrate #111 into MuData). Even an empty mapping will create an empty group in the HDF5, making h5diff fail.

@ilan-gold ilan-gold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! Looks good then!

@ilia-kats
ilia-kats enabled auto-merge (squash) July 15, 2026 15:24
@ilia-kats
ilia-kats disabled auto-merge July 15, 2026 15:24
@ilia-kats
ilia-kats merged commit 44cd0e3 into main Jul 15, 2026
9 checks passed
@ilia-kats
ilia-kats deleted the backwards_compat branch July 15, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants