From 4b6cb9f429eb794d9de3d726bf04a1c686f4270d Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:35:51 -0800 Subject: [PATCH 1/5] Replace cudf column.full with cudf.as_column --- python/cuspatial/cuspatial/core/binops/distance_dispatch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index c19953107..8588b8db5 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -1,5 +1,5 @@ import cudf -from cudf.core.column import as_column, full +from cudf.core.column import as_column from cuspatial._lib.distance import ( pairwise_linestring_distance, @@ -185,9 +185,9 @@ def __call__(self): # Rows with misaligned indices contains nan. Here we scatter the # distance values to the correct indices. - result = full( - len(self._res_index), + result = as_column( float("nan"), + length=len(self._res_index), dtype="float64", ) scatter_map = as_column( From e18caa1aaa51a84c724dd3653716998aafc13e8d Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 28 Feb 2024 12:52:48 -0800 Subject: [PATCH 2/5] Handle empty case --- python/cuspatial/cuspatial/core/binops/distance_dispatch.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index 8588b8db5..ea07863a8 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -186,9 +186,7 @@ def __call__(self): # Rows with misaligned indices contains nan. Here we scatter the # distance values to the correct indices. result = as_column( - float("nan"), - length=len(self._res_index), - dtype="float64", + [float("nan")] * len(self._res_index), dtype="float64" ) scatter_map = as_column( range(len(self._res_index)), dtype="int32" From c6004f33dedd171187cd77e6b6a15b388539a792 Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Mar 2024 09:21:55 -0600 Subject: [PATCH 3/5] Update python/cuspatial/cuspatial/core/binops/distance_dispatch.py Co-authored-by: GALI PREM SAGAR --- python/cuspatial/cuspatial/core/binops/distance_dispatch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index ea07863a8..aeb71d8cf 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -186,7 +186,7 @@ def __call__(self): # Rows with misaligned indices contains nan. Here we scatter the # distance values to the correct indices. result = as_column( - [float("nan")] * len(self._res_index), dtype="float64" + [float("nan")] * len(self._res_index), dtype="float64", nan_as_null=False ) scatter_map = as_column( range(len(self._res_index)), dtype="int32" From d7533f0b4b638c60f9bbe7e56b444c3a40094f5c Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Mar 2024 09:51:49 -0600 Subject: [PATCH 4/5] Update python/cuspatial/cuspatial/core/binops/distance_dispatch.py Co-authored-by: GALI PREM SAGAR --- python/cuspatial/cuspatial/core/binops/distance_dispatch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index aeb71d8cf..a87d4adaf 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -186,7 +186,9 @@ def __call__(self): # Rows with misaligned indices contains nan. Here we scatter the # distance values to the correct indices. result = as_column( - [float("nan")] * len(self._res_index), dtype="float64", nan_as_null=False + [float("nan")] * len(self._res_index), + dtype="float64", + nan_as_null=False, ) scatter_map = as_column( range(len(self._res_index)), dtype="int32" From a81f5950143c8e01ca96f1f7b8d8167943e6cd5d Mon Sep 17 00:00:00 2001 From: Bradley Dice Date: Tue, 5 Mar 2024 12:02:40 -0600 Subject: [PATCH 5/5] Update python/cuspatial/cuspatial/core/binops/distance_dispatch.py Co-authored-by: Lawrence Mitchell --- python/cuspatial/cuspatial/core/binops/distance_dispatch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py index a87d4adaf..db2e6339b 100644 --- a/python/cuspatial/cuspatial/core/binops/distance_dispatch.py +++ b/python/cuspatial/cuspatial/core/binops/distance_dispatch.py @@ -186,7 +186,8 @@ def __call__(self): # Rows with misaligned indices contains nan. Here we scatter the # distance values to the correct indices. result = as_column( - [float("nan")] * len(self._res_index), + float("nan"), + length=len(self._res_index), dtype="float64", nan_as_null=False, )