Skip to content
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 usage of cudf.core.column.arange to cudf.core.column.as_column #1323

Merged
merged 1 commit into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/cuspatial/cuspatial/core/_column/geocolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pyarrow as pa

import cudf
from cudf.core.column import ColumnBase, arange, as_column, build_list_column
from cudf.core.column import ColumnBase, as_column, build_list_column

from cuspatial.core._column.geometa import Feature_Enum, GeoMeta
from cuspatial.utils.column_utils import empty_geometry_column
Expand Down Expand Up @@ -364,5 +364,5 @@ def _xy_as_variable_sized_list(xy: ColumnBase):
raise ValueError("xy must have an even number of elements")

num_points = len(xy) // 2
indices = arange(0, num_points * 2 + 1, 2, dtype="int32")
indices = as_column(range(0, num_points * 2 + 1, 2), dtype="int32")
return build_list_column(indices=indices, elements=xy, size=num_points)
6 changes: 3 additions & 3 deletions python/cuspatial/cuspatial/core/binops/distance_dispatch.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import cudf
from cudf.core.column import arange, full
from cudf.core.column import as_column, full

from cuspatial._lib.distance import (
pairwise_linestring_distance,
Expand Down Expand Up @@ -190,8 +190,8 @@ def __call__(self):
float("nan"),
dtype="float64",
)
scatter_map = arange(
len(self._res_index), dtype="int32"
scatter_map = as_column(
range(len(self._res_index)), dtype="int32"
).apply_boolean_mask(self._non_null_mask)

result[scatter_map] = dist
Expand Down
4 changes: 2 additions & 2 deletions python/cuspatial/cuspatial/core/binops/intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import TYPE_CHECKING

import cudf
from cudf.core.column import arange, build_list_column
from cudf.core.column import as_column, build_list_column

from cuspatial._lib.intersection import (
pairwise_linestring_intersection as c_pairwise_linestring_intersection,
Expand Down Expand Up @@ -93,7 +93,7 @@ def pairwise_linestring_intersection(
]

linestring_column = build_list_column(
indices=arange(0, len(segments) + 1, dtype="int32"),
indices=as_column(range(0, len(segments) + 1), dtype="int32"),
elements=segments,
size=len(segments),
)
Expand Down