Skip to content

Commit

Permalink
metadata: fix unbound local
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarrison committed Nov 15, 2023
1 parent 814d727 commit 3dc622b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions abacusnbody/metadata/abacussummit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_meta(simname, redshift=None):
if 'CLASS_power_spectrum' in af_tree[sim]:
metadata[sim]['CLASS_power_spectrum'] = af_tree[sim]['CLASS_power_spectrum']
if simname not in metadata:
raise ValueError(f'Simulation "{simname}" is not in metadata file "{metadata_fn}"')
raise ValueError(f'Simulation "{simname}" is not in metadata files "{metadata_fns}"')


res = dict(metadata[simname]['param'])
Expand All @@ -58,7 +58,7 @@ def get_meta(simname, redshift=None):
if not redshift.startswith('z'):
redshift = 'z' + redshift
if redshift not in metadata[simname]['state']:
raise ValueError(f'Redshift {redshift} metadata not present for "{simname}" in metadata file "{metadata_fn}')
raise ValueError(f'Redshift {redshift} metadata not present for "{simname}" in metadata files "{metadata_fns}')
res.update(metadata[simname]['state'][redshift])

return res

0 comments on commit 3dc622b

Please sign in to comment.