Skip to content

docs(util_array): drop Util3d docstring entries taken from its siblings - #2905

Open
dylanpulver wants to merge 1 commit into
modflowpy:developfrom
dylanpulver:docs/util3d-sibling-params
Open

dylanpulver wants to merge 1 commit into
modflowpy:developfrom
dylanpulver:docs/util3d-sibling-params

Conversation

@dylanpulver

Copy link
Copy Markdown
Contributor

The claim

Util3d's docstring documents ext_filename and bin, and Util3d takes neither:

Util3d(model, shape, dtype, value, name, fmtin, cnstnt, iprn, locat, ext_unit_dict, array_free_format)

Its three siblings in the same file do take them, which is where the entries came from:

class takes ext_filename / bin
Util2d (:1787) yes
Transient2d (:1302) yes
Transient3d (:989) yes
Util3d (:449) no — takes ext_unit_dict instead

So this is not a missing feature. Util3d deliberately differs from the other three: where they take an explicit external filename, it takes ext_unit_dict. The two entries are the paste that did not get trimmed.

What I did not do

Util3d has two real arguments that are not documented at all: ext_unit_dict and array_free_format. array_free_format is documented on Util2d and could presumably be copied across, but ext_unit_dict is the one that makes Util3d different from its siblings and I would be guessing at how you would describe it. Tell me and I will add both.

Checks

ruff check --force-exclude passes and ruff format --check --force-exclude reports the file already formatted. (--force-exclude because [tool.ruff.format] excludes flopy/mf6/**; naming paths explicitly without it overrides your own exclude list. Not relevant for this file, but I run both the same way everywhere.)

Eight deleted lines, docstring only. I did not run the test suite.

One more I am not touching, because it may be the opposite problem

utils/compare.py:1192 — compare_stages documents precision and does not accept it, and at first glance it looks like the same paste: compare_heads (:566) and compare_concentrations (:948) both take precision="auto" and carry the identical two lines of text.

But SwrStage.__init__(self, filename, precision="double", verbose=False) does take a precision, and compare_stages calls SwrStage(sfpth1, verbose=verbose) without one, so it silently compares at double precision. That makes the docstring entry a plausible record of a parameter the function was meant to expose, not just leftover text. Adding it is an API change and your call — I would rather ask than delete the evidence of it.

🤖 Generated with Claude Code

Util2d, Transient2d and Transient3d all take ext_filename and bin.
Util3d does not; it takes ext_unit_dict instead.
@codecov

codecov Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.8%. Comparing base (556c088) to head (f936fa3).
⚠️ Report is 270 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2905      +/-   ##
===========================================
+ Coverage     55.5%    73.8%   +18.3%     
===========================================
  Files          644      659      +15     
  Lines       124135   132487    +8352     
===========================================
+ Hits         68947    97880   +28933     
+ Misses       55188    34607   -20581     
Files with missing lines Coverage Δ
flopy/utils/util_array.py 82.4% <ø> (-1.0%) ⬇️

... and 585 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wpbonelli wpbonelli left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest just including array_free_format

array_free_format : bool, optional
    whether array control records use free format. Defaults to the
    model's setting.

I wouldn't bother with ext_unit_dict. We can handle the other points separately, thank you for the heads up.

@wpbonelli wpbonelli changed the title fix(util_array): drop Util3d docstring entries taken from its siblings docs(util_array): drop Util3d docstring entries taken from its siblings Nov 29, 2026

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

2 participants