File tree 3 files changed +17
-6
lines changed
3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ dependencies:
34
34
- gitdb
35
35
- sphinx
36
36
- sphinx-panels
37
- - numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
37
+ - numpydoc
38
38
- pydata-sphinx-theme
39
39
- types-python-dateutil
40
40
- types-PyMySQL
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ gitpython
20
20
gitdb
21
21
sphinx
22
22
sphinx-panels
23
- numpydoc < 1.2
23
+ numpydoc
24
24
pydata-sphinx-theme
25
25
types-python-dateutil
26
26
types-PyMySQL
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,15 @@ 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 ):
140
+ self .func_name = func_name
141
+ super ().__init__ (doc_obj )
142
+
143
+ @property
144
+ def name (self ):
145
+ return self .func_name
146
+
138
147
@property
139
148
def mentioned_private_classes (self ):
140
149
return [klass for klass in PRIVATE_CLASSES if klass in self .raw_doc ]
@@ -218,8 +227,10 @@ def pandas_validate(func_name: str):
218
227
dict
219
228
Information about the docstring and the errors found.
220
229
"""
221
- doc = PandasDocstring (func_name )
222
- result = validate (func_name )
230
+ func_obj = Validator ._load_obj (func_name )
231
+ doc_obj = get_doc_object (func_obj )
232
+ doc = PandasDocstring (func_name , doc_obj )
233
+ result = validate (doc_obj )
223
234
224
235
mentioned_errs = doc .mentioned_private_classes
225
236
if mentioned_errs :
You can’t perform that action at this time.
0 commit comments