/zarr-data-format:zarr-xarray-integrationfrom zarr-data-format
Reads, writes, appends, and region-writes Zarr stores through xarray and Dask. Handles encoding, chunk alignment, and common to_zarr errors like overlapping chunks or stale consolidated metadata.
Ships in zarr-data-format. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Reads, writes, appends to and region-writes Zarr stores through xarray and Dask without corrupting their layout, coordinates or timestamps.
Core principle: to_zarr writes what the encoding says and checks little else. On-disk chunks come from encoding, which data opened from Zarr keeps through .chunk(). Bad appends and region writes often succeed and leave a wrong store, so check inputs before writing.
to_zarr chunks, dtype, codecs or fill valuesxarray-for-multidimensional-data (scientific-domain-applications plugin)zarr-fundamentalscompression-codecs. Cloud credentials, fsspec, Icechunk: cloud-storage-backendsdata-migrationchunking-strategy, rechunking (zarr-chunk-optimization plugin)| Task | Call |
|---|---|
| Open lazily, one Dask chunk per Zarr chunk | xr.open_zarr(path) (default chunks={}) |
| Bigger Dask chunks, multiples of Zarr's | chunks="auto" or a dict of multiples |
| Open without Dask (NumPy on access) | chunks=None, or xr.open_dataset(path, engine="zarr") |
Public S3 (needs s3fs) | xr.open_zarr("s3://...", storage_options={"anon": True}) |
| Create (fails if present) / overwrite | ds.to_zarr(path) / mode="w" |
| Chunks, dtype, codecs | encoding={"t2m": {"chunks": (24, 90, 180), "dtype": "float32", "compressors": [zarr.codecs.ZstdCodec()]}} |
| Append | new.to_zarr(path, append_dim="time") |
| Pre-allocate, then fill regions | template.to_zarr(path, mode="w", compute=False) (Dask-backed), then part.to_zarr(path, region="auto") |
| Add variables / overwrite values only | mode="a" / mode="r+" (default with region) |
| Zarr v2 output | zarr_format=2 (zarr-python 3 defaults to v3) |
| Consolidated metadata | Written by default. After writes with consolidated=False or plain zarr-python: zarr.consolidate_metadata(path) |
Code for each: patterns.md. Workflows: examples.md. More symptoms: common-issues.md. Demo: python assets/xarray-zarr-roundtrip.py.
ds = xr.open_zarr("in.zarr").chunk({"time": 120, "lat": 90, "lon": 180})
for var in ds.variables.values():
for key in ("chunks", "preferred_chunks", "shards"):
var.encoding.pop(key, None) # else to_zarr keeps the source chunks or raises
ds.to_zarr("out.zarr", mode="w")
| Mistake | What happens | Fix |
|---|---|---|
encoding chunks as a dict | TypeError: ... must be an int or a tuple of ints | Tuple in dim order |
.chunk() then to_zarr on data read from Zarr | Old chunks written silently, or the overlap error below | Pop the stale encoding (above) |
| Dask chunks not whole multiples of Zarr chunks or shards | ValueError: ... would overlap multiple Dask chunks | .chunk() to multiples, or align_chunks=True |
First write sets time units (days since for daily data) | Later hourly appends land on wrong dates; only a UserWarning | First write: encoding={"time": {"units": "seconds since 1970-01-01", "dtype": "int64"}} |
| Appended batch has other lat/lon values | Store's coordinates replaced, no error | Compare indexes first |
| Appended batch adds or drops a variable | Reopening raises conflicting sizes for dimension 'time' | Append exactly the store's variables |
| Appended times overlap the store | Duplicate timestamps, no error | Start after the store's last time |
Explicit region with coords lacking the region dim | ValueError: ... at least one dimension in common with the region's dimensions | region="auto", or drop_vars them |
| Concurrent regions split a Zarr chunk or shard | Lost writes; NumPy-backed regions aren't checked | Region edges on chunk (shard) boundaries |
sel(lat=slice(-30, 30)) on descending latitude (ERA5) | Empty result, no error | slice(30, -30); check 0–360 longitudes |
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (uw-ssec/savvy) — no native marketplace selected
npx claudepluginhub p/uw-ssec-zarr-data-format-plugins-zarr-data-format5 skills in this plugin
/cloud-storage-backendsUse when reading or writing Zarr data on Amazon S3, Google Cloud Storage, Azure Blob or an S3-compatible endpoint such as MinIO, when setting up FsspecStore, ObjectStore (obstore), s3fs, gcsfs, adlfs or Icechunk storage and credentials, or when remote Zarr access fails or is slow, with symptoms like 403 Forbidden, NoCredentialsError, requester-pays buckets, slow store opens, timeouts, high GET-request bills, CORS errors, or an fsspec simplecache or filecache that errors or never hits./compression-codecsUse when choosing or configuring Zarr compression in zarr-python 3 (Blosc, Zstd, Gzip, LZ4, LZMA, BZ2; numcodecs filters such as Delta, Quantize, BitRound, FixedScaleOffset, PackBits; compressors=, filters=, serializer=), when v2-style compressor= or numcodecs code fails on a v3 array, or when a store compresses poorly, decompresses slowly, raises codec errors, or may hold corrupted chunks after Blosc multiprocessing use./data-migrationUse when converting HDF5 (.h5) or NetCDF (.nc) files to Zarr, migrating scientific datasets or a Zarr v2 store to Zarr v3, or building a virtual Zarr store over existing files with VirtualiZarr or kerchunk. Also use when a converted store lost scale_factor, _FillValue or time units, kept the old chunk layout, shows phony_dim names, or fails validation against its source.Other plugins' skills for the same job