diff --git a/python/cudf/cudf/_lib/pylibcudf/copying.pxd b/python/cudf/cudf/_lib/pylibcudf/copying.pxd index 986fb54df7c..756d25bcaba 100644 --- a/python/cudf/cudf/_lib/pylibcudf/copying.pxd +++ b/python/cudf/cudf/_lib/pylibcudf/copying.pxd @@ -16,8 +16,6 @@ cpdef Table gather( out_of_bounds_policy bounds_policy ) -cpdef Column shift(Column input, size_type offset, Scalar fill_values) - cpdef Table table_scatter(Table source, Column scatter_map, Table target_table) cpdef Table scalar_scatter(list source, Column scatter_map, Table target_table) @@ -28,12 +26,6 @@ cpdef object table_empty_like(Table input) cpdef Column allocate_like(Column input_column, mask_allocation_policy policy, size=*) -cpdef Column copy_if_else(object lhs, object rhs, Column boolean_mask) - -cpdef Table table_boolean_mask_scatter(Table input, Table target, Column boolean_mask) - -cpdef Table scalar_boolean_mask_scatter(list input, Table target, Column boolean_mask) - cpdef Column copy_range( Column input_column, Column target_column, @@ -41,3 +33,11 @@ cpdef Column copy_range( size_type input_end, size_type target_begin, ) + +cpdef Column shift(Column input, size_type offset, Scalar fill_values) + +cpdef Column copy_if_else(object lhs, object rhs, Column boolean_mask) + +cpdef Table table_boolean_mask_scatter(Table input, Table target, Column boolean_mask) + +cpdef Table scalar_boolean_mask_scatter(list input, Table target, Column boolean_mask) diff --git a/python/cudf/cudf/_lib/pylibcudf/copying.pyx b/python/cudf/cudf/_lib/pylibcudf/copying.pyx index 0ef53855a07..4ea5be349be 100644 --- a/python/cudf/cudf/_lib/pylibcudf/copying.pyx +++ b/python/cudf/cudf/_lib/pylibcudf/copying.pyx @@ -85,19 +85,6 @@ cpdef Table gather( return Table.from_libcudf(move(c_result)) -cpdef Column shift(Column input, size_type offset, Scalar fill_values): - cdef unique_ptr[column] c_result - with nogil: - c_result = move( - cpp_copying.shift( - input.view(), - offset, - dereference(fill_values.c_obj) - ) - ) - return Column.from_libcudf(move(c_result)) - - cpdef Table table_scatter(Table source, Column scatter_map, Table target_table): cdef unique_ptr[table] c_result @@ -171,6 +158,40 @@ cpdef Column allocate_like( return Column.from_libcudf(move(c_result)) +cpdef Column copy_range( + Column input_column, + Column target_column, + size_type input_begin, + size_type input_end, + size_type target_begin, +): + cdef unique_ptr[column] c_result + + with nogil: + c_result = move(cpp_copying.copy_range( + input_column.view(), + target_column.view(), + input_begin, + input_end, + target_begin) + ) + + return Column.from_libcudf(move(c_result)) + + +cpdef Column shift(Column input, size_type offset, Scalar fill_values): + cdef unique_ptr[column] c_result + with nogil: + c_result = move( + cpp_copying.shift( + input.view(), + offset, + dereference(fill_values.c_obj) + ) + ) + return Column.from_libcudf(move(c_result)) + + cpdef Column copy_if_else(object lhs, object rhs, Column boolean_mask): cdef unique_ptr[column] result @@ -246,24 +267,3 @@ cpdef Table scalar_boolean_mask_scatter(list input, Table target, Column boolean ) return Table.from_libcudf(move(result)) - - -cpdef Column copy_range( - Column input_column, - Column target_column, - size_type input_begin, - size_type input_end, - size_type target_begin, -): - cdef unique_ptr[column] c_result - - with nogil: - c_result = move(cpp_copying.copy_range( - input_column.view(), - target_column.view(), - input_begin, - input_end, - target_begin) - ) - - return Column.from_libcudf(move(c_result))