Skip to content

Write and use consolidated metadata - #492

Open
Bisaloo wants to merge 13 commits into
scverse:develfrom
Bisaloo:consolidated-metadata
Open

Write and use consolidated metadata#492
Bisaloo wants to merge 13 commits into
scverse:develfrom
Bisaloo:consolidated-metadata

Conversation

@Bisaloo

@Bisaloo Bisaloo commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Related to: fix #461

Description

In line of what anndata python is doing, this PR:

  • always writes consolidated metadata when writing anndata to Zarr.
  • uses the metadata when reading (it's created on the fly if it doesn't exist on disk) to avoid multiple reading of multiple JSON files.

Eventually, in a follow up PR, this can also be used to add reading from S3.

Checklist

Before review

  • Update and regenerate man pages
  • Add/update tests
  • Add/update examples in vignettes
  • Pass CI checks

Before merge

  • Update NEWS
  • Bump devel version

@Bisaloo
Bisaloo marked this pull request as ready for review July 28, 2026 21:25
@Bisaloo
Bisaloo marked this pull request as draft July 29, 2026 09:01
@Bisaloo
Bisaloo marked this pull request as ready for review July 29, 2026 09:59
@Bisaloo

Bisaloo commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

I'll stop here for a first review & merge if this seems good.

The 2nd stage, which will bring reading from S3 and further performance improvement, will require changing the signature of some helper function, so I prefer to do it in a dedicated PR.

For example, read_zarr_categorical() would now have ordered in its signature so it can be passed directly from the consolidated metadata, and all read_zarr_attributes() calls can be avoided (or even eliminated) from individual low-level helpers.

Comment thread R/ZarrAnnData.R Outdated
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

🐰 Bencher Report

ProjectanndataR
Branchconsolidated-metadata
Testbedubuntu-latest

⚠️ WARNING: Truncated view!

The full continuous benchmarking report exceeds the maximum length allowed on this platform.

🚨 9 Alerts

🐰 View full continuous benchmarking report in Bencher

@lazappi lazappi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this looks good. Does there need to be any checks for the Zarr version?

Comment thread DESCRIPTION
Package: anndataR
Title: AnnData interoperability in R
Version: 1.3.1
Version: 1.3.2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if we want to bump this yet (I've lost track of how we were managing versions, @rcannood might have a plan)

@Bisaloo

Bisaloo commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Does there need to be any checks for the Zarr version?

From Rarr's side, no. Consolidated metadata is generated, and would be beneficial, for both v2 and v3. I don't know if the anndata spec is strict about this but my view is that even if anndata python doesn't generate it / use it for v2, they are not likely to be hindered by it either.

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.

Consolidated Zarr metadata at the root of the anndata zarr store

2 participants