Skip to content

Commit

Permalink
Merge pull request #25 from aidanheerdegen/issue-24
Browse files Browse the repository at this point in the history
Fix serialisation of Namelist objects by converting to dict type
  • Loading branch information
aekiss authored Jul 5, 2023
2 parents 1a11d71 + 447a6dc commit c8801e7
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 c8801e7

Please sign in to comment.