From 47a796198285db3f0017ac1c03b697db6115c0ef Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 6 Mar 2024 09:46:12 -1000 Subject: [PATCH] Replace `cudf.core` imports with public APIs (#1356) This PR replaces `cudf.core` imports of `Series` and `DataFrame` with their public API equivalents. Authors: - Matthew Roeschke (https://github.com/mroeschke) Approvers: - Mark Harris (https://github.com/harrism) - Michael Wang (https://github.com/isVoid) - Bradley Dice (https://github.com/bdice) URL: https://github.com/rapidsai/cuspatial/pull/1356 --- .../core/binpreds/contains_geometry_processor.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/cuspatial/cuspatial/core/binpreds/contains_geometry_processor.py b/python/cuspatial/cuspatial/core/binpreds/contains_geometry_processor.py index 8a1996613..fb8af71af 100644 --- a/python/cuspatial/cuspatial/core/binpreds/contains_geometry_processor.py +++ b/python/cuspatial/cuspatial/core/binpreds/contains_geometry_processor.py @@ -3,8 +3,6 @@ import cupy as cp import cudf -from cudf.core.dataframe import DataFrame -from cudf.core.series import Series from cuspatial.core._column.geocolumn import GeoColumn from cuspatial.core.binpreds.binpred_interface import ( @@ -117,7 +115,7 @@ def _convert_quadtree_result_from_part_to_polygon_indices( ["polygon_index", "point_index"] ] - def _reindex_allpairs(self, lhs, op_result) -> DataFrame: + def _reindex_allpairs(self, lhs, op_result) -> cudf.DataFrame: """Prepare the allpairs result of a contains_properly call as the first step of postprocessing. An allpairs result is reindexed by replacing the polygon index with the original index of the @@ -154,7 +152,7 @@ def _reindex_allpairs(self, lhs, op_result) -> DataFrame: # Replace the polygon index with the original index allpairs_result["polygon_index"] = allpairs_result[ "polygon_index" - ].replace(Series(lhs.index, index=cp.arange(len(lhs.index)))) + ].replace(cudf.Series(lhs.index, index=cp.arange(len(lhs.index)))) return allpairs_result @@ -202,7 +200,7 @@ def _postprocess_multipoint_rhs( point_indices = preprocessor_result.point_indices allpairs_result = self._reindex_allpairs(lhs, op_result) - if isinstance(allpairs_result, Series): + if isinstance(allpairs_result, cudf.Series): return allpairs_result # Hits is the number of calculated points in each polygon # Expected count is the sizes of the features in the right-hand