Skip to content

Commit

Permalink
Merge pull request #1 from schism-dev/main
Browse files Browse the repository at this point in the history
Update deprecated sjoin argument (schism-dev#131)
  • Loading branch information
mansurjisan authored Aug 20, 2024
2 parents f90496b + 3051b1e commit 1478884
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 1478884

Please sign in to comment.