From 64cce77418efdffa3024be2fd4f630b4aa7e13f7 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 22 Apr 2019 15:36:14 -0700 Subject: [PATCH 1/5] Fixed code issue from compat with new numpydoc --- scripts/validate_docstrings.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index 19df1b92448ef..9592d705a8eb8 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -473,8 +473,7 @@ def parameter_desc(self, param): @property def see_also(self): return collections.OrderedDict((name, ''.join(desc)) - for name, desc, _ - in self.doc['See Also']) + for name, desc in self.doc['See Also']) @property def examples(self): From 5574b4dd6b9d19e04550db53a2403c1fb90cddc8 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 22 Apr 2019 15:42:36 -0700 Subject: [PATCH 2/5] Bumped min environment reqs --- environment.yml | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment.yml b/environment.yml index 48b873d4c3a3d..cf17dc1281ec9 100644 --- a/environment.yml +++ b/environment.yml @@ -24,7 +24,7 @@ dependencies: - pytest>=4.0.2 - pytest-mock - sphinx - - numpydoc + - numpydoc>=0.9.0 - pip # optional diff --git a/requirements-dev.txt b/requirements-dev.txt index 5600e43ea09c5..115a93495c95b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -15,7 +15,7 @@ pycodestyle pytest>=4.0.2 pytest-mock sphinx -numpydoc +numpydoc>=0.9.0 pip beautifulsoup4>=4.2.1 blosc From ada01545d023cb4e5cbb0f95b06151bc356596dc Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 22 Apr 2019 18:45:28 -0700 Subject: [PATCH 3/5] Updated method --- scripts/validate_docstrings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index 9592d705a8eb8..9841b59a4983a 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -472,8 +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']: + for func, _ in funcs: + result[func] = ''.join(desc) + + return result @property def examples(self): From 097f6ef065710e44039e37ea1641dd8ecddbf1c5 Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 22 Apr 2019 18:46:49 -0700 Subject: [PATCH 4/5] LINT fixup --- scripts/validate_docstrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index 9841b59a4983a..20c385b481e60 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -476,7 +476,7 @@ def see_also(self): for funcs, desc in self.doc['See Also']: for func, _ in funcs: result[func] = ''.join(desc) - + return result @property From 3a7e4e494eb55fa93e719ff48cc770f38ceabdfd Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 22 Apr 2019 19:20:41 -0700 Subject: [PATCH 5/5] Fixed returns regression --- scripts/validate_docstrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index 20c385b481e60..ebb09e8f311ee 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -734,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: