File tree 3 files changed +19
-6
lines changed
3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ dependencies:
32
32
# documentation
33
33
- gitpython # obtain contributors from git for whatsnew
34
34
- gitdb
35
- - numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
35
+ - numpydoc
36
36
- pandas-dev-flaker=0.4.0
37
37
- pydata-sphinx-theme
38
38
- pytest-cython
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ pycodestyle
18
18
pyupgrade
19
19
gitpython
20
20
gitdb
21
- numpydoc < 1.2
21
+ numpydoc
22
22
pandas-dev-flaker == 0.4.0
23
23
pydata-sphinx-theme
24
24
pytest-cython
Original file line number Diff line number Diff line change 29
29
import matplotlib
30
30
import matplotlib .pyplot as plt
31
31
import numpy
32
+ from numpydoc .docscrape import get_doc_object
32
33
from numpydoc .validate import (
33
- Docstring ,
34
+ Validator ,
34
35
validate ,
35
36
)
36
37
@@ -134,7 +135,17 @@ def get_api_items(api_doc_fd):
134
135
previous_line = line
135
136
136
137
137
- class PandasDocstring (Docstring ):
138
+ class PandasDocstring (Validator ):
139
+ def __init__ (self , func_name : str , doc_obj = None ):
140
+ self .func_name = func_name
141
+ if doc_obj is None :
142
+ doc_obj = get_doc_object (Validator ._load_obj (func_name ))
143
+ super ().__init__ (doc_obj )
144
+
145
+ @property
146
+ def name (self ):
147
+ return self .func_name
148
+
138
149
@property
139
150
def mentioned_private_classes (self ):
140
151
return [klass for klass in PRIVATE_CLASSES if klass in self .raw_doc ]
@@ -218,8 +229,10 @@ def pandas_validate(func_name: str):
218
229
dict
219
230
Information about the docstring and the errors found.
220
231
"""
221
- doc = PandasDocstring (func_name )
222
- result = validate (func_name )
232
+ func_obj = Validator ._load_obj (func_name )
233
+ doc_obj = get_doc_object (func_obj )
234
+ doc = PandasDocstring (func_name , doc_obj )
235
+ result = validate (doc_obj )
223
236
224
237
mentioned_errs = doc .mentioned_private_classes
225
238
if mentioned_errs :
You can’t perform that action at this time.
0 commit comments