read_h5_all

ssapy.io.read_h5_all(file_path)[source][source]

Read all datasets from an HDF5 file into a dictionary.

This function recursively traverses an HDF5 file and extracts all datasets into a dictionary. The keys of the dictionary are the paths to the datasets, and the values are the dataset contents.

Parameters:

file_pathstr

The path to the HDF5 file from which datasets will be read.

Returns:

dict

A dictionary where keys are the paths to datasets within the HDF5 file, and values are the contents of these datasets.

Examples:

>>> data = read_h5_all('example.h5')
>>> print(data.keys())
dict_keys(['/group1/dataset1', '/group2/dataset2'])
>>> print(data['/group1/dataset1'])
[1, 2, 3, 4, 5]