Add Zarr v3 output and per-dimension sharding to rechunk2zarr#35
Conversation
Co-authored-by: tackandr <26540124+tackandr@users.noreply.github.com>
|
@copilot When I open a resulting dataset it says: KeyError: 'Zarr object is missing the |
Co-authored-by: tackandr <26540124+tackandr@users.noreply.github.com>
Fixed in f03d3b4. The v3 destination arrays weren't getting a |
rechunk2zarronly produced Zarr v2 stores. This adds a--zarr-formatswitch and per-dimension shard sizes so users can emit v3 sharded arrays.Changes
rechunk.pyrechunk_zarrkwargs:zarr_format(2 or 3, default 2) andt_shard/c_shard/spatial_shard._validate_shardshelper: rejects shards whenzarr_format != 3, requires each shard to be a positive-integer multiple of its chunk, and requires an explicitc_chunkwhenc_shardis set.shards=tocreate_array; axes without an explicit shard collapse to one chunk per shard (i.e. no sharding on that axis).compressors="auto"is used — v2 numcodecs compressors from the source aren't valid v3BytesBytesCodecs and can't be passed through.--zarr-format {2,3},--t-shard,--c-shard,--spatial-shard.test_rechunk.py(new): validation edge cases + end-to-end tests for v2, v3-no-shards, v3 full sharding, and v3 partial sharding.README.md: documents the new flags and library usage.Example
rechunk2zarr src.zarr dst.zarr --zarr-format 3 \ --t-chunk 24 --t-shard 48 --spatial-chunk 100 --spatial-shard 500