-
Notifications
You must be signed in to change notification settings - Fork 352
feat(arrays): add model.free_format_npl to control values-per-line in free-format array output #2696
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
feat(arrays): add model.free_format_npl to control values-per-line in free-format array output #2696
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2696 +/- ##
===========================================
+ Coverage 55.5% 72.3% +16.8%
===========================================
Files 644 667 +23
Lines 124135 130408 +6273
===========================================
+ Hits 68947 94390 +25443
+ Misses 55188 36018 -19170
🚀 New features to boost your workflow:
|
wpbonelli
left a comment
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.
seems good to me
jdhughes-dev
left a comment
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.
As is, this option will not be visible to anyone who does not know it exists. It could be pulled out as a kwarg and added to the docstring for the kwargs in mbase.
Also, there is no test(s) with evaluation that it is working as intended...although I don't think this is critical.
b67bee4 to
3a60459
Compare
flopy/mbase.py
Outdated
| Number of values per line when writing free-format arrays. When set | ||
| (e.g., ``free_format_npl=10``), arrays are written with that many | ||
| values per line instead of all values on a single line. This produces | ||
| block-format output matching Groundwater Vistas style, improving |
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.
Would simplify to
...block-format output, improving...
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.
Simplified!
3a60459 to
6f76466
Compare
|
@reneangermeyer, |
… free-format array output When free_format_npl is set (e.g., model.free_format_npl = 10), free-format arrays are written with that many values per line instead of all values on a single line. This produces block-format output matching Groundwater Vistas style, improving readability for large unstructured models. Affects both INTERNAL arrays (Util2d.string) and EXTERNAL/OPENCLOSE arrays (Util2d.get_file_entry). Default is None (no change in behavior).
6f76466 to
cfe64e8
Compare
jlarsen-usgs
left a comment
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 for adding the keyword argument to the MfUsg Class. Overall, the changes look good to me.
When FloPy writes free-format arrays for unstructured MODFLOW-USG models,
all values are written on a single line (e.g., 65,448 values on one line for
a large model). This makes files unreadable and difficult to diff or inspect.
Groundwater Vistas and other preprocessors write these same arrays with
10 values per line in block format, which is equally valid for MODFLOW but
far more readable.
This PR adds a
model.free_format_nplproperty (values per line) thatcontrols line wrapping when writing free-format arrays.
Usage