modelrunner.storage.backend package
- 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
orStore
) – File path to the file/folder or azarr
Storemode (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
- mode: AccessMode
access mode
- Type:
- class JSONStorage(path, *, mode='read', simplify=True, **kwargs)[source]
Bases:
TextStorageBase
storage 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:
StorageBase
store 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:
TextStorageBase
storage 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:
StorageBase
storage that stores data in an zarr file or database
- Parameters:
store_or_path (str or
Path
orStore
) – File path to the file/folder or azarr
Storemode (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
- mode: AccessMode
access mode
- Type: