-
Notifications
You must be signed in to change notification settings - Fork 7
fix(io): extending and testing ascii writes #186
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
Conversation
flopy4/mf6/converter.py
Outdated
| if comp is not None | ||
| ] | ||
| elif isinstance(field_value, (list, tuple)): | ||
| elif isinstance(field_value, (list, tuple, xattree.DataTreeList)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be
elif isinstance(field_value, collections.abc.Iterable):as DataTreeList satisfies that. The condition above already uses the fact DataTreeDict implements MutableMapping, I guess? And that could just be Mapping, too, I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, I'll update that
| {% macro scalar(name, value) %} | ||
| {% set format = value|field_format %} | ||
| {% if value is not none %}{{ name.upper() }}{% if format != 'keyword' %} {{ value }}{% endif %}{% endif %} | ||
| {% if value is not none %}{{ inset ~ name.upper() }}{% if format != 'keyword' %} {{ value }}{% endif %}{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't know about the tilde for string concatenation before. TIL.
| else: | ||
| if field_value is not None: | ||
| blocks[block_name][field_name] = field_value | ||
| if isinstance(field_value, bool): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this prevents false keywords from being written
614cc1b to
e9e4377
Compare
Update writes to minimally support running a configuration.