diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index c068f8e53..d76ce1561 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,6 +12,7 @@ concurrency: jobs: pr-builder: needs: + - check-nightly-ci - changed-files - checks - conda-cpp-build @@ -32,6 +33,18 @@ jobs: if: always() with: needs: ${{ toJSON(needs) }} + check-nightly-ci: + # Switch to ubuntu-latest once it defaults to a version of Ubuntu that + # provides at least Python 3.11 (see + # https://docs.python.org/3/library/datetime.html#datetime.date.fromisoformat) + runs-on: ubuntu-24.04 + env: + RAPIDS_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Check if nightly CI is passing + uses: rapidsai/shared-actions/check_nightly_success/dispatch@main + with: + repo: cuspatial changed-files: secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-25.02 diff --git a/conda/environments/all_cuda-118_arch-x86_64.yaml b/conda/environments/all_cuda-118_arch-x86_64.yaml index 09f2192d5..b07bc4f93 100644 --- a/conda/environments/all_cuda-118_arch-x86_64.yaml +++ b/conda/environments/all_cuda-118_arch-x86_64.yaml @@ -46,7 +46,7 @@ dependencies: - scikit-build-core>=0.10.0 - scikit-image - shapely -- sphinx<6 +- sphinx - sqlite - sysroot_linux-64==2.17 name: all_cuda-118_arch-x86_64 diff --git a/conda/environments/all_cuda-125_arch-x86_64.yaml b/conda/environments/all_cuda-125_arch-x86_64.yaml index 8013e9f45..a9cd79d98 100644 --- a/conda/environments/all_cuda-125_arch-x86_64.yaml +++ b/conda/environments/all_cuda-125_arch-x86_64.yaml @@ -48,7 +48,7 @@ dependencies: - scikit-build-core>=0.10.0 - scikit-image - shapely -- sphinx<6 +- sphinx - sqlite - sysroot_linux-64==2.17 name: all_cuda-125_arch-x86_64 diff --git a/cpp/cmake/Modules/ConfigureCUDA.cmake b/cpp/cmake/Modules/ConfigureCUDA.cmake index f6d16bb09..6fc9e8372 100644 --- a/cpp/cmake/Modules/ConfigureCUDA.cmake +++ b/cpp/cmake/Modules/ConfigureCUDA.cmake @@ -22,7 +22,7 @@ if(CMAKE_COMPILER_IS_GNUCXX) endif() endif(CMAKE_COMPILER_IS_GNUCXX) -list(APPEND CUSPATIAL_CUDA_FLAGS --expt-extended-lambda) +list(APPEND CUSPATIAL_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr) # set warnings as errors if(CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 11.2.0) diff --git a/dependencies.yaml b/dependencies.yaml index f3e50ffb7..4da9eba77 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -353,7 +353,7 @@ dependencies: - numpydoc # https://github.com/pydata/pydata-sphinx-theme/issues/1539 - pydata-sphinx-theme!=0.14.2 - - sphinx<6 + - sphinx notebooks: common: - output_types: [conda, requirements, pyproject] diff --git a/python/cuspatial/cuspatial/_lib/distance.pyx b/python/cuspatial/cuspatial/_lib/distance.pyx index 0295dce92..4864970cc 100644 --- a/python/cuspatial/cuspatial/_lib/distance.pyx +++ b/python/cuspatial/cuspatial/_lib/distance.pyx @@ -4,7 +4,7 @@ from libcpp.memory cimport make_shared, shared_ptr, unique_ptr from libcpp.utility cimport move, pair from cudf._lib.column cimport Column -from cudf._lib.utils cimport columns_from_table_view +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column cimport column from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table_view cimport table_view @@ -60,12 +60,16 @@ def directed_hausdorff_distance( ) ) - owner = Column.from_unique_ptr(move(result.first), data_ptr_exposed=True) - - return columns_from_table_view( - result.second, - owners=[owner] * result.second.num_columns() + owner_col = Column.from_unique_ptr( + move(result.first), data_ptr_exposed=True + ) + cdef plc_Table plc_owner_table = plc_Table( + [owner_col.to_pylibcudf(mode="read")] * result.second.num_columns() + ) + cdef plc_Table plc_result_table = plc_Table.from_table_view( + result.second, plc_owner_table ) + return [Column.from_pylibcudf(col) for col in plc_result_table.columns()] def pairwise_point_distance( diff --git a/python/cuspatial/cuspatial/_lib/linestring_bounding_boxes.pyx b/python/cuspatial/cuspatial/_lib/linestring_bounding_boxes.pyx index 0badef0d4..9f773f4d7 100644 --- a/python/cuspatial/cuspatial/_lib/linestring_bounding_boxes.pyx +++ b/python/cuspatial/cuspatial/_lib/linestring_bounding_boxes.pyx @@ -4,7 +4,7 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.utils cimport columns_from_unique_ptr +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table cimport table @@ -24,4 +24,8 @@ cpdef linestring_bounding_boxes(Column poly_offsets, result = move(cpp_linestring_bounding_boxes( c_poly_offsets, c_x, c_y, R )) - return columns_from_unique_ptr(move(result)) + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result)) + return [ + Column.from_pylibcudf(col) + for col in plc_table.columns() + ] diff --git a/python/cuspatial/cuspatial/_lib/points_in_range.pyx b/python/cuspatial/cuspatial/_lib/points_in_range.pyx index 833dfbcfa..e8ffbddb3 100644 --- a/python/cuspatial/cuspatial/_lib/points_in_range.pyx +++ b/python/cuspatial/cuspatial/_lib/points_in_range.pyx @@ -4,7 +4,7 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.utils cimport data_from_unique_ptr +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table cimport table @@ -38,4 +38,11 @@ cpdef points_in_range( ) ) - return data_from_unique_ptr(move(c_result), column_names=["x", "y"]) + cdef plc_Table plc_table = plc_Table.from_libcudf(move(c_result)) + return ( + { + name: Column.from_pylibcudf(col) + for name, col in zip(["x", "y"], plc_table.columns()) + }, + None + ) diff --git a/python/cuspatial/cuspatial/_lib/polygon_bounding_boxes.pyx b/python/cuspatial/cuspatial/_lib/polygon_bounding_boxes.pyx index bd01a08f5..38b42cc0f 100644 --- a/python/cuspatial/cuspatial/_lib/polygon_bounding_boxes.pyx +++ b/python/cuspatial/cuspatial/_lib/polygon_bounding_boxes.pyx @@ -4,7 +4,7 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.utils cimport columns_from_unique_ptr +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table cimport table @@ -25,4 +25,8 @@ cpdef polygon_bounding_boxes(Column poly_offsets, result = move(cpp_polygon_bounding_boxes( c_poly_offsets, c_ring_offsets, c_x, c_y )) - return columns_from_unique_ptr(move(result)) + cdef plc_Table table_result = plc_Table.from_libcudf(move(result)) + return [ + Column.from_pylibcudf(col) + for col in table_result.columns() + ] diff --git a/python/cuspatial/cuspatial/_lib/quadtree.pyx b/python/cuspatial/cuspatial/_lib/quadtree.pyx index 4f1a8395b..e43d25320 100644 --- a/python/cuspatial/cuspatial/_lib/quadtree.pyx +++ b/python/cuspatial/cuspatial/_lib/quadtree.pyx @@ -6,7 +6,7 @@ from libcpp.pair cimport pair from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.utils cimport data_from_unique_ptr +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column cimport column from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table cimport table @@ -30,16 +30,21 @@ cpdef quadtree_on_points(Column x, Column y, result = move(cpp_quadtree_on_points( c_x, c_y, x_min, x_max, y_min, y_max, scale, max_depth, min_size )) + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result.second)) + result_names = [ + "key", + "level", + "is_internal_node", + "length", + "offset" + ] return ( Column.from_unique_ptr(move(result.first)), - data_from_unique_ptr( - move(result.second), - column_names=[ - "key", - "level", - "is_internal_node", - "length", - "offset" - ] + ( + { + name: Column.from_pylibcudf(col) + for name, col in zip(result_names, plc_table.columns()) + }, + None ) ) diff --git a/python/cuspatial/cuspatial/_lib/spatial_join.pyx b/python/cuspatial/cuspatial/_lib/spatial_join.pyx index 04e62eff9..e54adca0c 100644 --- a/python/cuspatial/cuspatial/_lib/spatial_join.pyx +++ b/python/cuspatial/cuspatial/_lib/spatial_join.pyx @@ -5,7 +5,7 @@ from libcpp.memory cimport unique_ptr from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.utils cimport data_from_unique_ptr, table_view_from_table +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table cimport table, table_view @@ -24,10 +24,14 @@ cpdef join_quadtree_and_bounding_boxes(object quadtree, double y_max, double scale, int8_t max_depth): - cdef table_view c_quadtree = table_view_from_table( - quadtree, ignore_index=True) - cdef table_view c_bounding_boxes = table_view_from_table( - bounding_boxes, ignore_index=True) + cdef plc_Table plc_quadtree = plc_Table( + [col.to_pylibcudf(mode="read") for col in quadtree._columns] + ) + cdef table_view c_quadtree = plc_quadtree.view() + cdef plc_Table plc_bounding_boxes = plc_Table( + [col.to_pylibcudf(mode="read") for col in bounding_boxes._columns] + ) + cdef table_view c_bounding_boxes = plc_bounding_boxes.view() cdef unique_ptr[table] result with nogil: result = move(cpp_join_quadtree_and_bounding_boxes( @@ -35,9 +39,15 @@ cpdef join_quadtree_and_bounding_boxes(object quadtree, c_bounding_boxes, x_min, x_max, y_min, y_max, scale, max_depth )) - return data_from_unique_ptr( - move(result), - column_names=["bbox_offset", "quad_offset"] + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result)) + return ( + { + name: Column.from_pylibcudf(col) + for name, col in zip( + ["bbox_offset", "quad_offset"], plc_table.columns() + ) + }, + None ) @@ -50,10 +60,14 @@ cpdef quadtree_point_in_polygon(object poly_quad_pairs, Column ring_offsets, Column poly_points_x, Column poly_points_y): - cdef table_view c_poly_quad_pairs = table_view_from_table( - poly_quad_pairs, ignore_index=True) - cdef table_view c_quadtree = table_view_from_table( - quadtree, ignore_index=True) + cdef plc_Table plc_poly_quad_pairs = plc_Table( + [col.to_pylibcudf(mode="read") for col in poly_quad_pairs._columns] + ) + cdef table_view c_poly_quad_pairs = plc_poly_quad_pairs.view() + cdef plc_Table plc_quadtree = plc_Table( + [col.to_pylibcudf(mode="read") for col in quadtree._columns] + ) + cdef table_view c_quadtree = plc_quadtree.view() cdef column_view c_point_indices = point_indices.view() cdef column_view c_points_x = points_x.view() cdef column_view c_points_y = points_y.view() @@ -74,9 +88,15 @@ cpdef quadtree_point_in_polygon(object poly_quad_pairs, c_poly_points_x, c_poly_points_y )) - return data_from_unique_ptr( - move(result), - column_names=["polygon_index", "point_index"] + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result)) + return ( + { + name: Column.from_pylibcudf(col) + for name, col in zip( + ["polygon_index", "point_index"], plc_table.columns() + ) + }, + None ) @@ -88,10 +108,17 @@ cpdef quadtree_point_to_nearest_linestring(object linestring_quad_pairs, Column linestring_offsets, Column linestring_points_x, Column linestring_points_y): - cdef table_view c_linestring_quad_pairs = table_view_from_table( - linestring_quad_pairs, ignore_index=True) - cdef table_view c_quadtree = table_view_from_table( - quadtree, ignore_index=True) + cdef plc_Table plc_quad_pairs = plc_Table( + [ + col.to_pylibcudf(mode="read") + for col in linestring_quad_pairs._columns + ] + ) + cdef table_view c_linestring_quad_pairs = plc_quad_pairs.view() + cdef plc_Table plc_quadtree = plc_Table( + [col.to_pylibcudf(mode="read") for col in quadtree._columns] + ) + cdef table_view c_quadtree = plc_quadtree.view() cdef column_view c_point_indices = point_indices.view() cdef column_view c_points_x = points_x.view() cdef column_view c_points_y = points_y.view() @@ -110,7 +137,14 @@ cpdef quadtree_point_to_nearest_linestring(object linestring_quad_pairs, c_linestring_points_x, c_linestring_points_y )) - return data_from_unique_ptr( - move(result), - column_names=["point_index", "linestring_index", "distance"] + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result)) + return ( + { + name: Column.from_pylibcudf(col) + for name, col in zip( + ["point_index", "linestring_index", "distance"], + plc_table.columns() + ) + }, + None ) diff --git a/python/cuspatial/cuspatial/_lib/trajectory.pyx b/python/cuspatial/cuspatial/_lib/trajectory.pyx index 8c183f5f4..dc92a508b 100644 --- a/python/cuspatial/cuspatial/_lib/trajectory.pyx +++ b/python/cuspatial/cuspatial/_lib/trajectory.pyx @@ -5,7 +5,7 @@ from libcpp.pair cimport pair from libcpp.utility cimport move from cudf._lib.column cimport Column -from cudf._lib.utils cimport data_from_unique_ptr +from pylibcudf cimport Table as plc_Table from pylibcudf.libcudf.column.column cimport column from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.table.table cimport table @@ -27,10 +27,17 @@ cpdef derive_trajectories(Column object_id, Column x, cdef pair[unique_ptr[table], unique_ptr[column]] result with nogil: result = move(cpp_derive_trajectories(c_id, c_x, c_y, c_ts)) - return data_from_unique_ptr( - move(result.first), - column_names=["object_id", "x", "y", "timestamp"] - ), Column.from_unique_ptr(move(result.second)) + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result.first)) + first_result = ( + { + name: Column.from_pylibcudf(col) + for name, col in zip( + ["object_id", "x", "y", "timestamp"], plc_table.columns() + ) + }, + None + ) + return first_result, Column.from_unique_ptr(move(result.second)) cpdef trajectory_bounding_boxes(size_type num_trajectories, @@ -43,9 +50,15 @@ cpdef trajectory_bounding_boxes(size_type num_trajectories, result = move(cpp_trajectory_bounding_boxes( num_trajectories, c_id, c_x, c_y )) - return data_from_unique_ptr( - move(result), - column_names=["x_min", "y_min", "x_max", "y_max"] + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result)) + return ( + { + name: Column.from_pylibcudf(col) + for name, col in zip( + ["x_min", "y_min", "x_max", "y_max"], plc_table.columns() + ) + }, + None ) @@ -61,7 +74,11 @@ cpdef trajectory_distances_and_speeds(size_type num_trajectories, result = move(cpp_trajectory_distances_and_speeds( num_trajectories, c_id, c_x, c_y, c_ts )) - return data_from_unique_ptr( - move(result), - column_names=["distance", "speed"] + cdef plc_Table plc_table = plc_Table.from_libcudf(move(result)) + return ( + { + name: Column.from_pylibcudf(col) + for name, col in zip(["distance", "speed"], plc_table.columns()) + }, + None )