Skip to content

implement 'use' for writing methods - #222

Open
ilia-kats wants to merge 5 commits into
mainfrom
write_use
Open

ilia-kats wants to merge 5 commits into
mainfrom
write_use

Conversation

@ilia-kats

@ilia-kats ilia-kats commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Same as scverse/anndata#2707, but for MuData.

There are several hacks to bypass the sanity checks in anndata's implementation:

  • overriding the attrs with something returning anndata's encoding type and version. This is necessary to be able to pass in a MuData object to anndata's write_use, which happens when writing e.g. MuData.obs, MuData.var etc.
  • Creating AnnData accessors from MuData accessors. This is necessary to bypass the dimensionality check: The check reads obs_names / var_names of the passed in object, which would be a MuData object if using a MuData accessor, so the names don't match what's on disk for the individual modality.

Removing the hacks would require making anndata's write_use more flexible: Adding a boolean argument to disable encoding type/version checking and adding arguments to pass in obs_names and var_names to check against.

The CI is failing due to warnings related to Pandas 3.1. The warnings will disappear with anndata 0.13.5. Everything else is passing (though the new code is not tested in CI yet becase there is no pre-release of anndata 0.14, but the tests pass locally).

@ilia-kats
ilia-kats marked this pull request as ready for review October 30, 2026 12:17
@ilia-kats
ilia-kats requested review from gtca and ilan-gold October 30, 2026 12:17

This branch has not been deployed

No deployments
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.

1 participant