From dca54de87ce8aeb76decbaf91dd548bc994de945 Mon Sep 17 00:00:00 2001 From: Souvik Mandal Date: Tue, 19 Feb 2019 00:53:58 +0530 Subject: [PATCH 1/2] DOC: Fixing SS02 errors as per #25113 Some of the SS02 error mentioned are not because of methods but of docstring. For example, in the first SS02 error pandas/tseries/offsets.py has no method named normalize. --- pandas/_libs/tslibs/timedeltas.pyx | 14 +++++++------- pandas/io/pytables.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 0a19d8749fc7c..9db952b3d7f92 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -98,7 +98,7 @@ _no_input = object() @cython.wraparound(False) def ints_to_pytimedelta(int64_t[:] arr, box=False): """ - convert an i8 repr to an ndarray of timedelta or Timedelta (if box == + Convert an i8 repr to an ndarray of timedelta or Timedelta (if box == True) Parameters @@ -247,7 +247,7 @@ def array_to_timedelta64(object[:] values, unit='ns', errors='raise'): cdef inline int64_t cast_from_unit(object ts, object unit) except? -1: - """ return a casting of the unit represented to nanoseconds + """ Return a casting of the unit represented to nanoseconds round the fractional part of a float to our precision, p """ cdef: int64_t m @@ -792,7 +792,7 @@ cdef class _Timedelta(timedelta): def _ensure_components(_Timedelta self): """ - compute the components + Compute the components """ if self.is_populated: return @@ -815,7 +815,7 @@ cdef class _Timedelta(timedelta): cpdef timedelta to_pytimedelta(_Timedelta self): """ - return an actual datetime.timedelta object + Return an actual datetime.timedelta object note: we lose nanosecond resolution if any """ return timedelta(microseconds=int(self.value) / 1000) @@ -831,7 +831,7 @@ cdef class _Timedelta(timedelta): return self.value / 1e9 def view(self, dtype): - """ array view compat """ + """ Array view compat """ return np.timedelta64(self.value).view(dtype) @property @@ -1234,7 +1234,7 @@ class Timedelta(_Timedelta): def floor(self, freq): """ - return a new Timedelta floored to this resolution + Return a new Timedelta floored to this resolution Parameters ---------- @@ -1244,7 +1244,7 @@ class Timedelta(_Timedelta): def ceil(self, freq): """ - return a new Timedelta ceiled to this resolution + Return a new Timedelta ceiled to this resolution Parameters ---------- diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 2ab6ddb5b25c7..bfaf562826079 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -1091,7 +1091,7 @@ def create_table_index(self, key, **kwargs): s.create_index(**kwargs) def groups(self): - """return a list of all the top-level nodes (that are not themselves a + """Return a list of all the top-level nodes (that are not themselves a pandas storage object) """ _tables() From 7146e712a91ccd487bde5fbfa0e61bfb4a7c19d8 Mon Sep 17 00:00:00 2001 From: Souvik Mandal Date: Tue, 19 Feb 2019 18:31:19 +0530 Subject: [PATCH 2/2] SS02 error added during docstrings checking in code_checks.sh --- ci/code_checks.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 35358306468c5..5c6ba0a9b6674 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -241,7 +241,7 @@ fi if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT04)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04 + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04,SS02 RET=$(($RET + $?)) ; echo $MSG "DONE" fi