Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gridintersect): clean up of gridintersect #2346

Merged

Conversation

dbrakenhoff
Copy link
Contributor

@dbrakenhoff dbrakenhoff commented Oct 23, 2024

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
Copy link
Member

@wpbonelli wpbonelli left a comment

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

flopy/utils/gridintersect.py Show resolved Hide resolved
@dbrakenhoff
Copy link
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
Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

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
Copy link
Contributor

mwtoews commented Oct 23, 2024

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

@dbrakenhoff
Copy link
Contributor Author

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

Good spot. Done!

@wpbonelli wpbonelli force-pushed the fix_2344_refactor_gridintersect branch from 9ee002b to 9ba6cc2 Compare October 24, 2024 21:49
@wpbonelli wpbonelli merged commit f8810c2 into modflowpy:develop Oct 24, 2024
17 of 22 checks passed
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