Added code to parse dict attributes.
This commit is contained in:
@ -481,7 +481,7 @@ import os
|
|||||||
#import src.hdf5_lib as h5lib
|
#import src.hdf5_lib as h5lib
|
||||||
import src.g5505_utils as utils
|
import src.g5505_utils as utils
|
||||||
import h5py
|
import h5py
|
||||||
|
import src.metadata_review_lib as metadata_lib
|
||||||
def save_processed_dataframe_to_hdf5(df, annotator, src_hdf5_path, script_date, script_name):
|
def save_processed_dataframe_to_hdf5(df, annotator, src_hdf5_path, script_date, script_name):
|
||||||
"""
|
"""
|
||||||
Save processed dataframe columns with annotations to an HDF5 file.
|
Save processed dataframe columns with annotations to an HDF5 file.
|
||||||
@ -516,6 +516,10 @@ def save_processed_dataframe_to_hdf5(df, annotator, src_hdf5_path, script_date,
|
|||||||
# Prepare data level attributes
|
# Prepare data level attributes
|
||||||
data_level_attributes = metadata_dict['metadata']['datasets']
|
data_level_attributes = metadata_dict['metadata']['datasets']
|
||||||
|
|
||||||
|
for key, value in data_level_attributes.items():
|
||||||
|
if isinstance(value,dict):
|
||||||
|
data_level_attributes[key] = metadata_lib.parse_attribute(value)
|
||||||
|
|
||||||
# Generate output filename
|
# Generate output filename
|
||||||
parent_file_name = os.path.split(src_hdf5_path)[1]
|
parent_file_name = os.path.split(src_hdf5_path)[1]
|
||||||
output_filename = f'data_products/processed/fig_{script_date}_{parent_file_name}'
|
output_filename = f'data_products/processed/fig_{script_date}_{parent_file_name}'
|
||||||
|
Reference in New Issue
Block a user