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

Skip to content

Feat(plot_centers): add plot_centers support to PlotMapView and PlotCrossSection#2318

Merged
jlarsen-usgs merged 5 commits into
modflowpy:developfrom
jlarsen-usgs:develop
Oct 7, 2024
Merged

Feat(plot_centers): add plot_centers support to PlotMapView and PlotCrossSection#2318
jlarsen-usgs merged 5 commits into
modflowpy:developfrom
jlarsen-usgs:develop

Conversation

@jlarsen-usgs

@jlarsen-usgs jlarsen-usgs commented Sep 26, 2024

Copy link
Copy Markdown
Contributor

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()

closes #2299

…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()
@jlarsen-usgs

Copy link
Copy Markdown
Contributor Author

@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
@jlarsen-usgs jlarsen-usgs marked this pull request as ready for review September 27, 2024 17:54
@wpbonelli

Copy link
Copy Markdown
Member

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

codecov Bot commented Oct 5, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 76.64234% with 32 lines in your changes missing coverage. Please review.

Project coverage is 74.3%. Comparing base (181e101) to head (75816fe).
Report is 8 commits behind head on develop.

Files with missing lines Patch % Lines
flopy/plot/crosssection.py 68.8% 19 Missing ⚠️
flopy/plot/map.py 60.8% 9 Missing ⚠️
flopy/utils/geometry.py 87.0% 4 Missing ⚠️
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     
Files with missing lines Coverage Δ
flopy/plot/plotutil.py 56.8% <100.0%> (+0.7%) ⬆️
flopy/utils/geometry.py 75.6% <87.0%> (+1.5%) ⬆️
flopy/plot/map.py 82.2% <60.8%> (-1.3%) ⬇️
flopy/plot/crosssection.py 67.1% <68.8%> (+0.2%) ⬆️

... and 89 files with indirect coverage changes

@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.

looks good to me, made a couple comments.

Comment thread flopy/utils/geometry.py
dy = np.abs(y0 - y1)
dx = x1 - x0
dy = y1 - y0
if dx == 0:

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.

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)

Copy link
Copy Markdown
Contributor Author

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.

Comment thread flopy/utils/geometry.py
return bx, by


def distance(x0, y0, x1, y1):

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.

could use math.dist or np.linalg.norm instead? idk how the performance compares.

Copy link
Copy Markdown
Contributor Author

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.

@jlarsen-usgs jlarsen-usgs merged commit c6a41ab into modflowpy:develop Oct 7, 2024
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.

feature: flopy.plot.crosssection plot cell centres (DISU)

2 participants