Skip to content

Commit fd5455a

Browse files
authored
Merge pull request #229 from lincc-frameworks/sphinx_tinkering
Overhaul API Reference in docs
2 parents cf7f4ce + 1b8547f commit fd5455a

File tree

12 files changed

+349
-39
lines changed

12 files changed

+349
-39
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ instance/
7272
# Sphinx documentation
7373
docs/_build/
7474
_readthedocs/
75+
docs/reference/api/
7576

7677
# PyBuilder
7778
target/

docs/conf.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
# -- General configuration ---------------------------------------------------
2525
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2626

27-
extensions = ["sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.viewcode"]
27+
extensions = ["sphinx.ext.mathjax", "sphinx.ext.napoleon", "sphinx.ext.viewcode", "sphinx.ext.autosummary"]
2828

29-
extensions.append("autoapi.extension")
3029
extensions.append("nbsphinx")
3130

3231
# -- sphinx-copybutton configuration ----------------------------------------
@@ -49,19 +48,6 @@
4948
# Remove namespaces from class/method signatures
5049
add_module_names = False
5150

52-
autoapi_type = "python"
53-
autoapi_dirs = ["../src"]
54-
autoapi_ignore = ["*/__main__.py", "*/_version.py"]
55-
autoapi_add_toc_tree_entry = False
56-
autoapi_member_order = "bysource"
57-
autoapi_options = [
58-
"members",
59-
"undoc-members",
60-
"show-inheritance",
61-
"show-module-summary",
62-
"special-members",
63-
]
64-
6551
html_theme = "sphinx_book_theme"
6652

6753
html_static_path = ["_static"]

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The :doc:`Tutorials <tutorials>`
7676
section showcases the fundamental features of nested-pandas.
7777

7878
API-level information about nested-pandas is viewable in the
79-
:doc:`API Reference <autoapi/index>`
79+
:doc:`API Reference <reference>`
8080
section.
8181

8282
Learn more about contributing to this repository in our :doc:`Contribution Guide <gettingstarted/contributing>`.
@@ -87,4 +87,4 @@ Learn more about contributing to this repository in our :doc:`Contribution Guide
8787
Home page <self>
8888
Getting Started <gettingstarted>
8989
Tutorials <tutorials>
90-
API Reference <autoapi/index>
90+
API Reference <reference>

docs/reference.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
API Reference
2+
========================================================================================
3+
4+
.. toctree::
5+
:maxdepth: 2
6+
7+
NestedFrame <reference/nestedframe>
8+
.nest Accessor <reference/accessor>
9+
Utility Functions <reference/utils>
10+
NestedDtype <reference/nesteddtype>
11+
Nested Extension Array <reference/ext_array>
12+
Packer Functions <reference/packer>

docs/reference/accessor.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=========
2+
.nest Series Accessor
3+
=========
4+
.. currentmodule:: nested_pandas
5+
6+
Constructor
7+
~~~~~~~~~~~
8+
.. autosummary::
9+
:toctree: api/
10+
11+
NestSeriesAccessor
12+
13+
Functions
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
.. autosummary::
16+
:toctree: api/
17+
18+
NestSeriesAccessor.to_lists
19+
NestSeriesAccessor.to_flat
20+
NestSeriesAccessor.with_field
21+
NestSeriesAccessor.with_flat_field
22+
NestSeriesAccessor.with_list_field
23+
NestSeriesAccessor.with_filled_field
24+
NestSeriesAccessor.without_field
25+
NestSeriesAccessor.query_flat
26+
NestSeriesAccessor.get_flat_index
27+
NestSeriesAccessor.get_flat_series
28+
NestSeriesAccessor.get_list_series
29+

docs/reference/ext_array.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
=========
2+
NestedDtype
3+
=========
4+
.. currentmodule:: nested_pandas
5+
6+
Constructor
7+
~~~~~~~~~~~
8+
.. autosummary::
9+
:toctree: api/
10+
11+
series.ext_array.NestedExtensionArray
12+
13+
Functions
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
.. autosummary::
16+
:toctree: api/
17+
18+
series.ext_array.NestedExtensionArray.to_numpy
19+
series.ext_array.NestedExtensionArray.isna
20+
series.ext_array.NestedExtensionArray.take
21+
series.ext_array.NestedExtensionArray.copy
22+
series.ext_array.NestedExtensionArray.equals
23+
series.ext_array.NestedExtensionArray.dropna
24+
series.ext_array.NestedExtensionArray.from_sequence
25+
series.ext_array.NestedExtensionArray.to_arrow_ext_array
26+
series.ext_array.NestedExtensionArray.iter_field_lists
27+
series.ext_array.NestedExtensionArray.view_fields
28+
series.ext_array.NestedExtensionArray.set_flat_field
29+
series.ext_array.NestedExtensionArray.set_list_field
30+
series.ext_array.NestedExtensionArray.fill_field_lists
31+
series.ext_array.NestedExtensionArray.pop_fields

docs/reference/nesteddtype.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
=========
2+
NestedDtype
3+
=========
4+
.. currentmodule:: nested_pandas
5+
6+
Constructor
7+
~~~~~~~~~~~
8+
.. autosummary::
9+
:toctree: api/
10+
11+
NestedDtype
12+
13+
Functions
14+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15+
.. autosummary::
16+
:toctree: api/
17+
18+
NestedDtype.construct_array_type
19+
NestedDtype.construct_from_string
20+
NestedDtype.from_fields
21+
NestedDtype.from_pandas_arrow_dtype
22+
NestedDtype.to_pandas_arrow_dtype

docs/reference/nestedframe.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
=========
2+
NestedFrame
3+
=========
4+
.. currentmodule:: nested_pandas
5+
6+
Constructor
7+
~~~~~~~~~~~
8+
.. autosummary::
9+
:toctree: api/
10+
11+
NestedFrame
12+
13+
Nesting
14+
~~~~~~~~~
15+
.. autosummary::
16+
:toctree: api/
17+
18+
NestedFrame.add_nested
19+
NestedFrame.from_flat
20+
NestedFrame.from_lists
21+
22+
Extended Pandas.DataFrame Interface
23+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24+
25+
.. note::
26+
The NestedFrame extends the Pandas.DataFrame interface, so all methods
27+
of Pandas.DataFrame are available. The following methods are extended
28+
to support NestedFrame functionality. Please reference the Pandas
29+
documentation for more information.
30+
https://pandas.pydata.org/docs/reference/frame.html
31+
32+
.. autosummary::
33+
:toctree: api/
34+
35+
NestedFrame.eval
36+
NestedFrame.query
37+
NestedFrame.dropna
38+
NestedFrame.sort_values
39+
NestedFrame.reduce
40+
41+
I/O
42+
~~~~~~~~~
43+
.. autosummary::
44+
:toctree: api/
45+
46+
NestedFrame.to_parquet
47+
read_parquet

docs/reference/packer.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
=========
2+
Packer
3+
=========
4+
.. currentmodule:: nested_pandas
5+
6+
Functions
7+
~~~~~~~~~
8+
.. autosummary::
9+
:toctree: api/
10+
11+
series.packer.pack
12+
series.packer.pack_flat
13+
series.packer.pack_seq
14+
series.packer.pack_lists

docs/reference/utils.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=========
2+
Utility Functions
3+
=========
4+
.. currentmodule:: nested_pandas
5+
6+
NestedFrame Utilities
7+
~~~~~~~~~
8+
.. autosummary::
9+
:toctree: api/
10+
11+
utils.count_nested
12+
13+
Generating Toy Datasets
14+
~~~~~~~~~
15+
.. autosummary::
16+
:toctree: api/
17+
18+
datasets.generation.generate_data
19+
datasets.generation.generate_parquet_file

0 commit comments

Comments
 (0)