Skip to content

Commit 4400f4b

Browse files
deepakmarooolivhoenen
authored andcommitted
Changed hardcoded dd_version with dd_zip.latest_dd_version
1 parent c6d7d76 commit 4400f4b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/simdb/imas/metadata.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def load_imas_metadata(ids_dist, entry) -> dict:
117117
for ids_name, v in ids_dist.items():
118118
ids = entry.get(ids_name, autoconvert=False)
119119
# Explicitly convert the IDS to the target version
120-
ids = imas.convert_ids(ids, "4.1.0")
120+
latest_dd_version = imas.dd_zip.latest_dd_version()
121+
if latest_dd_version is None:
122+
raise ValueError("Could not determine the latest DD version.")
123+
ids = imas.convert_ids(ids, latest_dd_version)
121124
for node in imas.util.tree_iter(ids):
122125
metadata[extract_ids_path(str(node.coordinates)).replace("/",".")] = node.value
123126
return metadata

0 commit comments

Comments
 (0)