Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sphinx/jupyter heading issue in UDF notebook #10690

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions docs/cudf/source/user_guide/guide-to-udfs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Overview of User Defined Functions with cuDF"
"Overview of User Defined Functions with cuDF\n",
"===================================="
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the heading and the line below need to be of equal length, or else Sphinx throws warnings. Can you fix these and/or verify that no warnings are thrown?

Suggested change
"Overview of User Defined Functions with cuDF\n",
"===================================="
"Overview of User Defined Functions with cuDF\n",
"============================================"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I might be a little late commenting after Ashwin directed this PR to merge.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of this is going to be fixed in #10685 anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not getting warnings locally. I think it's because matching the character lengths is just a minimum, but I'm checking to make sure.

]
},
{
Expand Down Expand Up @@ -40,7 +41,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Series UDFs\n",
"Series UDFs\n",
"--------------\n",
"\n",
"You can execute UDFs on Series in two ways:\n",
"\n",
Expand All @@ -54,7 +56,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# `cudf.Series.apply`"
"`cudf.Series.apply`\n",
"---------------------"
]
},
{
Expand Down Expand Up @@ -126,7 +129,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Functions with Additional Scalar Arguments"
"Functions with Additional Scalar Arguments\n",
"---------------------------------------------------"
]
},
{
Expand Down Expand Up @@ -181,7 +185,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Nullable Data"
"Nullable Data\n",
"----------------"
]
},
{
Expand Down Expand Up @@ -307,7 +312,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Lower level control with custom `numba` kernels"
"Lower level control with custom `numba` kernels\n",
"---------------------------------------------------------"
]
},
{
Expand Down Expand Up @@ -472,7 +478,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## DataFrame UDFs\n",
"DataFrame UDFs\n",
"--------------------\n",
"\n",
"Like `cudf.Series`, there are multiple ways of using UDFs on dataframes, which essentially amount to UDFs that expect multiple columns as input:\n",
"\n",
Expand All @@ -485,7 +492,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# `cudf.DataFrame.apply`"
"`cudf.DataFrame.apply`\n",
"---------------------------"
]
},
{
Expand Down Expand Up @@ -1197,7 +1205,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Numba kernels for DataFrames"
"Numba kernels for DataFrames\n",
"------------------------------------"
]
},
{
Expand Down Expand Up @@ -1546,7 +1555,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Rolling Window UDFs\n",
"Rolling Window UDFs\n",
"-------------------------\n",
"\n",
"For time-series data, we may need to operate on a small \\\"window\\\" of our column at a time, processing each portion independently. We could slide (\\\"roll\\\") this window over the entire column to answer questions like \\\"What is the 3-day moving average of a stock price over the past year?\"\n",
"\n",
Expand Down Expand Up @@ -1859,7 +1869,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## GroupBy DataFrame UDFs\n",
"GroupBy DataFrame UDFs\n",
"-------------------------------\n",
"\n",
"We can also apply UDFs to grouped DataFrames using `apply_grouped`. This example is also drawn and adapted from the RAPIDS [API documentation]().\n",
"\n",
Expand Down Expand Up @@ -2155,7 +2166,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Numba Kernels on CuPy Arrays\n",
"Numba Kernels on CuPy Arrays\n",
"-------------------------------------\n",
"\n",
"We can also execute Numba kernels on CuPy NDArrays, again thanks to the `__cuda_array_interface__`. We can even run the same UDF on the Series and the CuPy array. First, we define a Series and then create a CuPy array from that Series."
]
Expand Down Expand Up @@ -2257,7 +2269,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Caveats"
"Caveats\n",
"---------"
]
},
{
Expand All @@ -2272,7 +2285,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Summary\n",
"Summary\n",
"-----------\n",
"\n",
"This guide has covered a lot of content. At this point, you should hopefully feel comfortable writing UDFs (with or without null values) that operate on\n",
"\n",
Expand Down Expand Up @@ -2305,7 +2319,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
"version": "3.8.13"
}
},
"nbformat": 4,
Expand Down