NekUpload.validate.hdf5_definitions module

class NekUpload.validate.hdf5_definitions.HDF5DatasetDefinition(path: str, dataset_shape: tuple[int, ...] = ())[source]

Bases: HDF5Definition

Given an HDF5 file, responsible for checking if dataset conforms to schema expectations, such as shape constraints. All exceptions raised from this class are of type HDF5SchemaException or its children.

dataset_shape: tuple[int, ...] = ()
get_path()[source]
path: str
validate(f: File) bool[source]

Checks whether the defined HDF5 dataset is present and well-defined in the specified HDF5 file

Parameters:

f (h5py.File) – _description_

Raises:
Returns:

_description_

Return type:

bool

class NekUpload.validate.hdf5_definitions.HDF5Definition[source]

Bases: ABC

abstractmethod validate(h5py_file: File)[source]
class NekUpload.validate.hdf5_definitions.HDF5GroupDefinition(path: str, attributes: list[str] = <factory>)[source]

Bases: HDF5Definition

Given an HDF5 file, responsible for checking group conforms to correct structure and contains the specified attributes. This is not an exclusive check, other non-specified attributes can also be present. All exceptions raised from this class are of type HDF5SchemaException or its children.

attributes: list[str]
get_path()[source]
path: str
validate(f: File) bool[source]

Checks whether the defined HDF5 group is present and well-defined in the specified HDF5 file

Parameters:

f (h5py.File) – HDF5 file

Raises:
Returns:

_description_

Return type:

bool