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()

file: Path | str

Location of Zarr store file or directory

path: str | None = None

Path to array within hierarchical zarr store

open(**kwargs: dict) Array[source]

Open the zarr array at the provided path

classmethod from_iterable(spec: Sequence) ZarrArrayPath[source]

Construct a ZarrArrayPath specifier 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

return_type

alias of Array

classmethod enabled() bool[source]

True if zarr is installed

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 the zarr.core.Array.hexdigest().

The full array can be returned by passing 'zarr_dump_array': True to the serialization context

model.model_dump_json(context={'zarr_dump_array': True})