Skip to content

DataType

zarrista.DataType

A Zarr v3 data type.

name property

name: str | None

The Zarr v3 data-type name (e.g. "float64").

size property

size: int | None

The fixed size in bytes, or None for variable-length data types.

from_metadata staticmethod

from_metadata(metadata: ZarrV3NamedConfigJSON) -> DataType

Construct a data type from its Zarr v3 metadata.

Parameters:

Returns:

Raises:

  • PluginCreateError

    If the metadata names an unsupported data type, or if the configuration is not valid for it.

from_string staticmethod

from_string(name: DataTypeName | str) -> DataType

Construct a data type from its Zarr v3 name (e.g. "float32").

Parameters:

Returns:

Raises:

zarrista.FillValue

An array's fill value, stored as native-endian bytes.

size property

size: int

The size of the fill value in bytes.

__init__

__init__(value: bytes) -> None

Construct a fill value from its native-endian bytes.

Parameters:

  • value (bytes) –

    The native-endian bytes of one fill value element.

as_bytes

as_bytes() -> bytes

Return the fill value as native-endian bytes.

Returns:

  • bytes

    The native-endian bytes of one fill value element.

equals_all

equals_all(other: Buffer) -> bool

Return whether other contains only repetitions of this fill value.

Parameters:

  • other (Buffer) –

    The bytes to compare against this fill value.

Returns:

  • bool

    True if other is a whole number of copies of this fill value. False if the bytes differ, or if the length of other is not a multiple of size.

Types

zarrista._dtype.DataTypeName module-attribute

The Zarr v3 names of the data types that from_string can construct.

This alias comes from the per-dtype name literals in zarr_metadata.v3.data_type. Therefore it stays in agreement with the spec, and nobody must maintain the list here.