Skip to content

Commit 48cb024

Browse files
committed
Use autodoc better to generate dataframe and groupby docs
1 parent 26ca8b2 commit 48cb024

File tree

5 files changed

+34
-38
lines changed

5 files changed

+34
-38
lines changed

spec/API_specification/dataframe_api/dataframe_object.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111

1212

1313
class DataFrame:
14+
"""
15+
A DataFrame.
16+
17+
Notes
18+
-----
19+
Note that this DataFrame class is not meant to be instantiated directly by
20+
users of the library implementing the dataframe API standard. Rather, use
21+
constructor functions or an already-created dataframe object retrieved via
22+
23+
"""
1424
@property
1525
def dataframe(self) -> object:
1626
"""

spec/API_specification/dataframe_api/groupby_object.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
from .dataframe_object import DataFrame
55

66

7+
__all__ = ['GroupBy']
8+
9+
710
class GroupBy:
11+
"""
12+
GroupBy class.
13+
14+
Note that this class is not meant to be constructed by users.
15+
It is returned from `DataFrame.groupby`.
16+
17+
**Methods**
18+
19+
"""
820
def any(self, skip_nulls: bool = True) -> "DataFrame":
921
...
1022

spec/API_specification/dataframe_object.rst

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -149,24 +149,5 @@ TODO
149149

150150
Methods
151151
-------
152-
..
153-
NOTE: please keep the methods in alphabetical order
154-
155-
156-
.. autosummary::
157-
:toctree: generated
158-
:template: property.rst
159152

160-
DataFrame.__add__
161-
DataFrame.__eq__
162-
DataFrame.__floordiv__
163-
DataFrame.__ge__
164-
DataFrame.__gt__
165-
DataFrame.__le__
166-
DataFrame.__lt__
167-
DataFrame.__ne__
168-
DataFrame.__mod__
169-
DataFrame.__mul__
170-
DataFrame.__pow__
171-
DataFrame.__sub__
172-
DataFrame.__truediv__
153+
.. autoclass:: DataFrame

spec/API_specification/groupby_object.rst

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,11 @@ Groupby object
66
A conforming implementation of the dataframe API standard must provide and
77
support a groupby object having the following attributes and methods.
88

9-
-------------------------------------------------
10-
11-
Methods
12-
-------
13-
..
14-
NOTE: please keep the methods in alphabetical order
15-
169
.. currentmodule:: dataframe_api
1710

1811
.. autosummary::
1912
:toctree: generated
20-
:template: property.rst
13+
:template: class.rst
14+
15+
GroupBy
2116

22-
GroupBy.all
23-
GroupBy.any
24-
GroupBy.max
25-
GroupBy.min
26-
GroupBy.mean
27-
GroupBy.median
28-
GroupBy.prod
29-
GroupBy.std
30-
GroupBy.sum
31-
GroupBy.var

spec/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@
4646

4747
autosummary_generate = True
4848
autodoc_typehints = 'signature'
49+
autodoc_default_options = {
50+
# 'attributes': True,
51+
'members': True,
52+
'special-members': True,
53+
'undoc-members': True,
54+
'exclude-members': '__annotations__, __dict__',
55+
}
4956
add_module_names = False
57+
napoleon_numpy_docstring = True
5058
napoleon_custom_sections = [('Returns', 'params_style')]
5159
default_role = 'code'
5260

0 commit comments

Comments
 (0)