Struct zarrs::array::ArrayMetadataV3
source · pub struct ArrayMetadataV3 {
pub zarr_format: usize,
pub node_type: String,
pub shape: ArrayShape,
pub data_type: Metadata,
pub chunk_grid: Metadata,
pub chunk_key_encoding: Metadata,
pub fill_value: FillValueMetadata,
pub codecs: Vec<Metadata>,
pub attributes: Map<String, Value>,
pub storage_transformers: Vec<Metadata>,
pub dimension_names: Option<Vec<DimensionName>>,
pub additional_fields: AdditionalFields,
}
Expand description
Zarr array metadata (storage specification v3).
An example JSON
document for a v3 array:
{
"zarr_format": 3,
"node_type": "array",
"shape": [10000, 1000],
"dimension_names": ["rows", "columns"],
"data_type": "float64",
"chunk_grid": {
"name": "regular",
"configuration": {
"chunk_shape": [1000, 100]
}
},
"chunk_key_encoding": {
"name": "default",
"configuration": {
"separator": "/"
}
},
"codecs": [{
"name": "gzip",
"configuration": {
"level": 1
}
}],
"fill_value": "NaN",
"attributes": {
"foo": 42,
"bar": "apples",
"baz": [1, 2, 3, 4]
}
}
Fields§
§zarr_format: usize
An integer defining the version of the storage specification to which the array store adheres.
node_type: String
A string defining the type of hierarchy node element, must be array
here.
shape: ArrayShape
An array of integers providing the length of each dimension of the Zarr array.
data_type: Metadata
The data type of the Zarr array.
chunk_grid: Metadata
The chunk grid of the Zarr array.
chunk_key_encoding: Metadata
The mapping from chunk grid cell coordinates to keys in the underlying store.
fill_value: FillValueMetadata
Provides an element value to use for uninitialised portions of the Zarr array.
Suitable values are dependent on the data type.
Boolean. The value must be a JSON boolean (false or true).
Signed integers (int{8,16,32,64}
) or unsigned integers (uint{8,16,32,64}
).
The value must be a JSON number with no fraction or exponent part that is within the representable range of the data type.
Floating point numbers (float{16,32,64}
, bfloat16
).
- A JSON number, that will be rounded to the nearest representable value.
- A JSON string of the form:
"Infinity"
, denoting positive infinity;"-Infinity"
, denoting negative infinity;"NaN"
, denoting thenot-a-number (NaN) value where the sign bit is 0 (positive), the most significant bit (MSB) of the mantissa is 1, and all other bits of the mantissa are zero;- *
"0xYYYYYYYY"
, specifying the byte representation of the floating point number as an unsigned integer.
Complex numbers (complex{64,128}
)
The value must be a two-element array, specifying the real and imaginary components respectively, where each component is specified as defined above for floating point number.
Raw data types (r<N>
)
An array of integers, with length equal to <N>
, where each integer is in the range [0, 255]
.
codecs: Vec<Metadata>
Specifies a list of codecs to be used for encoding and decoding chunks.
attributes: Map<String, Value>
Optional user defined attributes.
storage_transformers: Vec<Metadata>
An optional list of storage transformers.
dimension_names: Option<Vec<DimensionName>>
An optional list of dimension names.
additional_fields: AdditionalFields
Additional fields.
Implementations§
source§impl ArrayMetadataV3
impl ArrayMetadataV3
sourcepub fn new(
shape: ArrayShape,
data_type: Metadata,
chunk_grid: Metadata,
chunk_key_encoding: Metadata,
fill_value: FillValueMetadata,
codecs: Vec<Metadata>,
attributes: Map<String, Value>,
storage_transformers: Vec<Metadata>,
dimension_names: Option<Vec<DimensionName>>,
additional_fields: AdditionalFields
) -> Self
pub fn new( shape: ArrayShape, data_type: Metadata, chunk_grid: Metadata, chunk_key_encoding: Metadata, fill_value: FillValueMetadata, codecs: Vec<Metadata>, attributes: Map<String, Value>, storage_transformers: Vec<Metadata>, dimension_names: Option<Vec<DimensionName>>, additional_fields: AdditionalFields ) -> Self
Create a new array metadata.
sourcepub const fn validate_format(&self) -> bool
pub const fn validate_format(&self) -> bool
Validates that the zarr_format
field is 3
.
sourcepub fn validate_node_type(&self) -> bool
pub fn validate_node_type(&self) -> bool
Validates that the node_type
is "array"
.
Trait Implementations§
source§impl Clone for ArrayMetadataV3
impl Clone for ArrayMetadataV3
source§fn clone(&self) -> ArrayMetadataV3
fn clone(&self) -> ArrayMetadataV3
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ArrayMetadataV3
impl Debug for ArrayMetadataV3
source§impl<'de> Deserialize<'de> for ArrayMetadataV3
impl<'de> Deserialize<'de> for ArrayMetadataV3
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Display for ArrayMetadataV3
impl Display for ArrayMetadataV3
source§impl From<ArrayMetadataV3> for ArrayMetadata
impl From<ArrayMetadataV3> for ArrayMetadata
source§fn from(original: ArrayMetadataV3) -> ArrayMetadata
fn from(original: ArrayMetadataV3) -> ArrayMetadata
source§impl PartialEq for ArrayMetadataV3
impl PartialEq for ArrayMetadataV3
source§fn eq(&self, other: &ArrayMetadataV3) -> bool
fn eq(&self, other: &ArrayMetadataV3) -> bool
self
and other
values to be equal, and is used
by ==
.