Skip to content

Conversation

@wpbonelli
Copy link
Member

close #2647, correcting initial buggy implementation of #2270

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

❌ Patch coverage is 67.44186% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.7%. Comparing base (556c088) to head (1576fb8).
⚠️ Report is 94 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/utils/binaryfile/__init__.py 70.3% 35 Missing ⚠️
flopy/utils/datafile.py 62.2% 20 Missing ⚠️
flopy/pakbase.py 0.0% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2648      +/-   ##
===========================================
+ Coverage     55.5%    72.7%   +17.1%     
===========================================
  Files          644      667      +23     
  Lines       124135   129516    +5381     
===========================================
+ Hits         68947    94162   +25215     
+ Misses       55188    35354   -19834     
Files with missing lines Coverage Δ
flopy/pakbase.py 82.7% <0.0%> (-1.8%) ⬇️
flopy/utils/datafile.py 75.4% <62.2%> (+1.1%) ⬆️
flopy/utils/binaryfile/__init__.py 84.3% <70.3%> (-0.2%) ⬇️

... and 556 files with indirect coverage changes

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

"""
out = np.ma.zeros(self.nnodes, dtype=np.float32)
out = np.ma.zeros(self.nnodes, dtype=data["q"].dtype)
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated fix to avoid unwanted rounding in the full3D code path

spd = getattr(self, "stress_period_data")
if isinstance(item, MfList):
if not isinstance(item, list) and not isinstance(item, tuple):
if not isinstance(item, (list, tuple)):
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated opportunistic simplification

[(layer, row, column), (layer, row, column), ...]. The layer,
row, and column values must be zero based.
idx : int, tuple of ints, or list of such
Acceptable values depend on grid type:
Copy link
Member Author

Choose a reason for hiding this comment

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

Described required syntax for each grid type as requested. But I tentatively reworked this to accept a properly-shaped tuple for the grid type. Having to pass a 3-tuple with dummy values was very awkward and I'm tempted to call this a fix even though it's a breaking change. I don't know of anywhere else this is done that way. Wondering how others feel about this.

Copy link
Member Author

Choose a reason for hiding this comment

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

idk why I was thinking we had to pick one or the other way, it's unambiguous with the 3-tuple since you already know what type the grid is. doh. added support for the old way so this is no longer breaking.

@wpbonelli wpbonelli marked this pull request as ready for review December 11, 2025 21:11
@wpbonelli wpbonelli added the bug label Dec 11, 2025
@wpbonelli
Copy link
Member Author

@cneyens do you mind having a look at this before I merge?

@wpbonelli wpbonelli added this to the 3.9.6 milestone Dec 14, 2025
@cneyens
Copy link

cneyens commented Dec 15, 2025

@cneyens do you mind having a look at this before I merge?

@wpbonelli thanks for this! I've checked with the example in #2647 which now works with both DIS and DISV grids. For DISV grids, the same results are returned for qx when using the original three-indices cell id (with dummy value in the second position) and the new two-indices approach.

Can this also be implemented for the head object, so hds.get_ts() has the same behaviour as bud.get_ts() when using DISV grids?

Time series of other fluxes are also working as expected, except STO-SS with a DISV grid (regardless of using three-indices or two-indices for the idx argument): bud.get_ts(idx=pbidx_full, text='STO-SS') fails on the following line:

if variable not in available:

returning error TypeError: argument of type 'NoneType' is not iterable. With a DIS grid, it works fine.
I think this is due to STO-SS having IMETH=1 and returning an array instead of a recarray. For DIS grids, use_full3d is True and that part of the code is not accessed.

@wpbonelli
Copy link
Member Author

Thanks @cneyens nice catch. I guess the fact that IMETH=1 arrays are always padded to 3D regardless of grid type is probably where the motivation to use dummy-valued 3-tuple cell IDs came from.

CellBudgetFile and HeadFile will both take padded and properly-shaped cell IDs now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: issues with get_ts support for aux vars

2 participants