Skip to content

Commit 8a577c9

Browse files
committed
More autodoc improvements, and cleaning up operator support boilerplate
1 parent 48cb024 commit 8a577c9

File tree

4 files changed

+5
-101
lines changed

4 files changed

+5
-101
lines changed

spec/API_specification/dataframe_api/groupby_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class GroupBy:
1111
"""
12-
GroupBy class.
12+
GroupBy object.
1313
1414
Note that this class is not meant to be constructed by users.
1515
It is returned from `DataFrame.groupby`.

spec/API_specification/dataframe_object.rst

Lines changed: 1 addition & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ Dataframe object
66
A conforming implementation of the dataframe API standard must provide and
77
support a dataframe object having the following attributes and methods.
88

9-
-------------------------------------------------
10-
11-
.. _operators:
12-
139
Operators
1410
---------
1511

@@ -20,42 +16,7 @@ Arithmetic Operators
2016
~~~~~~~~~~~~~~~~~~~~
2117

2218
A conforming implementation of the array API standard must provide and support
23-
an array object supporting the following Python arithmetic operators.
24-
25-
- `x1 + x2`: :meth:`.DataFrame.__add__`
26-
27-
- `operator.add(x1, x2) <https://docs.python.org/3/library/operator.html#operator.add>`_
28-
- `operator.__add__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__add__>`_
29-
30-
- `x1 - x2`: :meth:`.DataFrame.__sub__`
31-
32-
- `operator.sub(x1, x2) <https://docs.python.org/3/library/operator.html#operator.sub>`_
33-
- `operator.__sub__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__sub__>`_
34-
35-
- `x1 * x2`: :meth:`.DataFrame.__mul__`
36-
37-
- `operator.mul(x1, x2) <https://docs.python.org/3/library/operator.html#operator.mul>`_
38-
- `operator.__mul__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__mul__>`_
39-
40-
- `x1 / x2`: :meth:`.DataFrame.__truediv__`
41-
42-
- `operator.truediv(x1,x2) <https://docs.python.org/3/library/operator.html#operator.truediv>`_
43-
- `operator.__truediv__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__truediv__>`_
44-
45-
- `x1 // x2`: :meth:`.DataFrame.__floordiv__`
46-
47-
- `operator.floordiv(x1, x2) <https://docs.python.org/3/library/operator.html#operator.floordiv>`_
48-
- `operator.__floordiv__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__floordiv__>`_
49-
50-
- `x1 % x2`: :meth:`.DataFrame.__mod__`
51-
52-
- `operator.mod(x1, x2) <https://docs.python.org/3/library/operator.html#operator.mod>`_
53-
- `operator.__mod__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__mod__>`_
54-
55-
- `x1 ** x2`: :meth:`.DataFrame.__pow__`
56-
57-
- `operator.pow(x1, x2) <https://docs.python.org/3/library/operator.html#operator.pow>`_
58-
- `operator.__pow__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__pow__>`_
19+
a dataframe object supporting the following Python arithmetic operators.
5920

6021
Arithmetic operators should be defined for a dataframe having real-valued data types.
6122

@@ -72,36 +33,6 @@ A conforming implementation of the dataframe API standard must provide and
7233
support a dataframe object supporting the following Python comparison
7334
operators.
7435

75-
- `x1 < x2`: :meth:`.DataFrame.__lt__`
76-
77-
- `operator.lt(x1, x2) <https://docs.python.org/3/library/operator.html#operator.lt>`_
78-
- `operator.__lt__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__lt__>`_
79-
80-
- `x1 <= x2`: :meth:`.DataFrame.__le__`
81-
82-
- `operator.le(x1, x2) <https://docs.python.org/3/library/operator.html#operator.le>`_
83-
- `operator.__le__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__le__>`_
84-
85-
- `x1 > x2`: :meth:`.DataFrame.__gt__`
86-
87-
- `operator.gt(x1, x2) <https://docs.python.org/3/library/operator.html#operator.gt>`_
88-
- `operator.__gt__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__gt__>`_
89-
90-
- `x1 >= x2`: :meth:`.DataFrame.__ge__`
91-
92-
- `operator.ge(x1, x2) <https://docs.python.org/3/library/operator.html#operator.ge>`_
93-
- `operator.__ge__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__ge__>`_
94-
95-
- `x1 == x2`: :meth:`.DataFrame.__eq__`
96-
97-
- `operator.eq(x1, x2) <https://docs.python.org/3/library/operator.html#operator.eq>`_
98-
- `operator.__eq__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__eq__>`_
99-
100-
- `x1 != x2`: :meth:`.DataFrame.__ne__`
101-
102-
- `operator.ne(x1, x2) <https://docs.python.org/3/library/operator.html#operator.ne>`_
103-
- `operator.__ne__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__ne__>`_
104-
10536
Comparison operators should be defined for dataframes having any data type.
10637

10738
In-place Operators
@@ -125,29 +56,6 @@ Arithmetic Operators
12556
- ``__rpow__``
12657
- ``__rmod__``
12758

128-
-------------------------------------------------
129-
13059
.. currentmodule:: dataframe_api
13160

132-
Attributes
133-
----------
134-
135-
TODO
136-
137-
..
138-
NOTE: please keep the attributes in alphabetical order
139-
140-
141-
..
142-
autosummary::
143-
:toctree: generated
144-
:template: property.rst
145-
146-
DataFrame.shape
147-
148-
-------------------------------------------------
149-
150-
Methods
151-
-------
152-
15361
.. autoclass:: DataFrame

spec/API_specification/groupby_object.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ Groupby object
44
==============
55

66
A conforming implementation of the dataframe API standard must provide and
7-
support a groupby object having the following attributes and methods.
7+
support a groupby object having the following methods.
88

99
.. currentmodule:: dataframe_api
1010

11-
.. autosummary::
12-
:toctree: generated
13-
:template: class.rst
14-
15-
GroupBy
11+
.. autoclass:: GroupBy
1612

spec/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
'members': True,
5252
'special-members': True,
5353
'undoc-members': True,
54-
'exclude-members': '__annotations__, __dict__',
54+
'exclude-members': '__annotations__, __dict__,__weakref__,__module__',
5555
}
5656
add_module_names = False
5757
napoleon_numpy_docstring = True

0 commit comments

Comments
 (0)