Skip to content

fix(grid): add vertices_coords init parameter - #2687

Closed
wpbonelli wants to merge 2 commits into
modflowpy:developfrom
wpbonelli:fix-2388
Closed

fix(grid): add vertices_coords init parameter#2687
wpbonelli wants to merge 2 commits into
modflowpy:developfrom
wpbonelli:fix-2388

Conversation

@wpbonelli

@wpbonelli wpbonelli commented Jan 25, 2026

Copy link
Copy Markdown
Member

Add a parameter vertices_coords to VertexGrid and UnstructuredGrid init methods, indicating whether vertices are in local or global coordinates. Default to "local". This fixes #2388 by making it possible to avoid repeating the coordinate transformation. The parameter is not applicable to StructuredGrid because vertex coordinates are not provided to its init method.

@wpbonelli wpbonelli added the bug label Jan 25, 2026
@wpbonelli wpbonelli added this to the 3.10 milestone Jan 25, 2026
@codecov

codecov Bot commented Jan 25, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2687      +/-   ##
===========================================
+ Coverage     55.5%    72.3%   +16.8%     
===========================================
  Files          644      667      +23     
  Lines       124135   130304    +6169     
===========================================
+ Hits         68947    94295   +25348     
+ Misses       55188    36009   -19179     
Files with missing lines Coverage Δ
flopy/discretization/unstructuredgrid.py 81.2% <100.0%> (-0.3%) ⬇️
flopy/discretization/vertexgrid.py 80.3% <100.0%> (-3.3%) ⬇️

... and 561 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 25, 2026 13:54
@wpbonelli

Copy link
Copy Markdown
Member Author

After a closer look I see that the same double transform issue applies to cell centers too for unstructured grids. But not vertex grids, which calculate cell centers from vertices. So a new parameter should apply not only to vertices but to any manually specified grid feature coordinates. So it should probably be named differently. Maybe global_xy? This is consistent with a similar parameter in mp7particledata.py, the only difference is that one controls what is output and this one will indicate what is provided as input.

@wpbonelli

Copy link
Copy Markdown
Member Author

decided against this approach after discussion with @jlarsen-usgs @jdhughes-dev

@wpbonelli wpbonelli closed this Jan 30, 2026
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.

Vertex coordinates are not relative to the specified origin

1 participant