modelrunner.storage.backend package
- class HDFStorage(file_or_path, *, mode='read', compression=True)[source]
Bases:
StorageBaseStorage that stores data in an HDF file.
- Parameters:
file_or_path (str or
PathorStore) – File path to the file/folder or azarrStoremode (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
- class JSONStorage(path, *, mode='read', simplify=True, **kwargs)[source]
Bases:
TextStorageBaseStorage that stores data in a JSON text file.
Note that the data is only written once the storage is closed.
- Parameters:
path (str or
Path) – File path to the filemode (str or
AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.simplify (bool) – Flag indicating whether the data is stored in a simplified form
- class MemoryStorage(*, mode='insert')[source]
Bases:
StorageBaseStore items in memory.
- Parameters:
mode (str or
AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.
- clear()[source]
Truncate the storage by removing all stored data.
- Parameters:
clear_data_shape (bool) – Flag determining whether the data shape is also deleted.
- Return type:
None
- class YAMLStorage(path, *, mode='read', simplify=True, **kwargs)[source]
Bases:
TextStorageBaseStorage that stores data in a YAML text file.
Note that the data is only written once the storage is closed.
- Parameters:
path (str or
Path) – File path to the filemode (str or
AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.simplify (bool) – Flag indicating whether the data is stored in a simplified form
- encode_internal_attrs = True
- class ZarrStorage(store_or_path, *, mode='read')[source]
Bases:
StorageBaseStorage that stores data in an zarr file or database.
- Parameters:
store_or_path (str or
PathorStore) – File path to the file/folder or azarrStoremode (str or
AccessMode) – The file mode with which the storage is accessed. Determines allowed operations.
- close()[source]
Closes the storage, potentially writing data to a persistent place.
- Return type:
None
- extensions: list[str] = ['zarr', 'zip', 'sqldb', 'lmdb']
all file extensions supported by this storage