Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing comma of a patched namelist. #112

Closed
marshallward opened this issue Mar 27, 2020 · 1 comment
Closed

Trailing comma of a patched namelist. #112

marshallward opened this issue Mar 27, 2020 · 1 comment

Comments

@marshallward
Copy link
Owner

When a key-value pair of a namelist group is patched, the comma is removed rather than preserving any existing commas.

Namelist a.nml:

&test_nml
    x = 1,
    y = 2,
    z = 3,
/

Runscript:

import f90nml

nml = f90nml.read('a.nml')
patch = {'test_nml': {'y': 2}}
f90nml.patch('a.nml', patch, 'b.nml')

Output:

&test_nml
    x = 1,
    y = 2
    z = 3,
/

This was previously reported in #111

@marshallward
Copy link
Owner Author

marshallward commented Apr 10, 2020

I just noticed this is an older issue (#105) that has already been reported, so will close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant