Skip to content

Zarr v3 sharding support#557

Draft
r-xue wants to merge 4 commits intocasangi:355-zarr-python-v3-and-zarr-v3from
r-xue:zarr-v3-sharding-support
Draft

Zarr v3 sharding support#557
r-xue wants to merge 4 commits intocasangi:355-zarr-python-v3-and-zarr-v3from
r-xue:zarr-v3-sharding-support

Conversation

@r-xue
Copy link
Copy Markdown
Collaborator

@r-xue r-xue commented Mar 24, 2026

No description provided.

r-xue added 3 commits March 23, 2026 14:29
…version functions

Changes:
- `encoding.py`: rewrite add_encoding() with full sharding support
  - new `shards` parameter accepts dict (per-dim absolute shard sizes)
 or int (uniform factor: shard = factor × chunk for every dim)
  - ShardingCodec wraps BytesCodec + compressor as inner-chunk codecs

- `convert_msv2_to_processing_set.py`: expose sharding at public API
  - add main_shards / pointing_shards (dict | int | None) parameters
  - forward both params to convert_and_write_partition in serial and
 parallel (dask.delayed) call sites

- `conversion.py`: thread sharding down to the write layer
  - add main_shards / pointing_shards to convert_and_write_partition
  - pass consolidated=False to ms_xdt.to_zarr() to suppress warning
  - update compressor docstring type annotation
- Upgrade xarray to >=2025.09.0 and refactor to use xarray's native "shards"/"chunks"
encoding keys instead of constructing ShardingCodec directly.
- Delegate Dask rechunking to to_zarr(align_chunks=True) instead of manual alignment. - Simplify add_encoding() logic and remove zarr.codecs import.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 24, 2026

Codecov Report

❌ Patch coverage is 62.16216% with 14 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/xradio/_utils/zarr/encoding.py 52.38% 10 Missing ⚠️
src/xradio/image/_util/_zarr/xds_to_zarr.py 42.85% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

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