From fd5d977e2dda5ed522835c71468d9e0621199444 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:09:25 -0800 Subject: [PATCH 1/3] Replace cudf _from_columns with a public API --- python/cuspatial/cuspatial/core/spatial/distance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuspatial/cuspatial/core/spatial/distance.py b/python/cuspatial/cuspatial/core/spatial/distance.py index 309e88e21..c9d1cceef 100644 --- a/python/cuspatial/cuspatial/core/spatial/distance.py +++ b/python/cuspatial/cuspatial/core/spatial/distance.py @@ -91,7 +91,7 @@ def directed_hausdorff_distance(multipoints: GeoSeries): as_column(multipoints.multipoints.geometry_offset[:-1]), ) - return DataFrame._from_columns(result, range(num_spaces)) + return DataFrame(dict(enumerate(result))) def haversine_distance(p1: GeoSeries, p2: GeoSeries): From 117689539d09fd42ab1a9861a93f51c4ea378cc7 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:47:02 -0800 Subject: [PATCH 2/3] Add comment about result --- python/cuspatial/cuspatial/core/spatial/distance.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/cuspatial/cuspatial/core/spatial/distance.py b/python/cuspatial/cuspatial/core/spatial/distance.py index c9d1cceef..e1f27388b 100644 --- a/python/cuspatial/cuspatial/core/spatial/distance.py +++ b/python/cuspatial/cuspatial/core/spatial/distance.py @@ -91,6 +91,8 @@ def directed_hausdorff_distance(multipoints: GeoSeries): as_column(multipoints.multipoints.geometry_offset[:-1]), ) + # the column label of each column in result should be its int position + # e.g. a dict of {0: result[0], 1, result[1], ...} return DataFrame(dict(enumerate(result))) From f58d987ffcce3e8ed5909aff027176b4c788faec Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Mon, 22 Jan 2024 15:06:55 -0800 Subject: [PATCH 3/3] Use _from_data --- python/cuspatial/cuspatial/core/spatial/distance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuspatial/cuspatial/core/spatial/distance.py b/python/cuspatial/cuspatial/core/spatial/distance.py index e1f27388b..f9a0b1d6b 100644 --- a/python/cuspatial/cuspatial/core/spatial/distance.py +++ b/python/cuspatial/cuspatial/core/spatial/distance.py @@ -93,7 +93,7 @@ def directed_hausdorff_distance(multipoints: GeoSeries): # the column label of each column in result should be its int position # e.g. a dict of {0: result[0], 1, result[1], ...} - return DataFrame(dict(enumerate(result))) + return DataFrame._from_data(dict(enumerate(result))) def haversine_distance(p1: GeoSeries, p2: GeoSeries):