Skip to content

Commit

Permalink
Fixed SS03 errors for: pandas.Timestamp.combine; pandas.Timestamp.fro…
Browse files Browse the repository at this point in the history
…mordinal; pandas.Period.strftime; pandas.Interval.closed; (pandas-dev#29410)
  • Loading branch information
SebStrug authored and Mateusz Górski committed Nov 18, 2019
1 parent 27d0735 commit 55a2b6e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
16 changes: 11 additions & 5 deletions pandas/_libs/interval.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ cdef class IntervalMixin:
@property
def mid(self):
"""
Return the midpoint of the Interval
Return the midpoint of the Interval.
"""
try:
return 0.5 * (self.left + self.right)
Expand All @@ -104,7 +104,9 @@ cdef class IntervalMixin:

@property
def length(self):
"""Return the length of the Interval"""
"""
Return the length of the Interval.
"""
return self.right - self.left

@property
Expand Down Expand Up @@ -283,15 +285,19 @@ cdef class Interval(IntervalMixin):
_typ = "interval"

cdef readonly object left
"""Left bound for the interval"""
"""
Left bound for the interval.
"""

cdef readonly object right
"""Right bound for the interval"""
"""
Right bound for the interval.
"""

cdef readonly str closed
"""
Whether the interval is closed on the left-side, right-side, both or
neither
neither.
"""

def __init__(self, left, right, str closed='right'):
Expand Down
6 changes: 3 additions & 3 deletions pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class NaTType(_NaT):
"""
Timestamp.combine(date, time)
date, time -> datetime with same date and time fields
date, time -> datetime with same date and time fields.
"""
)
utcnow = _make_error_func('utcnow', # noqa:E128
Expand Down Expand Up @@ -503,8 +503,8 @@ class NaTType(_NaT):
"""
Timestamp.fromordinal(ordinal, freq=None, tz=None)
passed an ordinal, translate and convert to a ts
note: by definition there cannot be any tz info on the ordinal itself
Passed an ordinal, translate and convert to a ts.
Note: by definition there cannot be any tz info on the ordinal itself.
Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ cdef class _Period:
containing one or several directives. The method recognizes the same
directives as the :func:`time.strftime` function of the standard Python
distribution, as well as the specific additional directives ``%f``,
``%F``, ``%q``. (formatting & docs originally from scikits.timeries)
``%F``, ``%q``. (formatting & docs originally from scikits.timeries).
+-----------+--------------------------------+-------+
| Directive | Meaning | Notes |
Expand Down
8 changes: 4 additions & 4 deletions pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ class Timestamp(_Timestamp):
"""
Timestamp.fromordinal(ordinal, freq=None, tz=None)
passed an ordinal, translate and convert to a ts
note: by definition there cannot be any tz info on the ordinal itself
Passed an ordinal, translate and convert to a ts.
Note: by definition there cannot be any tz info on the ordinal itself.
Parameters
----------
Expand Down Expand Up @@ -333,7 +333,7 @@ class Timestamp(_Timestamp):
"""
Timestamp.combine(date, time)
date, time -> datetime with same date and time fields
date, time -> datetime with same date and time fields.
"""
return cls(datetime.combine(date, time))

Expand Down Expand Up @@ -601,7 +601,7 @@ timedelta}, default 'raise'
@property
def dayofweek(self):
"""
Return day of whe week.
Return day of the week.
"""
return self.weekday()

Expand Down

0 comments on commit 55a2b6e

Please sign in to comment.