Skip to content

Commit

Permalink
fix(PlotCrossSection): update number of points check (#1533)
Browse files Browse the repository at this point in the history
* fix(PlotCrossSection): update number of points check 

* update to check n points instead of n cells intersected

* linting
  • Loading branch information
jlarsen-usgs committed Sep 8, 2022
1 parent d8f8dd0 commit 5a8e68f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions flopy/plot/crosssection.py
Expand Up @@ -179,10 +179,14 @@ def __init__(
)

if len(self.xypts) < 2:
s = "cross-section cannot be created\n."
s += " less than 2 points intersect the model grid\n"
s += f" {len(self.xypts)} points intersect the grid."
raise Exception(s)
if len(list(self.xypts.values())[0]) < 2:
s = (
"cross-section cannot be created\n."
" less than 2 points intersect the model grid\n"
f" {len(self.xypts.values()[0])} points"
" intersect the grid."
)
raise Exception(s)

if self.geographic_coords:
# transform back to geographic coordinates
Expand Down

0 comments on commit 5a8e68f

Please sign in to comment.