Skip to content

Hot fix: root attributes

Latest

Choose a tag to compare

@Claptar Claptar released this 23 Mar 16:56
315c06f

Summary

This hotfix improves AnnData on-disk schema compliance and subset-output interoperability, especially for downstream tools that validate element metadata.

Highlights

1) Root AnnData metadata enforcement

  • Enforced root attributes on writable store operations:
    • encoding-type: "anndata"
    • encoding-version: "0.1.0"
  • Added non-fatal read-time warning when these root attributes are missing.
  • Applied enforcement consistently through store copy/convert paths.

2) Subset output schema hardening

  • subset now guarantees presence of optional AnnData mapping groups when absent in source:
    • layers, obsm, obsp, varm, varp
  • These mapping groups now carry mapping metadata for compatibility with this codebase’s documented schema:
    • encoding-type: "dict"
    • encoding-version: "0.1.0"

3) Documentation updates

  • Updated element specification docs for HDF5 and Zarr to align with latest requirements and preserve explicit legacy compatibility notes.
  • Clarified handling of historical mapping metadata (dict v0.1.0) for backward compatibility.

Test Coverage Added/Updated

  • Added tests for root AnnData attribute enforcement and warning behavior.
  • Added/updated subset integration tests to validate optional group creation and mapping metadata.

Impact

  • No intended breaking CLI changes.
  • Improves compatibility with schema-aware downstream readers.
  • Reduces risk of malformed subset outputs due to missing mapping metadata.

Notes for users

  • Some anndata versions (notably <= 0.12.0) may still fail in experimental.concat_on_disk(..., merge='same') when var contains columns due to upstream behavior. This is version-specific to anndata, not specific to this hotfix.

Included changes (since 0.3.1 baseline)

  • Source: storage metadata enforcement and subset schema fixes
  • Docs: element specification updates (HDF5/Zarr)
  • Tests: new/expanded coverage for storage/subset behavior
  • Lockfile: updated uv.lock