Repository navigation
zarr: sharded storage (Zarr v3 / OME-NGFF 0.5) as a chunk strategy - #48
Merged
Merged
Conversation
ZarrChunkStrategy.SHARDED stores each plane as its own chunk inside one shard object per array: plane-level random access with one file per well, where FILE writes one object per plane and WELL makes the whole well a single chunk. Each strategy member now owns a ZarrLayout: its chunk shape, its shard shape, the NGFF format that can describe it, and the form its compressor takes in that format. The backend asks the layout through one _array_layout for both write paths (save and save_batch), replacing _calculate_chunks and the v2-only compressor argument. Sharding exists only in Zarr v3, so the sharded layout writes NGFF 0.5 and each compressor factory states its v3 codec: the specification's own codec where it has one (blosc, zstd, gzip for zlib), numcodecs' wrapper only for standalone LZ4, which the specification lacks. Tests: 607 passed. New: the sharded layout's chunk and shard shapes, a one-object round trip with every compressor (chunks that do not divide the array included), and a sharded well batch loaded back through its filename mapping. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSmfWxP4Wnm2cFnvSCk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ZarrChunkStrategy.SHARDED: each plane its own chunk inside one shard object per array (plane-level random access, one file per well).ZarrLayout(chunks, shards, NGFF format, compressor form); the backend's two write paths ask it through one_array_layout._calculate_chunksand the v2-onlycompressor=argument are gone.Tests: 607 passed, 5 skipped. New: layout shapes, a one-object round trip with every compressor, a sharded well batch through its filename mapping.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSmfWxP4Wnm2cFnvSCk