Zarr¶
Interface to zarr arrays
- class ZarrArrayPath(file: Path | str, path: str | None = None)[source]¶
Map to an array within a zarr store.
See
zarr.open()- classmethod from_iterable(spec: Sequence) ZarrArrayPath[source]¶
Construct a
ZarrArrayPathspecifier from an iterable, rather than kwargs
- class ZarrInterface(shape: Tuple[int, ...] | Any, dtype: str | type | Any | generic)[source]¶
Interface to in-memory or on-disk zarr arrays
- classmethod check(array: Any) bool[source]¶
Check if array is in-memory zarr array, a path to a zarr array, or a
ZarrArrayPath
- before_validation(array: Array | str | Path | ZarrArrayPath | Sequence) Array[source]¶
Ensure that the zarr array is opened
- get_dtype(array: Array) str | type | Any | generic[source]¶
Override base dtype getter to handle zarr’s string-as-object encoding.
- classmethod to_json(array: Array | str | Path | ZarrArrayPath | Sequence, info: SerializationInfo | None = None) dict[source]¶
Dump just the metadata for an array from
zarr.core.Array.info_items()plus thezarr.core.Array.hexdigest().The full array can be returned by passing
'zarr_dump_array': Trueto the serializationcontextmodel.model_dump_json(context={'zarr_dump_array': True})