abczarr.metadata.v3.dtypes
Classes
DTypeConfig
DTypeConfig(*, extra_items: Iterable[tuple[str | bytes, Any]] | Mapping[str | bytes, Any] = FrozenDict({}))
Bases: TypedConfig
This class is the base for a v3 data type's own configuration parameters.
Methods:
DType
DType(name: str | bytes = '', configuration: DTypeConfig | JsonDict = DTypeConfig(extra_items=FrozenDict({})), must_understand: Literal[True] = True)
Bases: MustUnderstandExtension
A Zarr v3 data type: a name and that type's own configuration.
A core data type, such as float32, has no configuration and
is written as a bare name. An extension data type, such as a
struct or a fixed-bit-width raw type, carries its parameters in
configuration.
Attributes
configuration
instance-attribute
configuration: DTypeConfig
The data type's own parameters. Empty for a core data type.
Methods:
to_json
Serialize this data type to its JSON representation.
A core data type with no configuration is written as a bare
name, such as "float32", as the Zarr v3 specification
requires. An extension data type keeps the full object form.
Returns:
| Type | Description |
|---|---|
str or dict
|
The bare name for a core data type, or the JSON-compatible object form for an extension data type. |
to_version
to_version(version: ZarrVersion) -> Any
Convert this data type to another Zarr version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
ZarrVersion
|
The target Zarr format version: 1, 2 or 3. |
required |
Returns:
| Type | Description |
|---|---|
object
|
This data type unchanged for version 3, or the equivalent v1 or v2 data type otherwise. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
DTypeBuiltin
DTypeBuiltin(name: str | bytes = '', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeImpl
This class is the base for a core Zarr v3 data type, one every implementation must support.
Methods:
Raw
Raw(name: str | bytes = 'r8', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
An opaque sequence of bits, with a fixed number of bits per element.
DTypeExtra
DTypeExtra(name: str | bytes = '', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeImpl
This class is the base for a Zarr v3 extension data type, one registered outside the core spec.
Methods:
StructField
StructConfig
StructConfig(fields: Iterable[StructField | JsonDict | str] = ())
Bases: DTypeConfigImpl
Holds the struct data type's parameters: the ordered list of fields.
Attributes
Methods:
Struct
Struct(name: Literal['struct', 'structured'] = 'struct', configuration: StructConfig | JsonDict | tuple[StructField, ...] = StructConfig(fields=()), must_understand: Literal[True] = True)
Bases: DTypeExtra
Represents a structured data type: a fixed, ordered sequence of named fields.
Each element is a record combining every field's value, mirroring numpy's structured dtype.
Attributes
Methods:
NumpyTimeConfig
NumpyTimeConfig(unit: Literal['Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'μs', 'ns', 'ps', 'fs', 'as', 'generic'] = 'Y', scale_factor: Integral | integer | bool = 0)
Bases: DTypeConfigImpl
Holds the datetime/timedelta parameters: the time unit and its scale factor.
A value counts scale_factor multiples of unit. A
scale_factor of 10 with unit "s" counts in tens of
seconds, matching numpy's datetime64/timedelta64 resolution.
NumpyDatetime64
NumpyDatetime64(name: Literal['numpy.datetime64'] = 'numpy.datetime64', configuration: NumpyTimeConfig | JsonDict | Literal['Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'μs', 'ns', 'ps', 'fs', 'as', 'generic'] = NumpyTimeConfig(unit='Y', scale_factor=0), must_understand: Literal[True] = True)
Bases: DTypeExtra
Represents a point in time, at the resolution configuration
names.
Mirrors numpy's datetime64: an integer count of the configured
time unit since the Unix epoch.
Attributes
Methods:
NumpyTimedelta64
NumpyTimedelta64(name: Literal['numpy.timedelta64'] = 'numpy.timedelta64', configuration: NumpyTimeConfig | JsonDict | Literal['Y', 'M', 'W', 'D', 'h', 'm', 's', 'ms', 'us', 'μs', 'ns', 'ps', 'fs', 'as', 'generic'] = NumpyTimeConfig(unit='Y', scale_factor=0), must_understand: Literal[True] = True)
Bases: DTypeExtra
Represents a duration, at the resolution configuration names.
Mirrors numpy's timedelta64: an integer count of the configured
time unit.
Attributes
Methods:
FixedLengthConfig
FixedLengthConfig(length_bytes: Integral | integer | bool = 0)
Bases: DTypeConfigImpl
Holds the fixed-length data type's parameters: the element's size in bytes.
Attributes
Methods:
FixedLengthUtf32
FixedLengthUtf32(name: Literal['fixed_length_utf32'] = 'fixed_length_utf32', configuration: FixedLengthConfig | JsonDict | int = FixedLengthConfig(length_bytes=0), must_understand: Literal[True] = True)
Bases: DTypeExtra
Represents a fixed-length UTF-32 string, mirroring numpy's
<U{n} dtype.
configuration.length_bytes is four times the character count.
Attributes
Methods:
NullTerminatedBytes
NullTerminatedBytes(name: Literal['null_terminated_bytes'] = 'null_terminated_bytes', configuration: FixedLengthConfig | JsonDict | int = FixedLengthConfig(length_bytes=0), must_understand: Literal[True] = True)
Bases: DTypeExtra
Represents a fixed-length byte string, mirroring numpy's
S{n} dtype.
Attributes
Methods:
Bool
Bool(name: Literal['bool'] = 'bool', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The bool data type.
Int8
Int8(name: Literal['int8'] = 'int8', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The int8 data type.
Int16
Int16(name: Literal['int16'] = 'int16', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The int16 data type.
Int32
Int32(name: Literal['int32'] = 'int32', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The int32 data type.
Int64
Int64(name: Literal['int64'] = 'int64', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The int64 data type.
Uint8
Uint8(name: Literal['uint8'] = 'uint8', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The uint8 data type.
Uint16
Uint16(name: Literal['uint16'] = 'uint16', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The uint16 data type.
Uint32
Uint32(name: Literal['uint32'] = 'uint32', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The uint32 data type.
Uint64
Uint64(name: Literal['uint64'] = 'uint64', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The uint64 data type.
Float16
Float16(name: Literal['float16'] = 'float16', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The float16 data type.
Float32
Float32(name: Literal['float32'] = 'float32', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The float32 data type.
Float64
Float64(name: Literal['float64'] = 'float64', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The float64 data type.
Complex64
Complex64(name: Literal['complex64'] = 'complex64', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The complex64 data type.
Complex128
Complex128(name: Literal['complex128'] = 'complex128', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeBuiltin
The complex128 data type.
Bytes
Bytes(name: Literal['bytes'] = 'bytes', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The bytes data type.
Bfloat16
Bfloat16(name: Literal['bfloat16'] = 'bfloat16', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The bfloat16 data type.
Float4E2m1fn
Float4E2m1fn(name: Literal['float4_e2m1fn'] = 'float4_e2m1fn', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float4_e2m1fn data type.
Float6E2m3fn
Float6E2m3fn(name: Literal['float6_e2m3fn'] = 'float6_e2m3fn', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float6_e2m3fn data type.
Float6E3m2fn
Float6E3m2fn(name: Literal['float6_e3m2fn'] = 'float6_e3m2fn', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float6_e3m2fn data type.
Float8E3m4
Float8E3m4(name: Literal['float8_e3m4'] = 'float8_e3m4', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e3m4 data type.
Float8E4m3
Float8E4m3(name: Literal['float8_e4m3'] = 'float8_e4m3', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e4m3 data type.
Float8E4m3b11fnuz
Float8E4m3b11fnuz(name: Literal['float8_e4m3b11fnuz'] = 'float8_e4m3b11fnuz', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e4m3b11fnuz data type.
Float8E4m3fnuz
Float8E4m3fnuz(name: Literal['float8_e4m3fnuz'] = 'float8_e4m3fnuz', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e4m3fnuz data type.
Float8E5m2
Float8E5m2(name: Literal['float8_e5m2'] = 'float8_e5m2', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e5m2 data type.
Float8E5m2fnuz
Float8E5m2fnuz(name: Literal['float8_e5m2fnuz'] = 'float8_e5m2fnuz', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e5m2fnuz data type.
Float8E8m0fnu
Float8E8m0fnu(name: Literal['float8_e8m0fnu'] = 'float8_e8m0fnu', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The float8_e8m0fnu data type.
ComplexBfloat16
ComplexBfloat16(name: Literal['complex_bfloat16'] = 'complex_bfloat16', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_bfloat16 data type.
ComplexFloat16
ComplexFloat16(name: Literal['complex_float16'] = 'complex_float16', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float16 data type.
ComplexFloat32
ComplexFloat32(name: Literal['complex_float32'] = 'complex_float32', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float32 data type.
ComplexFloat64
ComplexFloat64(name: Literal['complex_float64'] = 'complex_float64', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float64 data type.
ComplexFloat4E2m1fn
ComplexFloat4E2m1fn(name: Literal['complex_float4_e2m1fn'] = 'complex_float4_e2m1fn', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float4_e2m1fn data type.
ComplexFloat6E2m3fn
ComplexFloat6E2m3fn(name: Literal['complex_float6_e2m3fn'] = 'complex_float6_e2m3fn', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float6_e2m3fn data type.
ComplexFloat6E3m2fn
ComplexFloat6E3m2fn(name: Literal['complex_float6_e3m2fn'] = 'complex_float6_e3m2fn', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float6_e3m2fn data type.
ComplexFloat8E3m4
ComplexFloat8E3m4(name: Literal['complex_float8_e3m4'] = 'complex_float8_e3m4', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e3m4 data type.
ComplexFloat8E4m3
ComplexFloat8E4m3(name: Literal['complex_float8_e4m3'] = 'complex_float8_e4m3', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e4m3 data type.
ComplexFloat8E4m3b11fnuz
ComplexFloat8E4m3b11fnuz(name: Literal['complex_float8_e4m3b11fnuz'] = 'complex_float8_e4m3b11fnuz', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e4m3b11fnuz data type.
ComplexFloat8E4m3fnuz
ComplexFloat8E4m3fnuz(name: Literal['complex_float8_e4m3fnuz'] = 'complex_float8_e4m3fnuz', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e4m3fnuz data type.
ComplexFloat8E5m2
ComplexFloat8E5m2(name: Literal['complex_float8_e5m2'] = 'complex_float8_e5m2', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e5m2 data type.
ComplexFloat8E5m2fnuz
ComplexFloat8E5m2fnuz(name: Literal['complex_float8_e5m2fnuz'] = 'complex_float8_e5m2fnuz', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e5m2fnuz data type.
ComplexFloat8E8m0fnu
ComplexFloat8E8m0fnu(name: Literal['complex_float8_e8m0fnu'] = 'complex_float8_e8m0fnu', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The complex_float8_e8m0fnu data type.
String
String(name: Literal['string'] = 'string', configuration: DTypeConfigImpl | JsonDict = DTypeConfigImpl(), must_understand: Literal[True] = True)
Bases: DTypeExtra
The string data type.