Skip to content

HDF5Dataset

async_hdf5.HDF5Dataset

An HDF5 dataset — a typed, shaped, optionally chunked array.

chunk_shape property

chunk_shape: tuple[int, ...] | None

The chunk shape, or None for contiguous/compact datasets.

dtype property

dtype: str

A debug representation of the HDF5 datatype.

element_size property

element_size: int

The size of a single element in bytes.

fill_value property

fill_value: list[int] | None

Raw fill value as a list of byte values, or None if not set.

filters property

filters: list[dict[str, Any]]

The HDF5 filter pipeline.

Each filter is a dict with keys "id" (int), "name" (str), and "client_data" (list of int).

name property

name: str

The dataset name.

ndim property

ndim: int

The number of dimensions.

numpy_dtype property

numpy_dtype: str

Numpy-compatible dtype string (e.g. "<f4", ">i8", "<c16").

Raises:

  • ValueError

    For datatypes that cannot be represented as a fixed numpy dtype (variable-length strings, references).

shape property

shape: tuple[int, ...]

The shape of the dataset in array elements.

attributes async

attributes() -> dict[str, Any]

Read all attributes on this dataset.

Returns:

  • dict[str, Any]

    A dict mapping attribute names to decoded Python values.

batch_fetch_ranges async

batch_fetch_ranges(ranges: list[tuple[int, int]]) -> list[bytes]

Fetch multiple byte ranges in a single batched I/O call.

No chunk index lookup is performed — the caller must supply pre-resolved byte ranges.

Parameters:

Returns:

  • list[bytes]

    A list of raw bytes in the same order as the input.

batch_get_chunks async

batch_get_chunks(chunk_indices: list[list[int]]) -> list[bytes | None]

Fetch multiple chunks in a single batched I/O call.

Parameters:

  • chunk_indices (list[list[int]]) –

    A list of chunk grid coordinate lists.

Returns:

  • list[bytes | None]

    A list of raw chunk bytes (or None for missing chunks),

  • list[bytes | None]

    in the same order as the input.

chunk_index async

chunk_index() -> ChunkIndex

Build and return the chunk index for this dataset.

The chunk index maps chunk grid coordinates to byte ranges in the file. For chunked datasets this parses the B-tree, fixed array, or extensible array on first call.

Returns: