Skip to content

Commit 4a378de

Browse files
committed
DEPS: unpin numpydoc pandas-dev#39688
1 parent 357845d commit 4a378de

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ dependencies:
3434
- gitdb
3535
- sphinx
3636
- sphinx-panels
37-
- numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
37+
- numpydoc
3838
- pydata-sphinx-theme
3939
- types-python-dateutil
4040
- types-PyMySQL

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ gitpython
2020
gitdb
2121
sphinx
2222
sphinx-panels
23-
numpydoc < 1.2
23+
numpydoc
2424
pydata-sphinx-theme
2525
types-python-dateutil
2626
types-PyMySQL

scripts/validate_docstrings.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
import matplotlib
3030
import matplotlib.pyplot as plt
3131
import numpy
32+
from numpydoc.docscrape import get_doc_object
3233
from numpydoc.validate import (
33-
Docstring,
34+
Validator,
3435
validate,
3536
)
3637

@@ -134,7 +135,15 @@ def get_api_items(api_doc_fd):
134135
previous_line = line
135136

136137

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+
138147
@property
139148
def mentioned_private_classes(self):
140149
return [klass for klass in PRIVATE_CLASSES if klass in self.raw_doc]
@@ -218,8 +227,10 @@ def pandas_validate(func_name: str):
218227
dict
219228
Information about the docstring and the errors found.
220229
"""
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)
223234

224235
mentioned_errs = doc.mentioned_private_classes
225236
if mentioned_errs:

0 commit comments

Comments
 (0)