torchsig.utils.file_handlers.hdf5.HDF5Reader

class torchsig.utils.file_handlers.hdf5.HDF5Reader(root)[source]

Bases: FileReader

Handles reading Signal data from HDF5 files.

Methods

read

Reads a single sample and its corresponding targets from the HDF5 file.

teardown

Closes the HDF5 file handle.

__init__(root) None[source]

Initializes the HDF5Reader.

Parameters:

root (str) – The root directory containing the HDF5 file.

read(idx: int) Signal[source]

Reads a single sample and its corresponding targets from the HDF5 file.

Parameters:

idx (int) – The index of the sample to read.

Returns:

The sample as a Signal object.

Return type:

Signal

teardown() None[source]

Closes the HDF5 file handle.

__repr__() str

Return repr(self).

__str__() str

Return str(self).