Expand description
Zarr arrays.
An array is a node in a Zarr hierarchy used to hold multidimensional array data and associated metadata. See https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#array.
A Zarr V3 array is defined by the following parameters (which are encoded in its JSON metadata):
- shape: defines the length of the array dimensions,
- data type: defines the numerical representation array elements,
- chunk grid: defines how the array is subdivided into chunks,
- chunk key encoding: defines how chunk grid cell coordinates are mapped to keys in a store,
- fill value: an element value to use for uninitialised portions of the array,
- codecs: used to encode and decode chunks.
- (optional) attributes: user-defined attributes,
- (optional) storage transformers: used to intercept and alter the storage keys and bytes of an array before they reach the underlying physical storage, and
- (optional) dimension names: defines the names of the array dimensions.
See https://zarr-specs.readthedocs.io/en/latest/v3/core/index.html#array-metadata for more information on array metadata.
zarrs supports a subset of Zarr V2 arrays which are a compatible subset of Zarr V3 arrays.
This encompasses Zarr V2 array that use supported codecs and could be converted to a Zarr V3 array with only a metadata change.
The documentation for Array details how to interact with arrays.
Re-exports§
pub use self::builder::ArrayBuilder;pub use self::codec::CodecChain;pub use self::storage_transformer::StorageTransformerChain;pub use self::storage_transformer::StorageTransformerTraits;
Modules§
- builder
Arraybuilders.- chunk_
cache - Chunk caching.
- chunk_
grid - Zarr chunk grids.
- chunk_
key_ encoding - Zarr chunk key encodings. Includes a default and v2 implementation.
- codec
- Zarr codecs.
- concurrency
- Concurrency utilities for arrays and codecs.
- data_
type - Zarr data types.
- iterators
- Array subset iterators.
- storage_
transformer - Zarr storage transformers.
Structs§
- Additional
Field Unsupported Error - An unsupported additional field error.
- Array
- A Zarr array.
- Array
Bytes Fixed Disjoint View - A disjoint view of the bytes in an array with a fixed-length data type.
- Array
Bytes Offsets - Array element byte offsets.
- Array
Bytes Optional - Optional array bytes composed of data and a validity mask.
- Array
Bytes RawOffsets OutOf Bounds Error - An error raised if variable length array bytes offsets are out of bounds.
- Array
Bytes Variable Length - Variable length array bytes composed of bytes and element bytes offsets.
- Array
Metadata Options - Options for writing array metadata.
- Array
Metadata V2 - Zarr V2 array metadata.
- Array
Metadata V3 - Zarr V3 array metadata.
- Array
Sharded Readable ExtCache sharding - A cache used for methods in the
ArrayShardedReadableExttrait. - Array
Subset - An array subset.
- Async
Array Sharded Readable ExtCache shardingandasync - A cache used for methods in the
AsyncArrayShardedReadableExttrait. - Chunk
Grid - A chunk grid implementing
ChunkGridTraits. - Chunk
KeyEncoding - A chunk key encoding.
- Codec
Metadata Options - Options for codec metadata.
- Codec
Options - Codec options for encoding/decoding.
- Data
Type - A data type implementing
DataTypeTraits. - Fill
Value - A fill value.
- Incompatible
Dimensionality Error - An incompatible dimensionality error.
- Recommended
Concurrency - The recommended concurrency of a codec includes the most efficient and maximum recommended concurrency.
- Storage
Partial Decoder - A
ReadableStoragestore value partial decoder. - Tensor
- A tensor holding raw bytes with data type and shape metadata.
Enums§
- Array
Bytes - Fixed or variable length array bytes.
- Array
Bytes Decode Into Target - A target for decoding array bytes into a preallocated output view.
- Array
Bytes Error - Errors related to
ArrayBytes<'_>andArrayBytes. - Array
Bytes Fixed Disjoint View Create Error - Errors that can occur when creating a
ArrayBytesFixedDisjointView. - Array
Bytes RawOffsets Create Error - An error creating
ArrayBytesOffsets. - Array
Create Error - An array creation error.
- Array
Error - Array errors.
- Array
Metadata - Zarr array metadata (V2 or V3).
- Array
Subset Error - An incompatible start/end indices error.
- Bytes
Representation - The decoded representation of
bytes. - Chunk
KeySeparator - A chunk key separator.
/or.. - Codec
- A generic array to array, array to bytes, or bytes to bytes codec.
- Codec
Error - A codec error.
- Data
Type Size - A data type size. Fixed or variable.
- Element
Error - An element error.
- Endianness
- Endianness. Either
bigorlittle. - Fill
Value Metadata - Zarr V3 fill value metadata.
- Indexer
Error - An incompatible indexer and array shape error.
- Tensor
Error - Errors related to
Tensoroperations.
Constants§
- ZARR_
NAN_ BF16 - The Zarr V3 “NaN” fill value for a 16-bit brain floating point number.
- ZARR_
NAN_ F16 - The Zarr V3 “NaN” fill value for a 16-bit IEEE 754 floating point number.
- ZARR_
NAN_ F32 - The Zarr V3 “NaN” fill value for a 32-bit IEEE 754 floating point number.
- ZARR_
NAN_ F64 - The Zarr V3 “NaN” fill value for a 64-bit IEEE 754 floating point number.
Traits§
- Array
Codec Traits - Traits for both array to array and array to bytes codecs.
- Array
Partial Decoder Traits - Partial array decoder traits.
- Array
Partial Encoder Traits - Partial array encoder traits.
- Array
Sharded Ext sharding - An
Arrayextension trait to simplify working with arrays using thesharding_indexedcodec. - Array
Sharded Readable Ext sharding - An
Arrayextension trait to efficiently read data (e.g. subchunks) from arrays using thesharding_indexedcodec. - Array
Subset Traits - Trait for types that represent an array region (start and shape).
- Array
ToArray Codec Traits - Traits for array to array codecs.
- Array
ToBytes Codec Traits - Traits for array to bytes codecs.
- Async
Array Partial Decoder Traits async - Asynchronous partial array decoder traits.
- Async
Array Partial Encoder Traits async - Asynchronous partial array encoder traits.
- Async
Array Sharded Readable Ext shardingandasync - An
Arrayextension trait to efficiently read data (e.g. subchunks) from arrays using thesharding_indexedcodec. s Sharding indexes are cached in aAsyncArrayShardedReadableExtCacheenabling faster retrieval. - Async
Bytes Partial Decoder Traits async - Asynchronous partial bytes decoder traits.
- Async
Bytes Partial Encoder Traits async - Asynhronous partial bytes encoder traits.
- Bytes
Partial Decoder Traits - Partial bytes decoder traits.
- Bytes
Partial Encoder Traits - Partial bytes encoder traits.
- Bytes
ToBytes Codec Traits - Traits for bytes to bytes codecs.
- Chunk
Grid Traits - Chunk grid traits.
- Chunk
Grid Traits Iterators - Chunk grid iterators.
- Chunk
KeyEncoding Traits - Chunk key encoding traits.
- Chunk
Shape Traits - A trait for chunk shapes.
- Codec
Traits - Codec traits.
- Codec
Traits V2 - Trait for creating a codec from Zarr V2 metadata.
- Codec
Traits V3 - Trait for creating a codec from Zarr V3 metadata.
- Data
Type Traits - Traits for a data type extension.
- Data
Type Traits V2 - Trait for creating a data type from Zarr V2 metadata.
- Data
Type Traits V3 - Trait for creating a data type from Zarr V3 metadata.
- Element
- A trait representing an array element type.
- Element
Owned - A trait representing an owned array element type.
- From
Array Bytes - A trait for types that can be constructed from
ArrayBytes, an array shape and aDataType. - Indexer
- A trait for a generic indexer.
- Into
Array Bytes - A trait for types that can be converted into
ArrayBytesfor storage.
Functions§
- bytes_
to_ ndarray ndarray - Convert a vector of bytes to an
ndarray::ArrayD. - chunk_
shape_ to_ array_ shape - Convert a
ChunkShapereference to anArrayShape. - convert_
from_ bytes_ slice - Transmute from
&[u8]toVec<T>. - convert_
to_ bytes_ vec - Convert from
&[T]toVec<u8>. - copy_
fill_ value_ into - Decode the fill value into a subset of a preallocated output.
- elements_
to_ ndarray ndarray - Convert a vector of elements to an
ndarray::ArrayD. - ravel_
indices - Ravel ND indices to a linearised index.
- transmute_
from_ bytes_ vec - Transmute from
Vec<u8>toVec<T>. - transmute_
to_ bytes - Transmute from
&[T]to&[u8]. - transmute_
to_ bytes_ vec - Transmute from
Vec<T>toVec<u8>. - unravel_
index - Unravel a linearised index to ND indices.
- update_
array_ bytes - Update array bytes.
Type Aliases§
- Array
Bytes Raw - Raw array element bytes.
- Array
Indices - An ND index to an element in an array or chunk.
- Array
Indices Tiny Vec - An ND index to an element in an array or chunk.
Uses
TinyVecfor stack allocation up to 4 dimensions. - Array
Shape - An array shape. Dimensions may be zero.
- Chunk
Shape - A chunk shape. Dimensions must be non-zero.
- Dimension
Name - A dimension name.