pyiron_base.storage.helper_functions module
- pyiron_base.storage.helper_functions.get_h5_path(h5_path, name)
Combine the current h5_path with the relative path
- Parameters:
h5_path (str) – absolute path of the node in the hdf5 file
name (str) – relative path to be added to the absolute path
- Returns:
combined path
- Return type:
str
- pyiron_base.storage.helper_functions.list_groups_and_nodes(hdf, h5_path)
Get the list of groups and list of nodes from an open HDF5 file
- Parameters:
hdf (h5py.File) – file handle of an open HDF5 file
h5_path (str) – path inside the HDF5 file
- Returns:
list of groups and list of nodes
- Return type:
list, list
- pyiron_base.storage.helper_functions.read_dict_from_hdf(file_name, h5_path, recursive=False, group_paths=[], slash='ignore')
Read data from HDF5 file into a dictionary - by default only the nodes are converted to dictionaries, additional sub groups can be specified using the group_paths parameter. :param file_name: Name of the file on disk :type file_name: str :param h5_path: Path to a group in the HDF5 file from where the data is read :type h5_path: str :param recursive: Load all subgroups recursively :type recursive: bool :param group_paths: list of additional groups to be included in the dictionary, for example:
[“input”, “output”, “output/generic”] These groups are defined relative to the h5_path.
- Parameters:
slash (str) – ‘ignore’ | ‘replace’ Whether to replace the string {FWDSLASH} with the value /. This does not apply to the top level name (title). If ‘ignore’, nothing will be replaced.
- Returns:
The loaded data. Can be of any type supported by
write_hdf5
.- Return type:
dict