Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(MfUsgCln): issue with default unitnumber; improve docstrings#2595

Merged
wpbonelli merged 2 commits into
modflowpy:developfrom
mwtoews:fix-mfusgscln-unitnumber
Sep 11, 2025
Merged

fix(MfUsgCln): issue with default unitnumber; improve docstrings#2595
wpbonelli merged 2 commits into
modflowpy:developfrom
mwtoews:fix-mfusgscln-unitnumber

Conversation

@mwtoews

@mwtoews mwtoews commented Sep 10, 2025

Copy link
Copy Markdown
Contributor

This fixes an issue when using MfUsgCln with the default unitnumber option. Also improve docstrings for the init constructor using numpydoc format.

@mwtoews

mwtoews commented Sep 10, 2025

Copy link
Copy Markdown
Contributor Author

This fix is for the following issue taken from the docstring example (with a few mods):

import flopy
ml = flopy.mfusg.MfUsg()
node_prop = [
    [1, 1, 0, 10.0, -110.0, 1.57, 0, 0],
    [2, 1, 0, 10.0, -130.0, 1.57, 0, 0],
]
cln_gwc = [
    [1, 1, 50, 50, 0, 0, 10.0, 1.0, 0],
    [2, 2, 50, 50, 0, 0, 10.0, 1.0, 0],
]
cln_circ = [[1, 0.5, 3.23e10]]
cln = flopy.mfusg.MfUsgCln(ml, ncln=1, iclnnds=-1, nndcln=2,
    nclngwc=2, node_prop=node_prop, cln_gwc=cln_gwc, cln_circ=cln_circ)

Traceback (most recent call last):
File "", line 12, in
cln = flopy.mfusg.MfUsgCln(ml, ncln=1, iclnnds=-1, nndcln=2,
nclngwc=2, node_prop=node_prop, cln_gwc=cln_gwc, cln_circ=cln_circ)
File "/home/mtoews/src/FloPy/flopy/flopy/mfusg/mfusgcln.py", line 235, in init
setattr(self, f"i{attr}", int(unitnumber[idx + 1]))

@codecov

codecov Bot commented Sep 10, 2025

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2595      +/-   ##
===========================================
+ Coverage     55.5%    72.5%   +16.9%     
===========================================
  Files          644      667      +23     
  Lines       124135   128669    +4534     
===========================================
+ Hits         68947    93309   +24362     
+ Misses       55188    35360   -19828     
Files with missing lines Coverage Δ
flopy/mfusg/mfusgcln.py 69.1% <100.0%> (+2.1%) ⬆️

... and 550 files with indirect coverage changes

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

Comment thread flopy/mfusg/mfusgcln.py
# set default unit number of one is not specified
if unitnumber is None:
self.unitnumber = self._defaultunit()
unitnumber = self._defaultunit()

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.

I guess this wasn't meant to be an attribute and this was just a typo

@wpbonelli wpbonelli merged commit a49a7a7 into modflowpy:develop Sep 11, 2025
20 checks passed
@mwtoews mwtoews deleted the fix-mfusgscln-unitnumber branch September 11, 2025 00:56
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