From 592a49ec287d16f1eb410bd62fb33934abbcc847 Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Thu, 2 Feb 2023 13:21:24 -0600 Subject: [PATCH 1/3] Add null counts for certain cudf related printing tasks. --- .../cuspatial/cuspatial/core/_column/geocolumn.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/cuspatial/cuspatial/core/_column/geocolumn.py b/python/cuspatial/cuspatial/core/_column/geocolumn.py index a3b87d271..763b459c7 100644 --- a/python/cuspatial/cuspatial/core/_column/geocolumn.py +++ b/python/cuspatial/cuspatial/core/_column/geocolumn.py @@ -179,6 +179,20 @@ def copy(self, deep=True): ) return result + @property + def valid_count(self) -> int: + """ + Returns the number of valid geometries stored in this GeoColumn. + """ + return self._meta.input_types.valid_count + + def has_nulls(self) -> bool: + """ + Returns True if any of the geometries stored in this GeoColumn are + null. + """ + return self._meta.input_types.has_nulls + @classmethod def _from_points_xy(cls, points_xy: ColumnBase): """ From a3e9f77bbf34e0a1e2a967524cc6665be1df8bf9 Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Fri, 3 Feb 2023 12:01:18 -0600 Subject: [PATCH 2/3] Improve docs slightly. --- python/cuspatial/cuspatial/core/_column/geocolumn.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/cuspatial/cuspatial/core/_column/geocolumn.py b/python/cuspatial/cuspatial/core/_column/geocolumn.py index 763b459c7..1fc411d07 100644 --- a/python/cuspatial/cuspatial/core/_column/geocolumn.py +++ b/python/cuspatial/cuspatial/core/_column/geocolumn.py @@ -183,6 +183,9 @@ def copy(self, deep=True): 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 + provided as a cudf shim layer. """ return self._meta.input_types.valid_count @@ -190,6 +193,8 @@ 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. """ return self._meta.input_types.has_nulls From 9c97f2fd49e01d09eab618f5af6ec565e2f766e9 Mon Sep 17 00:00:00 2001 From: "H. Thomson Comer" Date: Wed, 8 Feb 2023 12:09:32 -0600 Subject: [PATCH 3/3] Made the docs better. --- python/cuspatial/cuspatial/core/_column/geocolumn.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/python/cuspatial/cuspatial/core/_column/geocolumn.py b/python/cuspatial/cuspatial/core/_column/geocolumn.py index 1fc411d07..56e553f8e 100644 --- a/python/cuspatial/cuspatial/core/_column/geocolumn.py +++ b/python/cuspatial/cuspatial/core/_column/geocolumn.py @@ -182,19 +182,15 @@ def copy(self, deep=True): @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 - provided as a cudf shim layer. + Arrow's UnionArray does not support nulls, so this is always + equal to the length of the GeoColumn. """ return self._meta.input_types.valid_count 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. + Arrow's UnionArray does not support nulls, so this is always + False. """ return self._meta.input_types.has_nulls