-
Notifications
You must be signed in to change notification settings - Fork 320
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
Feat(plot_centers): add plot_centers support to PlotMapView and PlotCrossSection #2318
Conversation
…rossSection fixes and updates included with feature: * filter very short/small intersection segments from cross-sectional plotting routine * sort and assure vertex order is correct for intersected cross-sectional segments * improve geometry.project_point_onto_xc_line() calculation routine. * update reproject_modpath_to_crosssection()
@wpbonelli, do you have any insight into the windows failures/have you seen this before? CI is failing on the Install modflow executables step with an error that states "python3 is not recognized ..." |
* add projctr attribute to PlotCrossSection for testing purposes
I think there may be a couple things going on... one being, GH evidently dropped some items from their API responses https://github.com/orgs/community/discussions/140079 when a token is present on the request. Easy enough to work around. Idk about the python not found issue. I will take a closer look later today |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #2318 +/- ##
=========================================
- Coverage 75.6% 74.3% -1.3%
=========================================
Files 294 294
Lines 59560 59677 +117
=========================================
- Hits 45073 44395 -678
- Misses 14487 15282 +795
|
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 me, made a couple comments.
dy = np.abs(y0 - y1) | ||
dx = x1 - x0 | ||
dy = y1 - y0 | ||
if dx == 0: |
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.
is the exact zero check sufficient or would approximate equality be safer? to avoid not only inf but unrepresentably large slope (greater than sys.float_info.max
)
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.
The exact zero check is only to avoid an "inf" condition in the case of a vertical line, which is a common occurance (e.g., line={"column": 1}
). In this case we want to replace dx=0
with dx=very small number
to be able to approximate the calculation.
return bx, by | ||
|
||
|
||
def distance(x0, y0, x1, y1): |
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.
could use math.dist
or np.linalg.norm
instead? idk how the performance compares.
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.
math.dist
only operates over individual point instances, so would require an additional loop. np.sqrt(...) and np.linalg.norm
are reported to have similar performance. Opted for adding a distance method to be more explicit, and because distance is calculated in multiple methods within PlotCrossSection.
fixes and updates included with feature:
closes #2299