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 valid_count and has_nulls to GeoColumn #894

Merged
Merged
Changes from 2 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
19 changes: 19 additions & 0 deletions python/cuspatial/cuspatial/core/_column/geocolumn.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,25 @@ def copy(self, deep=True):
)
return result

@property
def valid_count(self) -> int:
"""
Returns the number of valid geometries stored in this GeoColumn.
Null support is implemented in GeoSeries and this is not expected
to ever return less than the length of the GeoColumn. This is
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to document this expectation in this way? Might cause a user to make assumptions or rely on this expectation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I modified the docs, take another look?

provided as a cudf shim layer.
"""
return self._meta.input_types.valid_count
isVoid marked this conversation as resolved.
Show resolved Hide resolved

def has_nulls(self) -> bool:
"""
Returns True if any of the geometries stored in this GeoColumn are
null.
Null support is implemented in GeoSEries and this is not expected
to ever return True, but is provided as a cudf shim layer.
thomcom marked this conversation as resolved.
Show resolved Hide resolved
"""
return self._meta.input_types.has_nulls

@classmethod
def _from_points_xy(cls, points_xy: ColumnBase):
"""
Expand Down