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

Skip to content

fix(gridintersect): clean up of gridintersect#2346

Merged
wpbonelli merged 25 commits into
modflowpy:developfrom
dbrakenhoff:fix_2344_refactor_gridintersect
Oct 24, 2024
Merged

fix(gridintersect): clean up of gridintersect#2346
wpbonelli merged 25 commits into
modflowpy:developfrom
dbrakenhoff:fix_2344_refactor_gridintersect

Conversation

@dbrakenhoff

@dbrakenhoff dbrakenhoff commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

This PR does the following:

  • Add DeprecationWarning when method != "vertex"
  • Remove all Shapely<2.0 code
  • Remove warnings filters for older numpy versions
  • Mark methods/tests that should be removed when method="structured" is officially removed
  • Ensure full test suite is maintained after removal of structured tests.
  • Move raster tests to a separate file.
  • Add option to return intersection results as (Geo)DataFrame
  • Allow plotting options to take as input GeoDataFrame (bit unnecessary as they have their own plotting logic) and improve plotting results.
  • Add plot_intersection_result() to plot result + modelgrid (optional).
  • Update example notebook.

Note:

  • Tests for 3D point intersections above/inside grid are deactivated. This is not yet working for method="vertex". Will probably be added in a separate PR.

I'm not sure what the next release will be so I marked most things deprecated (with warning) in the next release and to be removed by 3.10.0. Let me know if that makes sense.

EDIT: modify removal version to 3.10.0

@dbrakenhoff dbrakenhoff linked an issue Oct 23, 2024 that may be closed by this pull request
4 tasks

@wpbonelli wpbonelli left a comment

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 think the next release will probably be 3.9 to coincide with mf6.6 next month? Per the documented deprecation policy we should then wait 2 minor releases before removing but IMO deprecating in 3.9 and dropping in 3.10 is fine — minor releases may slow down as development effort shifts toward the next major version

Comment thread flopy/utils/gridintersect.py
@dbrakenhoff

Copy link
Copy Markdown
Contributor Author

There will probably be a merge conflict for this PR once #2343 is merged, I'll fix it when that happens.

@dbrakenhoff dbrakenhoff requested a review from wpbonelli October 23, 2024 14:50

@christianlangevin christianlangevin left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice cleanup. Looks good.

@mwtoews

mwtoews commented Oct 23, 2024

Copy link
Copy Markdown
Contributor

If we are requiring shapely>=2.0, then update pyproject.toml and etc/environment.yml.

@dbrakenhoff

Copy link
Copy Markdown
Contributor Author

If we are requiring shapely>=2.0, then update pyproject.toml and etc/environment.yml.

Good spot. Done!

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.

bug: GridIntersect improvements

4 participants