Skip to content

fix(uzf1): argument names - #2901

Merged
emorway-usgs merged 1 commit into
modflowpy:developfrom
dylanpulver:docs/uzf-and-netcdf-param-names
Nov 25, 2026
Merged

emorway-usgs merged 1 commit into
modflowpy:developfrom
dylanpulver:docs/uzf-and-netcdf-param-names

Conversation

@dylanpulver

@dylanpulver dylanpulver commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Two docstrings name arguments their functions do not take:

  • ModflowUzf1 documents uzgage; the argument is uzgag. Its other 35 entries all match the signature exactly, so this looks like a stray e.
  • NetCdf.initialize_group(self, group, dimensions, attributes, dimension_data) documents name, which describes the group argument ("name of the netcdf group"), and dimension_shape, which has no counterpart at all — dimension_data is documented separately on its own line. group was the only real argument left undocumented, so I renamed name to it and removed dimension_shape.
import inspect
from flopy.modflow import ModflowUzf1
"uzgage" in inspect.signature(ModflowUzf1).parameters  # False
"uzgag" in inspect.signature(ModflowUzf1).parameters   # True

Neither takes **kwargs, so these raise TypeError rather than being ignored.

Three things I deliberately left alone, since the right repair is yours to choose rather than mine to guess:

  • ModflowUzf1 also documents row_col_iftunit_iuzopt and uzfbud_ext, neither of which is an argument. The second one's own text says it "appears to be used for" naming budget files, so I did not want to delete it on a hunch.
  • MFSimulation documents tdis6, models, exchanges, mxiter and solutiongroup — those read like simulation name-file keywords rather than constructor arguments.
  • MfUsgDpf documents six names (iuzontabim, alphaim, betaim, srim, brookim, bpim) whose constructor arguments, attribute assignments and loader lines are all commented out just below. Removing the docs there might be the opposite of what you want.

ruff check and ruff format --check on both files report the same single pre-existing finding before and after.

@emorway-usgs
emorway-usgs self-requested a review November 25, 2026 16:07

@emorway-usgs emorway-usgs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks for the cleanup

@codecov

codecov Bot commented Nov 25, 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 (7f03096).
⚠️ Report is 268 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2901      +/-   ##
===========================================
+ Coverage     55.5%    73.8%   +18.3%     
===========================================
  Files          644      659      +15     
  Lines       124135   132487    +8352     
===========================================
+ Hits         68947    97874   +28927     
+ Misses       55188    34613   -20575     
Files with missing lines Coverage Δ
flopy/export/netcdf.py 48.5% <ø> (-0.6%) ⬇️
flopy/modflow/mfuzf1.py 91.5% <ø> (-0.6%) ⬇️

... and 584 files with indirect coverage changes

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

@emorway-usgs emorway-usgs changed the title Name the arguments ModflowUzf1 and initialize_group take fix(uzf1): argument names Nov 25, 2026
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@emorway-usgs
emorway-usgs force-pushed the docs/uzf-and-netcdf-param-names branch from f923888 to 7f03096 Compare November 25, 2026 18:20
@emorway-usgs
emorway-usgs merged commit 76bab38 into modflowpy:develop Nov 25, 2026
17 of 21 checks passed
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