Skip to content

Make zarr store chunking and sharding configurable via CLI#179

Merged
akhanf merged 2 commits into
mainfrom
copilot/make-chunking-sharding-configurable
Jun 17, 2026
Merged

Make zarr store chunking and sharding configurable via CLI#179
akhanf merged 2 commits into
mainfrom
copilot/make-chunking-sharding-configurable

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Chunking and sharding for intermediate OME-Zarr stores were hardcoded in snakebids.yml. This exposes them as CLI options and wires them into the workflow at runtime.

Changes

  • snakebids.yml: Adds two new CLI args; removes hardcoded chunks from zarrnii_out_kwargs.storage_options:
    • --zarr-store-chunks — 4-int tuple (c, x, y, z), default 1 128 128 128
    • --zarr-store-shards — 4-int tuple (c, x, y, z), default disabled
  • Snakefile: Reads both CLI values and populates config['zarrnii_out_kwargs']['storage_options'] at startup; sharding is suppressed when --zarr-store-ext ozx (zip format doesn't support sharding)

Example

# Custom chunks, no shards (ozx format — shards silently ignored even if provided)
spimquant bids/ out/ participant --zarr-store-chunks 1 256 256 256

# Enable sharding (requires ome.zarr directory format)
spimquant bids/ out/ participant \
  --zarr-store-ext ome.zarr \
  --zarr-store-chunks 1 128 128 128 \
  --zarr-store-shards 1 512 512 512

@akhanf akhanf marked this pull request as ready for review June 17, 2026 08:30
@akhanf akhanf merged commit 5df369a into main Jun 17, 2026
3 of 4 checks passed
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.

2 participants