ssapy_toolkit.io.hdf5_utils
Functions
|
Append rows along axis 0. |
|
Merge datasets from multiple HDF5 files into filename without clobbering existing keys. |
|
True if key exists anywhere in the file (supports nested paths like 'a/b/c'). |
|
List full dataset paths in an HDF5 file. |
|
List top-level members. |
|
Overwrite (or create) dataset at key. |
|
Load data from an HDF5 file. |
|
Flatten all datasets into a dict keyed by their full HDF5 paths. |
|
|
|
Create a dataset at key. |
|
Verify an HDF5 file with selectable depth of checking. |
- ssapy_toolkit.io.hdf5_utils.append_h5(filename: str, key: str, append_data) None[source]
Append rows along axis 0. If dataset doesn’t exist, create it. Note: append_data must be broadcastable to the dataset shape except on axis 0.
- ssapy_toolkit.io.hdf5_utils.combine_h5(filename: str, files: list, verbose: bool = False, overwrite: bool = False) None[source]
Merge datasets from multiple HDF5 files into filename without clobbering existing keys.
- ssapy_toolkit.io.hdf5_utils.h5_key_exists(filename: str, key: str) bool[source]
True if key exists anywhere in the file (supports nested paths like ‘a/b/c’).
- ssapy_toolkit.io.hdf5_utils.h5_keys(file_path: str) list[source]
List full dataset paths in an HDF5 file.
- ssapy_toolkit.io.hdf5_utils.overwrite_h5(filename: str, key: str, new_data) None[source]
Overwrite (or create) dataset at key.
- ssapy_toolkit.io.hdf5_utils.read_h5(filename: str, key: str)[source]
Load data from an HDF5 file. Returns np.ndarray (or scalar) or None if missing.
- ssapy_toolkit.io.hdf5_utils.read_h5_all(file_path: str) dict[source]
Flatten all datasets into a dict keyed by their full HDF5 paths.
- ssapy_toolkit.io.hdf5_utils.save_h5(filename: str, key: str, data) None[source]
Create a dataset at key. Creates parent groups if needed. Fails if dataset exists.
- ssapy_toolkit.io.hdf5_utils.verify_h5_file(filename: str, mode: str = 'structure', verbose: bool = False) bool[source]
Verify an HDF5 file with selectable depth of checking.
Modes
- open
Only verify the file exists and can be opened. Fastest, but weakest check.
- structure
Verify the file opens and every object in the hierarchy can be accessed. Fast and usually sufficient for structural sanity checking.
- full
Verify the file opens and every dataset can be fully read. Slowest, but strongest check.
- param filename:
Path to the HDF5 file.
- type filename:
str
- param mode:
One of {“open”, “structure”, “full”}.
- type mode:
str
- param verbose:
If True, print any errors encountered.
- type verbose:
bool
- returns:
True if the file passes the selected verification mode, otherwise False.
- rtype:
bool