Skip to content

Commit

Permalink
Update deprecated sjoin argument
Browse files Browse the repository at this point in the history
  • Loading branch information
SorooshMani-NOAA committed Aug 16, 2024
1 parent b375826 commit 16a5672
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pyschism/mesh/fgrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def add_region(
gdf2 = gpd.GeoDataFrame(
{'geometry': points, 'index': list(range(len(points)))},
crs=self.crs)
gdf_in = gpd.sjoin(gdf2, gdf1, op="within")
gdf_in = gpd.sjoin(gdf2, gdf1, predicate="within")
picks = ([i.index for i in gdf_in.itertuples()])
self.values[picks] = value

Expand All @@ -106,7 +106,7 @@ def modify_by_region(self, hgrid, fname, value, depth1, flag):
gdf2 = gpd.GeoDataFrame(
{'geometry': points, 'index': list(range(len(points)))},
crs=self.crs)
gdf_in = gpd.sjoin(gdf2, gdf1, op="within")
gdf_in = gpd.sjoin(gdf2, gdf1, predicate="within")
picks = [i.index for i in gdf_in.itertuples()]
if flag == 0:
self.values[picks] = value
Expand Down
4 changes: 2 additions & 2 deletions pyschism/mesh/gridgr3.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def add_region(self, region: Union[Polygon, MultiPolygon], value):
gdf2 = gpd.GeoDataFrame(
{"geometry": points, "index": list(range(len(points)))}, crs=self.crs
)
gdf_in = gpd.sjoin(gdf2, gdf1, op="within")
gdf_in = gpd.sjoin(gdf2, gdf1, predicate="within")
picks = [i.index for i in gdf_in.itertuples()]
self.values[picks] = value

Expand All @@ -61,7 +61,7 @@ def modify_by_region(self, hgrid, fname, value, depth1, flag):
points = [Point(*coord) for coord in self.coords]
gdf2 = gpd.GeoDataFrame(
{'geometry': points, 'index': list(range(len(points)))})
gdf_in = gpd.sjoin(gdf2, gdf1, op="within")
gdf_in = gpd.sjoin(gdf2, gdf1, predicate="within")
picks = [i.index for i in gdf_in.itertuples()]
if flag == 0:
self.values[picks] = value
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run(self):
'cfgrib',
'f90nml',
'fsspec',
'geopandas',
'geopandas>=0.10',
'metpy',
'netCDF4',
'netcdf-flattener>=1.2.0',
Expand Down

0 comments on commit 16a5672

Please sign in to comment.