mirror of
https://gitea.psi.ch/APOG/acsm-fairifier.git
synced 2025-07-14 03:11:48 +02:00
Moved get_metadata() from pipelines/steps/prepare_ebas_submission.py to utils.py
This commit is contained in:
@ -30,4 +30,21 @@ def record_data_lineage(path_to_output_file, projectPath, metadata):
|
||||
|
||||
print(f"Metadata for calibrated data saved to {path_to_metadata_file}")
|
||||
|
||||
return 0
|
||||
return 0
|
||||
|
||||
def get_metadata(path_to_file):
|
||||
|
||||
path, filename = os.path.split(path_to_file)
|
||||
|
||||
path_to_metadata = None
|
||||
for item in os.listdir(path):
|
||||
if 'metadata.json' in item:
|
||||
path_to_metadata = os.path.normpath(os.path.join(path,item))
|
||||
metadata = {}
|
||||
if path_to_file:
|
||||
with open(path_to_metadata,'r') as stream:
|
||||
metadata = json.load(stream)
|
||||
|
||||
metadata = metadata.get(filename,{})
|
||||
|
||||
return metadata
|
Reference in New Issue
Block a user