Skip to content

Commit 0b12266

Browse files
SebStrugWillAyd
authored andcommitted
Fixed SS03 errors for: pandas.Timestamp.combine; pandas.Timestamp.fromordinal; pandas.Period.strftime; pandas.Interval.closed; (#29410)
1 parent d66be9b commit 0b12266

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

pandas/_libs/interval.pyx

+11-5
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ cdef class IntervalMixin:
9494
@property
9595
def mid(self):
9696
"""
97-
Return the midpoint of the Interval
97+
Return the midpoint of the Interval.
9898
"""
9999
try:
100100
return 0.5 * (self.left + self.right)
@@ -104,7 +104,9 @@ cdef class IntervalMixin:
104104

105105
@property
106106
def length(self):
107-
"""Return the length of the Interval"""
107+
"""
108+
Return the length of the Interval.
109+
"""
108110
return self.right - self.left
109111

110112
@property
@@ -283,15 +285,19 @@ cdef class Interval(IntervalMixin):
283285
_typ = "interval"
284286

285287
cdef readonly object left
286-
"""Left bound for the interval"""
288+
"""
289+
Left bound for the interval.
290+
"""
287291

288292
cdef readonly object right
289-
"""Right bound for the interval"""
293+
"""
294+
Right bound for the interval.
295+
"""
290296

291297
cdef readonly str closed
292298
"""
293299
Whether the interval is closed on the left-side, right-side, both or
294-
neither
300+
neither.
295301
"""
296302

297303
def __init__(self, left, right, str closed='right'):

pandas/_libs/tslibs/nattype.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class NaTType(_NaT):
464464
"""
465465
Timestamp.combine(date, time)
466466
467-
date, time -> datetime with same date and time fields
467+
date, time -> datetime with same date and time fields.
468468
"""
469469
)
470470
utcnow = _make_error_func('utcnow', # noqa:E128
@@ -503,8 +503,8 @@ class NaTType(_NaT):
503503
"""
504504
Timestamp.fromordinal(ordinal, freq=None, tz=None)
505505
506-
passed an ordinal, translate and convert to a ts
507-
note: by definition there cannot be any tz info on the ordinal itself
506+
Passed an ordinal, translate and convert to a ts.
507+
Note: by definition there cannot be any tz info on the ordinal itself.
508508
509509
Parameters
510510
----------

pandas/_libs/tslibs/period.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ cdef class _Period:
22442244
containing one or several directives. The method recognizes the same
22452245
directives as the :func:`time.strftime` function of the standard Python
22462246
distribution, as well as the specific additional directives ``%f``,
2247-
``%F``, ``%q``. (formatting & docs originally from scikits.timeries)
2247+
``%F``, ``%q``. (formatting & docs originally from scikits.timeries).
22482248
22492249
+-----------+--------------------------------+-------+
22502250
| Directive | Meaning | Notes |

pandas/_libs/tslibs/timestamps.pyx

+4-4
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ class Timestamp(_Timestamp):
242242
"""
243243
Timestamp.fromordinal(ordinal, freq=None, tz=None)
244244
245-
passed an ordinal, translate and convert to a ts
246-
note: by definition there cannot be any tz info on the ordinal itself
245+
Passed an ordinal, translate and convert to a ts.
246+
Note: by definition there cannot be any tz info on the ordinal itself.
247247
248248
Parameters
249249
----------
@@ -333,7 +333,7 @@ class Timestamp(_Timestamp):
333333
"""
334334
Timestamp.combine(date, time)
335335
336-
date, time -> datetime with same date and time fields
336+
date, time -> datetime with same date and time fields.
337337
"""
338338
return cls(datetime.combine(date, time))
339339

@@ -601,7 +601,7 @@ timedelta}, default 'raise'
601601
@property
602602
def dayofweek(self):
603603
"""
604-
Return day of whe week.
604+
Return day of the week.
605605
"""
606606
return self.weekday()
607607

0 commit comments

Comments
 (0)