Skip to content

Commit fdda543

Browse files
WillAydjreback
authored andcommitted
Fixed code issue from compat with new numpydoc (#26188)
1 parent b9e46ad commit fdda543

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
- pytest>=4.0.2
2525
- pytest-mock
2626
- sphinx
27-
- numpydoc
27+
- numpydoc>=0.9.0
2828
- pip
2929

3030
# optional

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pycodestyle
1515
pytest>=4.0.2
1616
pytest-mock
1717
sphinx
18-
numpydoc
18+
numpydoc>=0.9.0
1919
pip
2020
beautifulsoup4>=4.2.1
2121
blosc

scripts/validate_docstrings.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,12 @@ def parameter_desc(self, param):
472472

473473
@property
474474
def see_also(self):
475-
return collections.OrderedDict((name, ''.join(desc))
476-
for name, desc, _
477-
in self.doc['See Also'])
475+
result = collections.OrderedDict()
476+
for funcs, desc in self.doc['See Also']:
477+
for func, _ in funcs:
478+
result[func] = ''.join(desc)
479+
480+
return result
478481

479482
@property
480483
def examples(self):
@@ -731,7 +734,7 @@ def get_validation_data(doc):
731734
if doc.method_returns_something:
732735
errs.append(error('RT01'))
733736
else:
734-
if len(doc.returns) == 1 and doc.returns[0][1]:
737+
if len(doc.returns) == 1 and doc.returns[0].name:
735738
errs.append(error('RT02'))
736739
for name_or_type, type_, desc in doc.returns:
737740
if not desc:

0 commit comments

Comments
 (0)