Skip to content

ChunkGrid

zarrista.ChunkGrid

The chunk grid of an array: how its shape is partitioned into chunks.

array_shape property

array_shape: list[int]

The shape of the array, in elements along each dimension.

grid_shape property

grid_shape: list[int]

The shape of the grid, in number of chunks along each dimension.

metadata property

metadata: NamedConfigV3

The chunk grid's Zarr v3 metadata.

ndim property

ndim: int

The number of dimensions.

from_metadata staticmethod

from_metadata(metadata: NamedConfigV3, shape: Sequence[int]) -> ChunkGrid

Build a chunk grid from its Zarr v3 metadata and the array shape.

rectilinear staticmethod

rectilinear(
    array_shape: Sequence[int], chunk_shapes: Sequence[_ChunkEdgeLengths]
) -> ChunkGrid

Construct a rectilinear grid with per-dimension chunk sizes.

regular staticmethod

regular(array_shape: Sequence[int], chunk_shape: Sequence[int]) -> ChunkGrid

Construct a regular grid with a fixed chunk_shape over array_shape.

regular_bounded staticmethod

regular_bounded(
    array_shape: Sequence[int], chunk_shape: Sequence[int]
) -> ChunkGrid

Construct a regular grid whose final chunks are clipped to the array bounds.

Experimental and may be incompatible with other Zarr V3 implementations.

zarrista.ChunkKeyEncoding

How an array maps chunk grid indices to store keys.

metadata property

metadata: NamedConfigV3

The chunk key encoding's Zarr v3 metadata.

name property

name: str | None

The chunk key encoding's Zarr v3 name (e.g. "default"), if any.

default staticmethod

default(sep: Literal['.', '/']) -> ChunkKeyEncoding

Construct the default chunk key encoding with the given separator.

from_metadata staticmethod

from_metadata(metadata: NamedConfigV3) -> ChunkKeyEncoding

Build a chunk key encoding from its Zarr v3 metadata.