ExZarr.ChunkGrid.Irregular (ExZarr v1.1.0)
View SourceIrregular chunk grid implementation for Zarr v3.
In an irregular chunk grid, chunks can have different shapes. This is useful for arrays where different regions have different optimal chunk sizes, such as datasets with varying spatial or temporal resolution.
Configuration
The configuration map can specify chunk shapes in two ways:
1. Per-dimension chunk sizes
%{
"chunk_sizes" => [[50, 50, 25], [100, 50, 50]]
}Each inner list specifies the chunk sizes along one dimension.
2. Explicit chunk index to shape mapping
%{
"chunk_shapes" => %{
"{0,0}" => [50, 100],
"{0,1}" => [50, 50],
"{1,0}" => [25, 100],
"{1,1}" => [25, 50]
}
}Example
# Variable resolution: first chunks are larger
config = %{
"chunk_sizes" => [
[500, 250, 250], # First dim: 500, 250, 250
[500, 500] # Second dim: 500, 500
]
}
{:ok, grid} = ExZarr.ChunkGrid.Irregular.init(config)Specification
Zarr v3 extensions may define irregular chunk grid patterns. This implementation provides a flexible foundation for such patterns.
Summary
Types
@type t() :: %ExZarr.ChunkGrid.Irregular{ array_shape: tuple() | nil, chunk_shapes_map: %{required(tuple()) => tuple()} | nil, chunk_sizes: [[non_neg_integer()]] | nil }