Repository navigation
Backlog
Description
AI use transparency
- The analysis and plan were drafted with Claude (Anthropic's Claude Opus 5.5): reading the current
code, the specification, earlier pull requests on remote and zip support, and how anndata
structures its reading code. This description was drafted with Claude as well. - I reviewed the plan and decided the scope and order.
Goal
Restructure the code that reads a SpatialData store from disk (read_zarr) so that it is easier to
read, maintain and extend, without changing what it does. This issue tracks the series; the work
happens in the smaller PRs listed below.
Why
Reading a store is currently one large function. Several features that people want (reading from
the cloud, reading zipped stores, loading tables lazily) and possible future changes to the store
layout all have to change that same function. Earlier attempts at remote and zip support (for
example #1087, #1107, #1141) each had to touch every reader, and several got stuck partly because of
that.
Approach
- No behaviour change. Every PR keeps all existing tests passing. Anything that would change
behaviour gets its own PR and gets presented to maintainers - Small steps, each reviewable on its own.
- Safety net first: PR 1 in the plan below adds datasets written by older releases, so we notice if a step breaks
reading old files. - Separate concerns, so each future feature touches one well-defined place:
- opening the store (local, remote, zipped)
- knowing where elements are in the store
- deciding what kind of element something is
- reading one element
Plan
- 1. Safety net: reference stores written by older releases, and tests (#<PR 1>)
- 2. Readers take an opened group instead of a file path
- 3. Open the store in one place
- 4. A table of readers by element type and version
- 5. Describe the store layout in one place, per format version
- 6. Make
read_zarritself short: it only connects the steps above - 7. Use the same layout description when writing and listing elements
Outlook
The series doesn't add these features, but it makes them easier to add later:
- remote stores (feat: generalize Zarr I/O in
spatialdatato local and add remote (fsspec / UPath) backends #1107) and zipped stores (Accept zipped zarr stores as an input for spatialdata.read_zarr(). Must also have ome-zarr-py ZarrLocation changes. #1141) - lazy tables (feat: Add lazy table loading via anndata.experimental.read_lazy #1055)
- reading a single element (Incremental reading APIs #843)
- choosing readers from element metadata, and skipping elements of unknown versions (as the
specification recommends) - reading parts of tiled elements (RFC 3/4 from Spatialdata-spec)
- future changes to the store layout
Metadata
Metadata
Assignees
Labels
No labels
Activity