modelrunner.storage.backend.hdf module

Defines a class storing data on the file system using the hierarchical data format (hdf)

Requires the optional h5py module.

class HDFStorage(file_or_path, *, mode='read', compression=True)[source]

Bases: StorageBase

storage that stores data in an HDF file

Parameters:
  • file_or_path (str or Path or Store) – File path to the file/folder or a zarr Store

  • mode (str or AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.

  • compression (bool) – Whether to store the data in compressed form. Automatically enabled chunked storage.

close()[source]

closes the storage, potentially writing data to a persistent place

Return type:

None

extensions: list[str] = ['h5', 'hdf', 'hdf5']

all file extensions supported by this storage

Type:

list of str

is_group(loc)[source]

determine whether the location is a group

Parameters:

loc (sequence of str) – A list of strings determining the location in the storage

Returns:

True if the loation is a group

Return type:

bool

keys(loc=None)[source]

return all sub-items defined at a given location

Parameters:

loc (sequence of str) – A list of strings determining the location in the storage

Returns:

a list of all items defined at this location

Return type:

list

mode: AccessMode

access mode

Type:

AccessMode