Skip to content

Commit

Permalink
docs(python): improve structure of sphinx-generated API docs (#5376)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-beedie committed Oct 30, 2022
1 parent be02fc0 commit 7def610
Show file tree
Hide file tree
Showing 47 changed files with 1,009 additions and 907 deletions.
22 changes: 11 additions & 11 deletions polars/polars-core/src/frame/groupby/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl DataFrame {
/// +------------+------+------+
/// | date | temp | rain |
/// | --- | --- | --- |
/// | Date | i32 | f64 |
/// | Date | i32 | f64 |
/// +============+======+======+
/// | 2020-08-21 | 20 | 0.2 |
/// +------------+------+------+
Expand Down Expand Up @@ -403,7 +403,7 @@ impl<'df> GroupBy<'df> {
/// +------------+-----------+-----------+
/// | date | temp_mean | rain_mean |
/// | --- | --- | --- |
/// | Date | f64 | f64 |
/// | Date | f64 | f64 |
/// +============+===========+===========+
/// | 2020-08-23 | 9 | 0.1 |
/// +------------+-----------+-----------+
Expand Down Expand Up @@ -441,7 +441,7 @@ impl<'df> GroupBy<'df> {
/// +------------+----------+
/// | date | temp_sum |
/// | --- | --- |
/// | Date | i32 |
/// | Date | i32 |
/// +============+==========+
/// | 2020-08-23 | 9 |
/// +------------+----------+
Expand Down Expand Up @@ -479,7 +479,7 @@ impl<'df> GroupBy<'df> {
/// +------------+----------+
/// | date | temp_min |
/// | --- | --- |
/// | Date | i32 |
/// | Date | i32 |
/// +============+==========+
/// | 2020-08-23 | 9 |
/// +------------+----------+
Expand Down Expand Up @@ -516,7 +516,7 @@ impl<'df> GroupBy<'df> {
/// +------------+----------+
/// | date | temp_max |
/// | --- | --- |
/// | Date | i32 |
/// | Date | i32 |
/// +============+==========+
/// | 2020-08-23 | 9 |
/// +------------+----------+
Expand Down Expand Up @@ -553,7 +553,7 @@ impl<'df> GroupBy<'df> {
/// +------------+------------+
/// | date | temp_first |
/// | --- | --- |
/// | Date | i32 |
/// | Date | i32 |
/// +============+============+
/// | 2020-08-23 | 9 |
/// +------------+------------+
Expand Down Expand Up @@ -590,7 +590,7 @@ impl<'df> GroupBy<'df> {
/// +------------+------------+
/// | date | temp_last |
/// | --- | --- |
/// | Date | i32 |
/// | Date | i32 |
/// +============+============+
/// | 2020-08-23 | 9 |
/// +------------+------------+
Expand Down Expand Up @@ -627,7 +627,7 @@ impl<'df> GroupBy<'df> {
/// +------------+---------------+
/// | date | temp_n_unique |
/// | --- | --- |
/// | Date | u32 |
/// | Date | u32 |
/// +============+===============+
/// | 2020-08-23 | 1 |
/// +------------+---------------+
Expand Down Expand Up @@ -746,7 +746,7 @@ impl<'df> GroupBy<'df> {
/// +------------+------------+
/// | date | temp_count |
/// | --- | --- |
/// | Date | u32 |
/// | Date | u32 |
/// +============+============+
/// | 2020-08-23 | 1 |
/// +------------+------------+
Expand Down Expand Up @@ -783,7 +783,7 @@ impl<'df> GroupBy<'df> {
/// +--------------+------------+
/// | date | groups |
/// | --- | --- |
/// | Date(days) | list [u32] |
/// | Date(days) | list [u32] |
/// +==============+============+
/// | 2020-08-23 | "[3]" |
/// +--------------+------------+
Expand Down Expand Up @@ -818,7 +818,7 @@ impl<'df> GroupBy<'df> {
/// +------------+------------------------+
/// | date | temp_agg_list |
/// | --- | --- |
/// | Date | list [i32] |
/// | Date | list [i32] |
/// +============+========================+
/// | 2020-08-23 | "[Some(9)]" |
/// +------------+------------------------+
Expand Down
32 changes: 16 additions & 16 deletions polars/src/docs/eager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,22 +475,22 @@
//! // melted:
//!
//! // +-----+-----+----------+-------+
//! // | A | B | variable | value |
//! // | --- | --- | --- | --- |
//! // | str | i32 | str | i32 |
//! // +=====+=====+==========+=======+
//! // | "a" | 1 | "C" | 10 |
//! // +-----+-----+----------+-------+
//! // | "b" | 3 | "C" | 11 |
//! // +-----+-----+----------+-------+
//! // | "a" | 5 | "C" | 12 |
//! // +-----+-----+----------+-------+
//! // | "a" | 1 | "D" | 2 |
//! // +-----+-----+----------+-------+
//! // | "b" | 3 | "D" | 4 |
//! // +-----+-----+----------+-------+
//! // | "a" | 5 | "D" | 6 |
//! // +-----+-----+----------+-------+
//! // | A | B | variable | value |
//! // | --- | --- | --- | --- |
//! // | str | i32 | str | i32 |
//! // +=====+=====+==========+=======+
//! // | "a" | 1 | "C" | 10 |
//! // +-----+-----+----------+-------+
//! // | "b" | 3 | "C" | 11 |
//! // +-----+-----+----------+-------+
//! // | "a" | 5 | "C" | 12 |
//! // +-----+-----+----------+-------+
//! // | "a" | 1 | "D" | 2 |
//! // +-----+-----+----------+-------+
//! // | "b" | 3 | "D" | 4 |
//! // +-----+-----+----------+-------+
//! // | "a" | 5 | "D" | 6 |
//! // +-----+-----+----------+-------+
//!
//! # Ok(())
//! # }
Expand Down
1 change: 1 addition & 0 deletions py-polars/docs/requirements-docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ hypothesis==6.56.3

ghp-import==2.1.0
sphinx==5.3.0
sphinx-autosummary-accessors==2022.4.0
pydata-sphinx-theme==0.11.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
Expand Down
5 changes: 4 additions & 1 deletion py-polars/docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
import sys
import warnings

import sphinx_autosummary_accessors

# add polars directory
sys.path.insert(0, os.path.abspath("../.."))

Expand Down Expand Up @@ -43,10 +45,11 @@
"sphinx.ext.linkcode",
"sphinx.ext.mathjax",
"sphinx.ext.todo",
"sphinx_autosummary_accessors",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
templates_path = ["_templates", sphinx_autosummary_accessors.templates_path]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
4 changes: 2 additions & 2 deletions py-polars/docs/source/reference/dataframe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Computations
DataFrame.fold
DataFrame.hash_rows

Manipulation/ selection
-----------------------
Manipulation / selection
------------------------
.. autosummary::
:toctree: api/

Expand Down

0 comments on commit 7def610

Please sign in to comment.