abczarr.metadata.v2.dtypes
Classes
DType
A Zarr v2 data type: a numpy dtype string, or a structured field list.
Constructing DType(value) returns a
ScalarDType for a plain
dtype, such as "<f8", or a
StructDType for a
structured one, whichever value describes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
dtype - like
|
A numpy dtype, a dtype string, or a structured field list, to
convert to the matching |
required |
Attributes
Methods:
to_version
Convert this data type to another Zarr version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
int
|
The target Zarr format version: 1, 2 or 3. |
required |
Returns:
| Type | Description |
|---|---|
DType
|
This data type unchanged for version 1 or 2, since v1 and v2 share the same dtype model, or the equivalent v3 data type for version 3. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
ScalarDType
A Zarr v2 scalar data type: a numpy dtype string, for example
"<f8".
A ScalarDType encodes the byte order, kind and item size the way
.zarray's dtype field does.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
A numpy dtype string in Zarr v2's encoding, such as |
required |
StructDType
A Zarr v2 structured data type: an ordered list of
(name, dtype) fields.
A StructDType mirrors numpy's structured dtype list form and is
immutable. Every list-mutation method raises TypeError instead
of changing the value after construction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
iterable of tuple
|
The |
required |