-
Notifications
You must be signed in to change notification settings - Fork 307
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
perf(Gridintersect): optimize intersection methods for shapely 2.0 #1666
Merged
mwtoews
merged 29 commits into
modflowpy:develop
from
dbrakenhoff:gridintersect_shapely20
Dec 23, 2022
Merged
perf(Gridintersect): optimize intersection methods for shapely 2.0 #1666
mwtoews
merged 29 commits into
modflowpy:develop
from
dbrakenhoff:gridintersect_shapely20
Dec 23, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docs(misc): clean up docstrings
for unsupported methods
ensure one entry per grid cell in polygon intersection result add test for this case
bug in structured mode where linestrings were not handled correctly if they pass in and out of grid cell
- fix vertices when intersecting linestring with offset grids
- increases performance by at least 2-10x - add methods optimized for shapely 2.0 (`_intersect_*_shapely2`) - add temporary shapely2 flag to `intersect()` - add shapely 2.0 logic to intersects() - deprecate keepzerolengths for shapely intersection methods (was not used). - fix bug when using facecolor in plot_polygon() - add tests for multilinestrings along cell boundaries - clean up tests a bit - improve/update grid intersection notebook
Codecov Report
@@ Coverage Diff @@
## develop #1666 +/- ##
=========================================
- Coverage 71.6% 71.4% -0.2%
=========================================
Files 253 253
Lines 55724 55873 +149
=========================================
+ Hits 39921 39926 +5
- Misses 15803 15947 +144
|
"fix" test for rotated structured grid
fix getting lay, row, col for structured grids in intersects()
fix failing tests
- avoid duplicate intersection results when intersecting with MultiLineString on cell boundary
langevin-usgs
approved these changes
Dec 22, 2022
jlarsen-usgs
approved these changes
Dec 22, 2022
mwtoews
approved these changes
Dec 23, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great and tests nicely with old and new shapely versions, thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Making use of shapely's new array-based functions, maintaining backwards compatibility with shapely<2.0.
_intersect_*_shapely2
)intersect()
for comparing with old implementation.