Skip to content

DecodedArray

Reading from an Array (via retrieve_array_subset, retrieve_chunk, or [...]) returns a DecodedArray: one of four concrete result types, chosen by the decoded byte layout of the dtype. Use isinstance to narrow to a concrete type before calling its layout-specific methods.

zarrista.DecodedArray module-attribute

The result of a read: one of the four decoded array layouts.

Which one is returned depends on the dtype's byte layout (fixed vs. variable, and whether it carries a validity mask). Use isinstance to narrow to a concrete type before using layout-specific methods.

Tensor

zarrista.Tensor

Fixed-width, dense decoded array data.

The decoded bytes are held zero-copy. Reinterpret them as a NumPy array with to_numpy(), or get the raw bytes as a buffer-protocol object via buffer().

dtype property

dtype: DataType

The Zarr data type.

shape property

shape: list[int]

The shape of the decoded region.

__dlpack__

__dlpack__(
    *,
    stream: int | None = None,
    max_version: tuple[int, int] | None = None,
    dl_device: tuple[int, int] | None = None,
    copy: bool | None = None
) -> CapsuleType

Export the data as a DLPack capsule (e.g. for np.from_dlpack).

__dlpack_device__

__dlpack_device__() -> tuple[int, int]

Return the DLPack device (device_type, device_id). Always CPU.

buffer

buffer() -> Buffer

Return the raw decoded bytes as a zero-copy buffer-protocol object.

to_numpy

to_numpy() -> NDArray[Any]

Access a NumPy array view over Rust memory.

This is a zero-copy view via np.frombuffer.

VariableArray

zarrista.VariableArray

Variable-length decoded data (e.g. strings or bytes).

Exposes the Arrow PyCapsule interface for zero-copy data exchange for variable length string or bytes data.

dtype property

dtype: DataType

The Zarr data type.

shape property

shape: list[int]

The shape of the decoded region.

__arrow_c_array__

__arrow_c_array__(
    requested_schema: object | None = None,
) -> tuple[CapsuleType, CapsuleType]

Export as an Arrow array: a (schema_capsule, array_capsule) pair.

__arrow_c_schema__

__arrow_c_schema__() -> CapsuleType

Export the Arrow schema as a PyCapsule (Arrow C Data Interface).

MaskedTensor

zarrista.MaskedTensor

Fixed-width decoded data with a validity mask.

Not yet exposed to NumPy.

dtype property

dtype: DataType

The Zarr data type.

shape property

shape: list[int]

The shape of the decoded region.

MaskedVariableArray

zarrista.MaskedVariableArray

Variable-length decoded data with a validity mask.

Not yet exposed to NumPy.

dtype property

dtype: DataType

The Zarr data type.

shape property

shape: list[int]

The shape of the decoded region.