-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update GeoDataFrame to Use the Structured GatherMap Class #1219
Conversation
geoseries also needs: diff --git a/python/cuspatial/cuspatial/core/geoseries.py b/python/cuspatial/cuspatial/core/geoseries.py
index 2a66ccec..37c75783 100644
--- a/python/cuspatial/cuspatial/core/geoseries.py
+++ b/python/cuspatial/cuspatial/core/geoseries.py
@@ -22,6 +22,7 @@ from shapely.geometry import (
import cudf
from cudf._typing import ColumnLike
from cudf.core.column.column import as_column
+from cudf.core.copy_types import GatherMap
import cuspatial.io.pygeoarrow as pygeoarrow
from cuspatial.core._column.geocolumn import ColumnType, GeoColumn
@@ -922,10 +923,10 @@ class GeoSeries(cudf.Series):
aligned_right,
)
- def _gather(
- self, gather_map, keep_index=True, nullify=False, check_bounds=True
- ):
- return self.iloc[gather_map]
+ def _gather(self, gather_map: GatherMap, keep_index=True):
+ # TODO: This could use the information to avoid reprocessing
+ # in iloc
+ return self.iloc[gather_map.column]
# def reset_index(self, drop=False, inplace=False, name=None):
def reset_index( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theres a booleanmask type too!
def _apply_boolean_mask(self, gather_map: GatherMap) -> T: | ||
geo_columns, data_columns = self._split_out_geometry_columns() | ||
data = data_columns._apply_boolean_mask(mask) | ||
data = data_columns._apply_boolean_mask(gather_map) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is not a GatherMap
but a copy_types.BooleanMask
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that cudf's _apply_boolean_mask
now also accepts a keep_index
keyword argument, so you probably want to handle that here (or at least accept it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cuspatial should really just try to avoid depending on cudf internals...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that is difficult if you're subclassing though :(
/merge |
Description
As title, addresses upstream cudf change rapidsai/cudf#13534.
Fixes #1222
Checklist