Array creation¶
zarrista.ArrayBuilder ¶
A chained, immutable builder for creating Zarr arrays.
Every setter returns a new ArrayBuilder and leaves the receiver
unchanged, so a builder can be safely shared and specialized. Seed one with
the constructor or ArrayBuilder.like, chain
setters to configure it, then materialize the array with
create /
create_async, or produce only its
metadata with
create_metadata.
__init__ ¶
Create a builder from a chunk grid, data type, and fill value.
attrs ¶
attrs(attrs: Mapping[str, JSONValue]) -> ArrayBuilder
Return a new builder with the given user attributes set.
chunk_grid ¶
chunk_grid(chunk_grid: ChunkGrid) -> ArrayBuilder
Return a new builder with the chunk grid set.
This may also change the array shape, since the grid carries one.
chunk_key_encoding ¶
chunk_key_encoding(chunk_key_encoding: ChunkKeyEncoding) -> ArrayBuilder
Return a new builder with the chunk key encoding set.
compressors ¶
compressors(compressors: Sequence[BytesToBytesCodec]) -> ArrayBuilder
Return a new builder with the bytes-to-bytes codecs ("compressors") set.
create ¶
create(store: FilesystemStore | MemoryStore, path: str) -> Array
Build the array in store at path and return it.
create_async
async
¶
create_async(store: AsyncStore, path: str) -> AsyncArray
Build the array in an async store at path and return it.
create_metadata ¶
create_metadata() -> ArrayMetadataV3
Build the array's Zarr v3 metadata without touching a store.
data_type ¶
data_type(data_type: DataType) -> ArrayBuilder
Return a new builder with the data type set.
dimension_names ¶
dimension_names(dimension_names: Sequence[str | None] | None) -> ArrayBuilder
Return a new builder with the dimension names set (or cleared).
filters ¶
filters(filters: Sequence[ArrayToArrayCodec]) -> ArrayBuilder
Return a new builder with the array-to-array codecs ("filters") set.
like
staticmethod
¶
like(array: Array | AsyncArray) -> ArrayBuilder
Create a builder copying the configuration of an existing array.
serializer ¶
serializer(serializer: ArrayToBytesCodec) -> ArrayBuilder
Return a new builder with the array-to-bytes codec ("serializer") set.
Sharding is itself an array-to-bytes codec, so a sharding serializer is passed here too.
subchunk_shape ¶
subchunk_shape(subchunk_shape: Sequence[int] | None) -> ArrayBuilder
Return a new builder with the inner (subchunk) shape, enabling sharding.