tophu.HDF5Dataset

class tophu.HDF5Dataset(filepath, datapath, shape=None, dtype=None, **kwargs)

A Dataset in an HDF5 file.

Notes

This class does not store an open file object. Instead, the file is opened on-demand for reading or writing and closed immediately after each read/write operation. This allows multiple spawned processes to write to the file in coordination (as long as a suitable mutex is used to guard file access.)

Attributes
ndim

int : Number of array dimensions.

Methods

HDF5Dataset.__init__(filepath, datapath[, ...])

HDF5Dataset.__getitem__(key, /)

Read a block of data.

Attributes

HDF5Dataset.ndim

Number of array dimensions.

HDF5Dataset.filepath

The file path.

HDF5Dataset.datapath

The path to the dataset within the file.

HDF5Dataset.chunks

Tuple giving the chunk shape, or None if chunked storage is not used.

HDF5Dataset.shape

Tuple of array dimensions.

HDF5Dataset.dtype

Data-type of the array's elements.