yaw.core.abc.HDFSerializable#

class yaw.core.abc.HDFSerializable[source]#

Bases: ABC

Base class for an object that can be serialised into a HDF5 file.

Methods

__init__()

from_file(path)

Create a class instance by deserialising data from a HDF5 file.

from_hdf(source)

Create a class instance by deserialising data from a HDF5 group.

to_file(path)

Serialise the class instance to a new HDF5 file.

to_hdf(dest)

Serialise the class instance into an existing HDF5 group.

classmethod from_file(path: TypePathStr) _Thdf[source]#

Create a class instance by deserialising data from a HDF5 file.

Parameters:

path (pathlib.Path, str) – Group in an opened HDF5 file that contains the necessary data.

Returns:

HDFSerializable

abstract classmethod from_hdf(source: Group) _Thdf[source]#

Create a class instance by deserialising data from a HDF5 group.

Parameters:

source (h5py.Group) – Group in an opened HDF5 file that contains the serialised data.

Returns:

HDFSerializablep

to_file(path: TypePathStr) None[source]#

Serialise the class instance to a new HDF5 file.

Parameters:

path (pathlib.Path, str) – Path at which the HDF5 file is created.

abstract to_hdf(dest: Group) None[source]#

Serialise the class instance into an existing HDF5 group.

Parameters:

dest (h5py.Group) – Group in which the serialised data structures are created.