bug: Flopy is crashing on function using shapefiles #1725
Replies: 2 comments 1 reply
-
The error you post seems to indicate variable Gridintersect loops through this dataset for each cell to obtain the vertices and construct shapely geometries: vtx_grid._cell2d[('icvert_0', 'icvert_1', 'icvert_2', 'icvert_3', 'icvert_4', 'icvert_5')] Where the no. of Are you mixing different geometries, e.g. rectangles and triangles, in your grid? If so, I don't think we handle that case correctly and this is a bug we need to address. Otherwise, there's something odd about your grid...? As for the errors related to Gridgen, you'll need to post those so we can take a look at those. This GridIntersect error is probably not related. |
Beta Was this translation helpful? Give feedback.
-
Hey @edesousa-intera, can you try and reproduce your error with a very simple example, and post the files here? I don't think we have enough to go on with your description. Will transfer this to a discussion. |
Beta Was this translation helpful? Give feedback.
-
Getting error messages in various flopy shapefile-related functions such as Gridgen(add_refinement_features) and Grid Intersect.
I believe it may be related to updated Shapely and/or PyShp libraries, but couldn't pin down the error.
Using GridIntersect returns an error message:
Code:
ix = GridIntersect(vtx_grid, method='vertex', rtree=True)
Error message:
TypeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_15016\2427717357.py in
1 # Selection for Alluvium cells
----> 2 ix = GridIntersect(vtx_grid, method='vertex', rtree=True)
c:\Anaconda3\lib\site-packages\flopy\utils\gridintersect.py in init(self, mfgrid, method, rtree)
172 if self.method == "vertex":
173 # build arrays of geoms and cellids
--> 174 self.geoms, self.cellids = self._get_gridshapes()
175
176 # build STR-tree if specified
c:\Anaconda3\lib\site-packages\flopy\utils\gridintersect.py in _vtx_grid_to_geoms_cellids(self)
421 points.append(
422 (
--> 423 self.mfgrid._vertices[iv][1],
424 self.mfgrid._vertices[iv][2],
425 )
TypeError: list indices must be integers or slices, not NoneType
Beta Was this translation helpful? Give feedback.
All reactions