Made edits to documentation

This commit is contained in:
2024-07-11 13:42:38 +02:00
parent f04f5eaaf9
commit 2ebe5f3220
2 changed files with 50 additions and 36 deletions

View File

@ -20,13 +20,13 @@ def read_xps_ibw_file_as_dict(filename):
and formats the data into a dictionary with the structure {datasets: list of datasets}. Each dataset in the
list has the following structure:
{
'name': 'name',
'data': data_array,
'data_units': 'units',
'shape': data_shape,
'dtype': data_type
}
{
'name': 'name',
'data': data_array,
'data_units': 'units',
'shape': data_shape,
'dtype': data_type
}
Parameters
----------
@ -42,6 +42,7 @@ def read_xps_ibw_file_as_dict(filename):
------
ValueError
If the input IBW file is not a valid IBW file.
"""

View File

@ -220,27 +220,33 @@ def transfer_file_dict_to_hdf5(h5file, group_name, file_dict):
"""
Transfers data from a file_dict to an HDF5 file.
Parameters:
h5file (h5py.File): HDF5 file object where the data will be written.
group_name (str): Name of the HDF5 group where data will be stored.
file_dict (dict): Dictionary containing file data to be transferred.
Required structure:
Parameters
----------
h5file : h5py.File
HDF5 file object where the data will be written.
group_name : str
Name of the HDF5 group where data will be stored.
file_dict : dict
Dictionary containing file data to be transferred. Required structure:
{
'name': str,
'attributes_dict': dict,
'datasets': [
{
'name': str,
'attributes_dict': dict,
'datasets': [
{
'name': str,
'data': array-like,
'shape': tuple,
'attributes': dict (optional)
},
...
]
}
'data': array-like,
'shape': tuple,
'attributes': dict (optional)
},
...
]
}
Returns
-------
None
"""
if not file_dict:
return
@ -273,7 +279,6 @@ def create_hdf5_file_from_filesystem_path(output_filename : str,
root_metadata_dict : dict = {}):
"""
Creates an .h5 file with name "output_filename" that preserves the directory tree (or folder structure)
of a given filesystem path.
@ -281,20 +286,28 @@ def create_hdf5_file_from_filesystem_path(output_filename : str,
admissible file formats. These, however, can be extended. Directories are groups in the resulting HDF5 file.
Files are formatted as composite objects consisting of a group, file, and attributes.
Parameters:
output_filename (str): Name of the output HDF5 file.
input_file_system_path (str): Path to root directory, specified with forward slashes, e.g., path/to/root.
select_dir_keywords (list): List of string elements to consider or select only directory paths that contain
Parameters
----------
output_filename : str
Name of the output HDF5 file.
input_file_system_path : str
Path to root directory, specified with forward slashes, e.g., path/to/root.
select_dir_keywords : list
List of string elements to consider or select only directory paths that contain
a word in 'select_dir_keywords'. When empty, all directory paths are considered
to be included in the HDF5 file group hierarchy.
select_file_keywords (list): List of string elements to consider or select only files that contain a word in
select_file_keywords : list
List of string elements to consider or select only files that contain a word in
'select_file_keywords'. When empty, all files are considered to be stored in the HDF5 file.
top_sub_dir_mask (bool): Mask for top-level subdirectories.
root_metadata_dict (dict): Metadata to include at the root level of the HDF5 file.
Returns:
str: Path to the created HDF5 file.
top_sub_dir_mask : bool
Mask for top-level subdirectories.
root_metadata_dict : dict
Metadata to include at the root level of the HDF5 file.
Returns
-------
output_filename : str
Path to the created HDF5 file.
"""
allowed_file_extensions = list(ext_to_reader_dict.keys()) # list(config_file.select_file_readers(group_id).keys())