Skip to content

Commit

Permalink
Fix serialisation of Namelist objects by converting to dict type
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanheerdegen committed Jul 5, 2023
1 parent 1a11d71 commit 447a6dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion run_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import warnings
warnings.simplefilter('ignore', np.RankWarning)

yaml.add_representer(OrderedDict, lambda dumper, data: dumper.represent_mapping('tag:yaml.org,2002:map', data.items()))


def num(s):
"""
Expand Down Expand Up @@ -458,7 +460,7 @@ def parse_nml(paths):
for fname in fnames:
if os.path.isfile(fname): # no accessom2.nml for non-YATM run
parsed_items[fname.split(path)[1].strip('/')] \
= f90nml.read(fname)
= f90nml.read(fname).todict()
return parsed_items


Expand Down

0 comments on commit 447a6dc

Please sign in to comment.