Skip to content

Commit

Permalink
[DOC] Update Pylibcudf doc strings (#16810)
Browse files Browse the repository at this point in the history
This PR is a first pass at #15937. We will close #15937 after #15162 is closed

Authors:
  - Matthew Murray (https://github.com/Matt711)

Approvers:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #16810
  • Loading branch information
Matt711 committed Sep 25, 2024
1 parent 2083d87 commit c96eb2f
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/pylibcudf/pylibcudf/binaryop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cpdef bool is_supported_operation(
):
"""Check if an operation is supported for the given data types.
For details, see :cpp:func::is_supported_operation`.
For details, see :cpp:func::`is_supported_operation`.
Parameters
----------
Expand Down
18 changes: 18 additions & 0 deletions python/pylibcudf/pylibcudf/column_factories.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ from .types import MaskState, TypeId


cpdef Column make_empty_column(MakeEmptyColumnOperand type_or_id):
"""Creates an empty column of the specified type.
For details, see :cpp:func::`make_empty_column`.
Parameters
----------
type_or_id : Union[DataType, type_id, object]
The column data type.
Returns
-------
Column
An empty Column
"""
cdef unique_ptr[column] result
cdef type_id id

Expand Down Expand Up @@ -60,7 +74,11 @@ cpdef Column make_numeric_column(
size_type size,
MaskArg mstate
):
"""Creates an empty numeric column.
For details, see :cpp:func::`make_numeric_column`.
"""
cdef unique_ptr[column] result
cdef mask_state state

Expand Down
2 changes: 1 addition & 1 deletion python/pylibcudf/pylibcudf/groupby.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ cdef class GroupBy:
Returns
-------
Tuple[List[int], Table, Table]]
Tuple[List[int], Table, Table]
A tuple of tables containing three items:
- A list of integer offsets into the group keys/values
- A table of group keys
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/io/avro.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ cpdef TableWithMetadata read_avro(
"""
Reads an Avro dataset into a :py:class:`~.types.TableWithMetadata`.
For details, see :cpp:func:`read_avro`.
Parameters
----------
source_info: SourceInfo
Expand Down
4 changes: 4 additions & 0 deletions python/pylibcudf/pylibcudf/io/parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ cdef class ChunkedParquetReader:
"""
Reads chunks of a Parquet file into a :py:class:`~.types.TableWithMetadata`.
For details, see :cpp:class:`chunked_parquet_reader`.
Parameters
----------
source_info : SourceInfo
Expand Down Expand Up @@ -167,6 +169,8 @@ cpdef read_parquet(
):
"""Reads an Parquet file into a :py:class:`~.types.TableWithMetadata`.
For details, see :cpp:func:`read_parquet`.
Parameters
----------
source_info : SourceInfo
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/labeling.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ cpdef Column label_bins(
):
"""Labels elements based on membership in the specified bins.
For details see :cpp:func:`label_bins`.
Parameters
----------
input : Column
Expand Down
12 changes: 12 additions & 0 deletions python/pylibcudf/pylibcudf/lists.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ cpdef Table explode_outer(Table input, size_type explode_column_idx):
All other columns will be duplicated for each element in the list.
For details, see :cpp:func:`explode_outer`.
Parameters
----------
input : Table
Expand All @@ -75,6 +77,8 @@ cpdef Table explode_outer(Table input, size_type explode_column_idx):
cpdef Column concatenate_rows(Table input):
"""Concatenate multiple lists columns into a single lists column row-wise.
For details, see :cpp:func:`concatenate_list_elements`.
Parameters
----------
input : Table
Expand All @@ -96,6 +100,8 @@ cpdef Column concatenate_rows(Table input):
cpdef Column concatenate_list_elements(Column input, bool dropna):
"""Concatenate multiple lists on the same row into a single list.
For details, see :cpp:func:`concatenate_list_elements`.
Parameters
----------
input : Column
Expand Down Expand Up @@ -168,6 +174,8 @@ cpdef Column contains_nulls(Column input):
"""Create a column of bool values indicating whether
each row in the lists column contains a null value.
For details, see :cpp:func:`contains_nulls`.
Parameters
----------
input : Column
Expand Down Expand Up @@ -290,6 +298,8 @@ cpdef Column segmented_gather(Column input, Column gather_map_list):
cpdef Column extract_list_element(Column input, ColumnOrSizeType index):
"""Create a column of extracted list elements.
For details, see :cpp:func:`extract_list_element`.
Parameters
----------
input : Column
Expand Down Expand Up @@ -318,6 +328,8 @@ cpdef Column count_elements(Column input):
list element in the given lists column.
For details, see :cpp:func:`count_elements`.
For details, see :cpp:func:`count_elements`.
Parameters
----------
input : Column
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/merge.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ cpdef Table merge (
):
"""Merge a set of sorted tables.
For details see :cpp:func:`merge`.
Parameters
----------
tables_to_merge : list
Expand Down
4 changes: 4 additions & 0 deletions python/pylibcudf/pylibcudf/quantiles.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ cpdef Column quantile(
Computes the specified quantiles by interpolating values between which they lie,
using the interpolation strategy specified in interp.
For details see :cpp:func:`quantile`.
Parameters
----------
input: Column
Expand Down Expand Up @@ -91,6 +93,8 @@ cpdef Table quantiles(
specified quantiles. In the event a quantile lies in between rows, the specified
interpolation strategy is used to pick between the rows.
For details see :cpp:func:`quantiles`.
Parameters
----------
input: Table
Expand Down
4 changes: 4 additions & 0 deletions python/pylibcudf/pylibcudf/reshape.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ cpdef Column interleave_columns(Table source_table):
in = [[A1, A2, A3], [B1, B2, B3]]
return = [A1, B1, A2, B2, A3, B3]
For details, see :cpp:func:`interleave_columns`.
Parameters
----------
source_table: Table
Expand All @@ -44,6 +46,8 @@ cpdef Column interleave_columns(Table source_table):
cpdef Table tile(Table source_table, size_type count):
"""Repeats the rows from input table count times to form a new table.
For details, see :cpp:func:`tile`.
Parameters
----------
source_table: Table
Expand Down
6 changes: 6 additions & 0 deletions python/pylibcudf/pylibcudf/search.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ cpdef Column lower_bound(
):
"""Find smallest indices in haystack where needles may be inserted to retain order.
For details, see :cpp:func:`lower_bound`.
Parameters
----------
haystack : Table
Expand Down Expand Up @@ -58,6 +60,8 @@ cpdef Column upper_bound(
):
"""Find largest indices in haystack where needles may be inserted to retain order.
For details, see :cpp:func:`upper_bound`.
Parameters
----------
haystack : Table
Expand Down Expand Up @@ -92,6 +96,8 @@ cpdef Column upper_bound(
cpdef Column contains(Column haystack, Column needles):
"""Check whether needles are present in haystack.
For details, see :cpp:func:`contains`.
Parameters
----------
haystack : Table
Expand Down
20 changes: 20 additions & 0 deletions python/pylibcudf/pylibcudf/sorting.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ from .table cimport Table
cpdef Column sorted_order(Table source_table, list column_order, list null_precedence):
"""Computes the row indices required to sort the table.
For details, see :cpp:func:`sorted_order`.
Parameters
----------
source_table : Table
Expand Down Expand Up @@ -52,6 +54,8 @@ cpdef Column stable_sorted_order(
"""Computes the row indices required to sort the table,
preserving order of equal elements.
For details, see :cpp:func:`stable_sorted_order`.
Parameters
----------
source_table : Table
Expand Down Expand Up @@ -90,6 +94,8 @@ cpdef Column rank(
):
"""Computes the rank of each element in the column.
For details, see :cpp:func:`rank`.
Parameters
----------
input_view : Column
Expand Down Expand Up @@ -128,6 +134,8 @@ cpdef Column rank(
cpdef bool is_sorted(Table tbl, list column_order, list null_precedence):
"""Checks if the table is sorted.
For details, see :cpp:func:`is_sorted`.
Parameters
----------
tbl : Table
Expand Down Expand Up @@ -165,6 +173,8 @@ cpdef Table segmented_sort_by_key(
):
"""Sorts the table by key, within segments.
For details, see :cpp:func:`segmented_sort_by_key`.
Parameters
----------
values : Table
Expand Down Expand Up @@ -209,6 +219,8 @@ cpdef Table stable_segmented_sort_by_key(
"""Sorts the table by key preserving order of equal elements,
within segments.
For details, see :cpp:func:`stable_segmented_sort_by_key`.
Parameters
----------
values : Table
Expand Down Expand Up @@ -251,6 +263,8 @@ cpdef Table sort_by_key(
):
"""Sorts the table by key.
For details, see :cpp:func:`sort_by_key`.
Parameters
----------
values : Table
Expand Down Expand Up @@ -290,6 +304,8 @@ cpdef Table stable_sort_by_key(
):
"""Sorts the table by key preserving order of equal elements.
For details, see :cpp:func:`stable_sort_by_key`.
Parameters
----------
values : Table
Expand Down Expand Up @@ -324,6 +340,8 @@ cpdef Table stable_sort_by_key(
cpdef Table sort(Table source_table, list column_order, list null_precedence):
"""Sorts the table.
For details, see :cpp:func:`sort`.
Parameters
----------
source_table : Table
Expand Down Expand Up @@ -355,6 +373,8 @@ cpdef Table sort(Table source_table, list column_order, list null_precedence):
cpdef Table stable_sort(Table source_table, list column_order, list null_precedence):
"""Sorts the table preserving order of equal elements.
For details, see :cpp:func:`stable_sort`.
Parameters
----------
source_table : Table
Expand Down
18 changes: 18 additions & 0 deletions python/pylibcudf/pylibcudf/stream_compaction.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ from .table cimport Table
cpdef Table drop_nulls(Table source_table, list keys, size_type keep_threshold):
"""Filters out rows from the input table based on the presence of nulls.
For details, see :cpp:func:`drop_nulls`.
Parameters
----------
source_table : Table
Expand Down Expand Up @@ -53,6 +55,8 @@ cpdef Table drop_nulls(Table source_table, list keys, size_type keep_threshold):
cpdef Table drop_nans(Table source_table, list keys, size_type keep_threshold):
"""Filters out rows from the input table based on the presence of NaNs.
For details, see :cpp:func:`drop_nans`.
Parameters
----------
source_table : Table
Expand Down Expand Up @@ -81,6 +85,8 @@ cpdef Table drop_nans(Table source_table, list keys, size_type keep_threshold):
cpdef Table apply_boolean_mask(Table source_table, Column boolean_mask):
"""Filters out rows from the input table based on a boolean mask.
For details, see :cpp:func:`apply_boolean_mask`.
Parameters
----------
source_table : Table
Expand Down Expand Up @@ -111,6 +117,8 @@ cpdef Table unique(
):
"""Filter duplicate consecutive rows from the input table.
For details, see :cpp:func:`unique`.
Parameters
----------
input : Table
Expand Down Expand Up @@ -153,6 +161,8 @@ cpdef Table distinct(
):
"""Get the distinct rows from the input table.
For details, see :cpp:func:`distinct`.
Parameters
----------
input : Table
Expand Down Expand Up @@ -191,6 +201,8 @@ cpdef Column distinct_indices(
):
"""Get the indices of the distinct rows from the input table.
For details, see :cpp:func:`distinct_indices`.
Parameters
----------
input : Table
Expand Down Expand Up @@ -226,6 +238,8 @@ cpdef Table stable_distinct(
):
"""Get the distinct rows from the input table, preserving input order.
For details, see :cpp:func:`stable_distinct`.
Parameters
----------
input : Table
Expand Down Expand Up @@ -263,6 +277,8 @@ cpdef size_type unique_count(
):
"""Returns the number of unique consecutive elements in the input column.
For details, see :cpp:func:`unique_count`.
Parameters
----------
source : Column
Expand Down Expand Up @@ -294,6 +310,8 @@ cpdef size_type distinct_count(
):
"""Returns the number of distinct elements in the input column.
For details, see :cpp:func:`distinct_count`.
Parameters
----------
source : Column
Expand Down
2 changes: 1 addition & 1 deletion python/pylibcudf/pylibcudf/strings/findall.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ cpdef Column findall(Column input, RegexProgram pattern):
Returns a lists column of strings for each matching occurrence using
the regex_program pattern within each string.
For details, see For details, see :cpp:func:`cudf::strings::findall`.
For details, see :cpp:func:`cudf::strings::findall`.
Parameters
----------
Expand Down
Loading

0 comments on commit c96eb2f

Please sign in to comment.