Skip to content

Commit

Permalink
Add __all__ to all pylibcudf modules
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Nov 7, 2024
1 parent bd9f6f8 commit 1801379
Show file tree
Hide file tree
Showing 91 changed files with 410 additions and 2 deletions.
34 changes: 34 additions & 0 deletions python/pylibcudf/pylibcudf/aggregation.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,40 @@ from pylibcudf.libcudf.aggregation import udf_type as UdfType # no-cython-lint
from .types cimport DataType


__all__ = [
"Aggregation",
"CorrelationType",
"EWMHistory",
"Kind",
"RankMethod",
"RankPercentage",
"UdfType",
"all",
"any",
"argmax",
"argmin",
"collect_list",
"collect_set",
"correlation",
"count",
"covariance",
"ewma",
"max",
"mean",
"median",
"min",
"nth_element",
"nunique",
"product",
"quantile",
"rank",
"std",
"sum",
"sum_of_squares",
"udf",
"variance",
]

cdef class Aggregation:
"""A type of aggregation to perform.
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/binaryop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from .column cimport Column
from .scalar cimport Scalar
from .types cimport DataType

__all__ = ["BinaryOperator", "binary_operation", "is_supported_operation"]

cpdef Column binary_operation(
LeftBinaryOperand lhs,
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/column.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ from .utils cimport int_to_bitmask_ptr, int_to_void_ptr

import functools

__all__ = ["Column", "ListColumnView", "is_c_contiguous"]

cdef class Column:
"""A container of nullable device data as a column of elements.
Expand Down
9 changes: 9 additions & 0 deletions python/pylibcudf/pylibcudf/column_factories.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ from .types cimport DataType, type_id
from .types import MaskState, TypeId


__all__ = [
"make_duration_column",
"make_empty_column",
"make_fixed_point_column",
"make_fixed_width_column",
"make_numeric_column",
"make_timestamp_column",
]

cpdef Column make_empty_column(MakeEmptyColumnOperand type_or_id):
"""Creates an empty column of the specified type.
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/concatenate.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ from pylibcudf.libcudf.table.table_view cimport table_view
from .column cimport Column
from .table cimport Table

__all__ = ["concatenate"]

cpdef concatenate(list objects):
"""Concatenate columns or tables.
Expand Down
7 changes: 7 additions & 0 deletions python/pylibcudf/pylibcudf/contiguous_split.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ from .table cimport Table
from .utils cimport int_to_void_ptr


__all__ = [
"PackedColumns",
"pack",
"unpack",
"unpack_from_memoryviews",
]

cdef class HostBuffer:
"""Owning host buffer that implements the buffer protocol"""
cdef unique_ptr[vector[uint8_t]] c_obj
Expand Down
17 changes: 17 additions & 0 deletions python/pylibcudf/pylibcudf/copying.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ from .table cimport Table
from .utils cimport _as_vector


__all__ = [
"MaskAllocationPolicy",
"OutOfBoundsPolicy",
"allocate_like",
"boolean_mask_scatter",
"copy_if_else",
"copy_range",
"copy_range_in_place",
"empty_like",
"gather",
"get_element",
"scatter",
"shift",
"slice",
"split",
]

cpdef Table gather(
Table source_table,
Column gather_map,
Expand Down
18 changes: 18 additions & 0 deletions python/pylibcudf/pylibcudf/datetime.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,24 @@ from cython.operator cimport dereference

from .column cimport Column

__all__ = [
"DatetimeComponent",
"RoundingFrequency",
"add_calendrical_months",
"ceil_datetimes",
"day_of_year",
"days_in_month",
"extract_datetime_component",
"extract_microsecond_fraction",
"extract_millisecond_fraction",
"extract_nanosecond_fraction",
"extract_quarter",
"floor_datetimes",
"is_leap_year",
"last_day_of_month",
"round_datetimes",
]

cpdef Column extract_millisecond_fraction(
Column input
):
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/experimental.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ from libcpp.string cimport string
from pylibcudf.libcudf cimport experimental as cpp_experimental


__all__ = ["disable_prefetching", "enable_prefetching", "prefetch_debugging"]

cpdef enable_prefetching(str key):
"""Turn on prefetch instructions for the given key.
Expand Down
10 changes: 10 additions & 0 deletions python/pylibcudf/pylibcudf/expressions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ from .types cimport DataType
# Aliases for simplicity
ctypedef unique_ptr[libcudf_exp.expression] expression_ptr

__all__ = [
"ASTOperator",
"ColumnNameReference",
"ColumnReference",
"Expression",
"Literal",
"Operation",
"TableReference",
]

# Define this class just to have a docstring for it
cdef class Expression:
"""
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/filling.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ from .scalar cimport Scalar
from .table cimport Table


__all__ = ["fill", "fill_in_place", "repeat", "sequence"]

cpdef Column fill(
Column destination,
size_type begin,
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/gpumemoryview.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2023-2024, NVIDIA CORPORATION.

__all__ = ["gpumemoryview"]

cdef class gpumemoryview:
"""Minimal representation of a memory buffer.
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/groupby.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ from .types cimport null_order, null_policy, order, sorted
from .utils cimport _as_vector


__all__ = ["GroupBy", "GroupByRequest"]

cdef class GroupByRequest:
"""A request for a groupby aggregation or scan.
Expand Down
13 changes: 13 additions & 0 deletions python/pylibcudf/pylibcudf/hashing.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ from pylibcudf.libcudf.table.table cimport table
from .column cimport Column
from .table cimport Table

__all__ = [
"LIBCUDF_DEFAULT_HASH_SEED",
"md5",
"murmurhash3_x64_128",
"murmurhash3_x86_32",
"sha1",
"sha224",
"sha256",
"sha384",
"sha512",
"xxhash_64",
]

LIBCUDF_DEFAULT_HASH_SEED = DEFAULT_HASH_SEED

cpdef Column murmurhash3_x86_32(
Expand Down
8 changes: 8 additions & 0 deletions python/pylibcudf/pylibcudf/interop.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ from .scalar cimport Scalar
from .table cimport Table
from .types cimport DataType, type_id

__all__ = [
"ColumnMetadata",
"from_arrow",
"from_dlpack",
"to_arrow",
"to_dlpack",
]

ARROW_TO_PYLIBCUDF_TYPES = {
pa.int8(): type_id.INT8,
pa.int16(): type_id.INT16,
Expand Down
14 changes: 14 additions & 0 deletions python/pylibcudf/pylibcudf/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,17 @@

from . import avro, csv, datasource, json, orc, parquet, timezone, types
from .types import SinkInfo, SourceInfo, TableWithMetadata

__all__ = [
"SinkInfo",
"SourceInfo",
"TableWithMetadata",
"avro",
"csv",
"datasource",
"json",
"orc",
"parquet",
"timezone",
"types",
]
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/io/avro.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ from pylibcudf.libcudf.io.avro cimport (
)
from pylibcudf.libcudf.types cimport size_type

__all__ = ["read_avro"]


cpdef TableWithMetadata read_avro(
SourceInfo source_info,
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/io/csv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ from pylibcudf.libcudf.types cimport data_type, size_type
from pylibcudf.types cimport DataType


__all__ = ["read_csv"]

cdef tuple _process_parse_dates_hex(list cols):
cdef vector[string] str_cols
cdef vector[int] int_cols
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/io/datasource.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from pylibcudf.libcudf.io.datasource cimport datasource

__all__ = ["Datasource"]

cdef class Datasource:
cdef datasource* get_datasource(self) except * nogil:
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/io/json.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ from pylibcudf.libcudf.io.types cimport (
from pylibcudf.libcudf.types cimport data_type, size_type
from pylibcudf.types cimport DataType

__all__ = ["chunked_read_json", "read_json", "write_json"]

cdef map[string, schema_element] _generate_schema_map(list dtypes):
cdef map[string, schema_element] schema_map
Expand Down
6 changes: 6 additions & 0 deletions python/pylibcudf/pylibcudf/io/orc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ from pylibcudf.libcudf.types cimport size_type
from pylibcudf.types cimport DataType
from pylibcudf.variant cimport get_if, holds_alternative

__all__ = [
"OrcColumnStatistics",
"ParsedOrcStatistics",
"read_orc",
"read_parsed_orc_statistics",
]

cdef class OrcColumnStatistics:
def __init__(self):
Expand Down
2 changes: 2 additions & 0 deletions python/pylibcudf/pylibcudf/io/parquet.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ from pylibcudf.libcudf.io.parquet cimport (
from pylibcudf.libcudf.io.types cimport table_with_metadata
from pylibcudf.libcudf.types cimport size_type

__all__ = ["ChunkedParquetReader", "read_parquet"]


cdef parquet_reader_options _setup_parquet_reader_options(
SourceInfo source_info,
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/io/timezone.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ from pylibcudf.libcudf.table.table cimport table

from ..table cimport Table

__all__ = ["make_timezone_transition_table"]

cpdef Table make_timezone_transition_table(str tzif_dir, str timezone_name):
"""
Expand Down
11 changes: 11 additions & 0 deletions python/pylibcudf/pylibcudf/io/types.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ from pylibcudf.libcudf.io.types import (
statistics_freq as StatisticsFreq, # no-cython-lint
)

__all__ = [
"ColumnEncoding",
"CompressionType",
"DictionaryPolicy",
"JSONRecoveryMode",
"QuoteStyle",
"SinkInfo",
"SourceInfo",
"StatisticsFreq",
"TableWithMetadata",
]

cdef class TableWithMetadata:
"""A container holding a table and its associated metadata
Expand Down
18 changes: 18 additions & 0 deletions python/pylibcudf/pylibcudf/join.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,24 @@ from .column cimport Column
from .expressions cimport Expression
from .table cimport Table

__all__ = [
"conditional_full_join",
"conditional_inner_join",
"conditional_left_anti_join",
"conditional_left_join",
"conditional_left_semi_join",
"cross_join",
"full_join",
"inner_join",
"left_anti_join",
"left_join",
"left_semi_join",
"mixed_full_join",
"mixed_inner_join",
"mixed_left_anti_join",
"mixed_left_join",
"mixed_left_semi_join",
]

cdef Column _column_from_gather_map(cpp_join.gather_map_type gather_map):
# helper to convert a gather map to a Column
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/json.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from pylibcudf.libcudf.column.column cimport column
from pylibcudf.libcudf.scalar.scalar cimport string_scalar
from pylibcudf.scalar cimport Scalar

__all__ = ["GetJsonObjectOptions", "get_json_object"]

cdef class GetJsonObjectOptions:
"""Settings for ``get_json_object()``"""
Expand Down
1 change: 1 addition & 0 deletions python/pylibcudf/pylibcudf/labeling.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from pylibcudf.libcudf.labeling import inclusive as Inclusive # no-cython-lint

from .column cimport Column

__all__ = ["Inclusive", "label_bins"]

cpdef Column label_bins(
Column input,
Expand Down
22 changes: 22 additions & 0 deletions python/pylibcudf/pylibcudf/lists.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ from .column cimport Column, ListColumnView
from .scalar cimport Scalar
from .table cimport Table

__all__ = [
"ConcatenateNullPolicy",
"DuplicateFindOption",
"apply_boolean_mask",
"concatenate_list_elements",
"concatenate_rows",
"contains",
"contains_nulls",
"count_elements",
"difference_distinct",
"distinct",
"explode_outer",
"extract_list_element",
"have_overlap",
"index_of",
"intersect_distinct",
"reverse",
"segmented_gather",
"sequences",
"sort_lists",
"union_distinct",
]

cpdef Table explode_outer(Table input, size_type explode_column_idx):
"""Explode a column of lists into rows.
Expand Down
Loading

0 comments on commit 1801379

Please sign in to comment.