-
Notifications
You must be signed in to change notification settings - Fork 12
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
add point_is_inside to BaseRegionOfInterest #413
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #413 +/- ##
=======================================
Coverage 99.83% 99.83%
=======================================
Files 22 22
Lines 1207 1219 +12
=======================================
+ Hits 1205 1217 +12
Misses 2 2 ☔ View full report in Codecov by Sentry. |
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 good to go @stellaprins (apart from a few pedantic suggestions).
I would also like to put forward a suggesiton for naming the method as contains_point
instead of point_is_inside
.
My reasoning is explained in the following mock code snippet:
poly = PolygonOfInterest(exterior_boundary)
poly.contains_point(data_array) # this reads more natural to me
poly.point_is_inside(data_array) # understandable, but doesn't flow as nicely
Opinions on this @stellaprins, @willGraham01?
I also opened a new issue #415 to showcase this feature in an example (assigned to myself). |
No strong opinions, happy to go with this - you are right that "polygon contains point" reads better than "polygon point is inside" |
Thanks for the suggestions @niksirbi
All done. |
|
* add point_is_inside to BaseRegionOfInterest * match length underlining docstring to title * add point within LoI tests and test excluded boundaries * reformat test names and docstrings * change point_is_inside to contains_point
Description
What is this PR
Why is this PR needed?
To enable implementation of event arrays.
What does this PR do?
Enables to determine if a position (a Shapely 2D or 3D point) is inside the region of interest (by default including the boundary of the region).
References
#408
How has this PR been tested?
Tests added for a polygon with a hole and a line (with and without boundaries)
Is this a breaking change?
No.
Does this PR require an update to the documentation?
No, not necessarily. But down the line the functionality could be used in an example. See #415.
Checklist: