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

Add data=None to ListColumn constructor #1442

Merged
merged 1 commit into from
Aug 21, 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
11 changes: 10 additions & 1 deletion python/cuspatial/cuspatial/core/_column/geocolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def _from_multipoints_xy(

multi_elements = _xy_as_variable_sized_list(multipoints_xy)
multipoint_col = ListColumn(
data=None,
dtype=cudf.ListDtype(multi_elements.dtype),
size=len(geometry_offsets) - 1,
children=(geometry_offsets, multi_elements),
Expand Down Expand Up @@ -235,11 +236,13 @@ def _from_linestrings_xy(

parts_elements = _xy_as_variable_sized_list(linestrings_xy)
parts_col = ListColumn(
data=None,
dtype=cudf.ListDtype(parts_elements.dtype),
size=len(part_offsets) - 1,
children=(part_offsets, parts_elements),
)
linestrings_col = ListColumn(
data=None,
dtype=cudf.ListDtype(parts_col.dtype),
size=len(geometry_offsets) - 1,
children=(geometry_offsets, parts_col),
Expand Down Expand Up @@ -296,16 +299,19 @@ def _from_polygons_xy(

ring_elements = _xy_as_variable_sized_list(polygons_xy)
rings_col = ListColumn(
data=None,
dtype=cudf.ListDtype(ring_elements.dtype),
size=len(ring_offsets) - 1,
children=(ring_offsets, ring_elements),
)
parts_col = ListColumn(
data=None,
dtype=cudf.ListDtype(rings_col.dtype),
size=len(part_offsets) - 1,
children=(part_offsets, rings_col),
)
polygons_col = ListColumn(
data=None,
dtype=cudf.ListDtype(parts_col.dtype),
size=len(geometry_offsets) - 1,
children=(geometry_offsets, parts_col),
Expand Down Expand Up @@ -369,5 +375,8 @@ def _xy_as_variable_sized_list(xy: ColumnBase):
num_points = len(xy) // 2
indices = as_column(range(0, num_points * 2 + 1, 2), dtype="int32")
return ListColumn(
dtype=cudf.ListDtype(xy.dtype), size=num_points, children=(indices, xy)
data=None,
dtype=cudf.ListDtype(xy.dtype),
size=num_points,
children=(indices, xy),
)
2 changes: 2 additions & 0 deletions python/cuspatial/cuspatial/core/binops/intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def pairwise_linestring_intersection(
# Organize the look back ids into list column
(lhs_linestring_id, lhs_segment_id, rhs_linestring_id, rhs_segment_id,) = [
ListColumn(
data=None,
dtype=cudf.ListDtype(id_.dtype),
size=len(geometry_collection_offset) - 1,
children=(geometry_collection_offset, id_),
Expand All @@ -94,6 +95,7 @@ def pairwise_linestring_intersection(
]

linestring_column = ListColumn(
data=None,
dtype=cudf.ListDtype(segments.dtype),
size=segments.size,
children=(
Expand Down
Loading