Skip to content

Fixed code issue from compat with new numpydoc #26188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- pytest>=4.0.2
- pytest-mock
- sphinx
- numpydoc
- numpydoc>=0.9.0
- pip

# optional
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pycodestyle
pytest>=4.0.2
pytest-mock
sphinx
numpydoc
numpydoc>=0.9.0
pip
beautifulsoup4>=4.2.1
blosc
Expand Down
11 changes: 7 additions & 4 deletions scripts/validate_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,12 @@ def parameter_desc(self, param):

@property
def see_also(self):
return collections.OrderedDict((name, ''.join(desc))
for name, desc, _
in self.doc['See Also'])
result = collections.OrderedDict()
for funcs, desc in self.doc['See Also']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could write this as a list comprehension but not a big deal

for func, _ in funcs:
result[func] = ''.join(desc)

return result

@property
def examples(self):
Expand Down Expand Up @@ -731,7 +734,7 @@ def get_validation_data(doc):
if doc.method_returns_something:
errs.append(error('RT01'))
else:
if len(doc.returns) == 1 and doc.returns[0][1]:
if len(doc.returns) == 1 and doc.returns[0].name:
errs.append(error('RT02'))
for name_or_type, type_, desc in doc.returns:
if not desc:
Expand Down