Skip to content

Conversation

@wpbonelli
Copy link
Member

@wpbonelli wpbonelli commented Jan 15, 2026

Add a get_node() method to VertexGrid and UnstructuredGrid, consistent with StructuredGrid, for cell ID -> node number conversions. Rename the lrc_list parameter on StructuredGrid.get_node() to cellids and deprecate lrc_list. Add an optional node2d parameter to determine whether to get the 2D or 3D node number, useful for structured and vertex grids, ignored for unstructured.

The cell ID -> node number conversion was done ad hoc in a few places in the codebase, this allows some simplification. Maybe in 4.x we can standardize the signature and pull an abstract method into the base Grid class.

@wpbonelli wpbonelli added this to the 3.10 milestone Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 94.44444% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.8%. Comparing base (556c088) to head (018e548).
⚠️ Report is 107 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/discretization/structuredgrid.py 86.6% 2 Missing ⚠️
flopy/discretization/unstructuredgrid.py 93.7% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2680      +/-   ##
===========================================
+ Coverage     55.5%    72.8%   +17.2%     
===========================================
  Files          644      667      +23     
  Lines       124135   130158    +6023     
===========================================
+ Hits         68947    94778   +25831     
+ Misses       55188    35380   -19808     
Files with missing lines Coverage Δ
flopy/discretization/vertexgrid.py 81.0% <100.0%> (-2.7%) ⬇️
flopy/export/utils.py 54.3% <100.0%> (-10.3%) ⬇️
flopy/plot/crosssection.py 64.6% <100.0%> (-2.5%) ⬇️
flopy/utils/binaryfile/__init__.py 84.2% <100.0%> (-0.3%) ⬇️
flopy/discretization/unstructuredgrid.py 81.9% <93.7%> (+0.4%) ⬆️
flopy/discretization/structuredgrid.py 53.4% <86.6%> (+5.9%) ⬆️

... and 555 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 marked this pull request as ready for review January 15, 2026 18:20
@wpbonelli
Copy link
Member Author

discussed offline with @jlarsen-usgs

@wpbonelli wpbonelli merged commit 94f3c8c into modflowpy:develop Jan 16, 2026
20 checks passed
@wpbonelli wpbonelli deleted the get-node branch January 16, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant