From a945377d5b0ecfc139faf87e9db62d2b9f516df0 Mon Sep 17 00:00:00 2001 From: GALI PREM SAGAR Date: Mon, 26 Sep 2022 17:00:15 -0500 Subject: [PATCH] Add doc section for `list` & `struct` handling (#11770) Fixes: #11011 This PR: - [x] Adds a side-section for `list` & `struct` handling. - [x] Reduces duplication. - [x] Exposes more `ListMethods` APIs. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Ashwin Srinath (https://github.com/shwina) URL: https://github.com/rapidsai/cudf/pull/11770 --- docs/cudf/source/api_docs/index.rst | 2 + docs/cudf/source/api_docs/list_handling.rst | 21 +++++++ docs/cudf/source/api_docs/series.rst | 58 +++++-------------- docs/cudf/source/api_docs/struct_handling.rst | 13 +++++ 4 files changed, 50 insertions(+), 44 deletions(-) create mode 100644 docs/cudf/source/api_docs/list_handling.rst create mode 100644 docs/cudf/source/api_docs/struct_handling.rst diff --git a/docs/cudf/source/api_docs/index.rst b/docs/cudf/source/api_docs/index.rst index b77c98f3ac3..ef04167c327 100644 --- a/docs/cudf/source/api_docs/index.rst +++ b/docs/cudf/source/api_docs/index.rst @@ -19,4 +19,6 @@ This page provides a list of all publicly accessible modules, methods and classe io subword_tokenize string_handling + list_handling + struct_handling options diff --git a/docs/cudf/source/api_docs/list_handling.rst b/docs/cudf/source/api_docs/list_handling.rst new file mode 100644 index 00000000000..f1fb6d1ca74 --- /dev/null +++ b/docs/cudf/source/api_docs/list_handling.rst @@ -0,0 +1,21 @@ +List handling +~~~~~~~~~~~~~ + +``Series.list`` can be used to access the values of the series as +lists and apply list methods to it. These can be accessed like +``Series.list.``. + +.. currentmodule:: cudf.core.column.lists.ListMethods +.. autosummary:: + :toctree: api/ + + astype + concat + contains + index + get + leaves + len + sort_values + take + unique diff --git a/docs/cudf/source/api_docs/series.rst b/docs/cudf/source/api_docs/series.rst index 1e53c90b44d..53042041f6d 100644 --- a/docs/cudf/source/api_docs/series.rst +++ b/docs/cudf/source/api_docs/series.rst @@ -310,21 +310,6 @@ Timedelta properties .. include:: string_handling.rst -.. - The following is needed to ensure the generated pages are created with the - correct template (otherwise they would be created in the Series/Index class page) - -.. - .. currentmodule:: cudf - .. autosummary:: - :toctree: api/ - :template: autosummary/accessor.rst - - Series.str - Series.cat - Series.dt - Index.str - .. _api.series.cat: Categorical accessor @@ -349,42 +334,27 @@ the ``Series.cat`` accessor. .. _api.series.list: - -List handling -~~~~~~~~~~~~~ - -``Series.list`` can be used to access the values of the series as -lists and apply list methods to it. These can be accessed like -``Series.list.``. - -.. currentmodule:: cudf.core.column.lists.ListMethods -.. autosummary:: - :toctree: api/ - - concat - contains - get - len - sort_values - take - unique +.. include:: list_handling.rst .. _api.series.struct: +.. include:: struct_handling.rst -Struct handling -~~~~~~~~~~~~~~~ -``Series.struct`` can be used to access the values of the series as -Structs and apply struct methods to it. These can be accessed like -``Series.struct.``. +.. + The following is needed to ensure the generated pages are created with the + correct template (otherwise they would be created in the Series/Index class page) -.. currentmodule:: cudf.core.column.struct.StructMethods -.. autosummary:: - :toctree: api/ +.. + .. currentmodule:: cudf + .. autosummary:: + :toctree: api/ + :template: autosummary/accessor.rst - field - explode + Series.str + Series.cat + Series.dt + Index.str Serialization / IO / conversion diff --git a/docs/cudf/source/api_docs/struct_handling.rst b/docs/cudf/source/api_docs/struct_handling.rst new file mode 100644 index 00000000000..05ba990382a --- /dev/null +++ b/docs/cudf/source/api_docs/struct_handling.rst @@ -0,0 +1,13 @@ +Struct handling +~~~~~~~~~~~~~~~ + +``Series.struct`` can be used to access the values of the series as +Structs and apply struct methods to it. These can be accessed like +``Series.struct.``. + +.. currentmodule:: cudf.core.column.struct.StructMethods +.. autosummary:: + :toctree: api/ + + field + explode