Deleted annotate_root_dir(filename,annotation_dict: dict), and outsourced functionality to HDF5DataOpsManager.append_metadata() or .update_metadata() at obj_name = '/'

This commit is contained in:
2024-10-01 09:19:14 +02:00
parent 6f5d4adcee
commit 8cd4b7d925

View File

@ -19,6 +19,16 @@ import json
import copy
class HDF5DataOpsManager():
"""
A class to handle HDF5 file operations.
Parameters:
path_to_file : str
path/to/hdf5file.
mode : str
'r' or 'r+' read or read/write mode only when file exists
"""
def __init__(self, file_path, mode = 'r+') -> None:
if mode in ['r','r+']:
@ -549,11 +559,5 @@ def get_groups_at_a_level(file: h5py.File, level: str):
return groups
def annotate_root_dir(filename,annotation_dict: dict):
with h5py.File(filename,'r+') as file:
file.attrs.update(annotation_dict)
#for key in annotation_dict:
# file.attrs.create('metadata_'+key, annotation_dict[key])