Skip to content

feat: add the zarr-indexing package (TensorStore-style index transforms, ndsel wire format) - #249

Open
d-v-b wants to merge 4 commits into
mainfrom
feat/zarr-indexing-package
Open

feat: add the zarr-indexing package (TensorStore-style index transforms, ndsel wire format)#249
d-v-b wants to merge 4 commits into
mainfrom
feat/zarr-indexing-package

Conversation

@d-v-b

@d-v-b d-v-b commented Jul 28, 2026

Copy link
Copy Markdown
Owner

🤖 AI text below 🤖

Adds zarr-indexing as a standalone uv-workspace package (packages/zarr-indexing, import name zarr_indexing), without wiring it into zarr's runtime — per the land-the-package-first sequencing. The runtime integration (lazy .lazy indexing, transform-routed selection I/O) stays on refactor/simplify-indexing (zarr-developers#3906) and will gain the zarr-indexing>=0.1.0 dependency only after 0.1.0 is on PyPI.

What the package is

  • TensorStore-style index-transform algebra: IndexTransform / IndexDomain / three output-map kinds, full-input-rank index arrays with dependency-axis-derived correlation (oindex outer-product vs vindex broadcast), composition, literal-coordinate slice semantics verified against tensorstore 0.1.84.
  • Chunk resolution: maps a composed transform to per-chunk selections against a DimensionGridLike protocol (public-name-only contract; zarr's per-dimension grids satisfy it structurally, no zarr import). Includes the touched-chunks-only enumeration and the sorted-1-D fast path from perf(zarr-transforms): partition sorted 1-D array maps by chunk #234.
  • ndsel-conformant wire format: parse_ndsel / normalize_ndsel implement the ndsel draft spec (all five message kinds, canonical normalize, full error taxonomy), validated against the byte-vendored conformance corpus plus a tensorstore IndexTransform(json=...) round-trip cross-check.

Contents

  • packages/zarr-indexing/ — sources, tests (273, all green against main's zarr), vendored ndsel corpus with provenance, own towncrier changelog.
  • .github/workflows/zarr-indexing.yml — pytest (3.12–3.14) / ruff / pyright, paths-filtered; test job uses uv sync --all-packages since zarr does not depend on the package here.
  • .github/workflows/zarr-indexing-release.yml — tag-triggered (zarr_indexing-v*) TestPyPI/PyPI publish with attestation and an isolated-wheel smoke test; byte-identical to the zarr-metadata release flow modulo the package name. A local dress rehearsal of the tagged build produced exactly 0.1.0 and the wheel imports with no zarr installed.
  • check_changelogs.yml — covers the package's changes/ dir.
  • Root pyproject.toml — uv workspace membership only (no runtime dependency).

Sequencing

  1. Land this PR.
  2. Configure PyPI trusted publishing for zarr-indexing → push zarr_indexing-v0.1.0.
  3. feat: add IndexTransform library for composable, lazy coordinate mappings zarr-developers/zarr-python#3906 then adds the runtime dependency and the integration layer (its packages/ tree converges with this one on merge).

History note: files were developed on the zarr-developers#3906 branch (with per-commit review); git log --follow traces their evolution there.

Standalone workspace package extracted from the lazy-indexing branch
(zarr-developers#3906): composable, lazy coordinate transforms
(IndexTransform / IndexDomain / output maps), dependency-aware chunk
resolution against a DimensionGridLike protocol, and an ndsel-conformant
JSON wire format validated against the vendored conformance corpus.

zarr itself does not depend on zarr-indexing yet — the runtime wiring
lands separately once 0.1.0 is published. The package is numpy-only;
its tests exercise chunk resolution against zarr's concrete ChunkGrid,
so they run from the workspace root (uv sync --all-packages).

Assisted-by: ClaudeCode:claude-fable-5
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