Skip to content

Commit 7575597

Browse files
How Si Weihowsiwei
How Si Wei
authored andcommitted
Fix lint errors
1 parent 2669ee4 commit 7575597

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

pandas/tseries/offsets.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def next_bday(self):
639639
else:
640640
return BusinessDay(n=nb_offset)
641641

642-
def _next_opening_time(self, other: datetime, sign: int=1) -> datetime:
642+
def _next_opening_time(self, other: datetime, sign: int = 1) -> datetime:
643643
"""
644644
If self.n and sign have the same sign, return the earliest opening time
645645
later than or equal to current time.
@@ -679,7 +679,7 @@ def _next_opening_time(self, other: datetime, sign: int=1) -> datetime:
679679
other = other + sign * self.next_bday
680680
hour, minute = earliest_start.hour, earliest_start.minute
681681
else:
682-
# find earliest starting time later than or equal to current time
682+
# find earliest starting time no earlier than current time
683683
for st in self.start:
684684
if other.time() <= st:
685685
hour, minute = st.hour, st.minute
@@ -690,7 +690,7 @@ def _next_opening_time(self, other: datetime, sign: int=1) -> datetime:
690690
other = other + sign * self.next_bday
691691
hour, minute = latest_start.hour, latest_start.minute
692692
else:
693-
# find latest starting time earlier than or equal to current time
693+
# find latest starting time no later than current time
694694
for st in reversed(self.start):
695695
if other.time() >= st:
696696
hour, minute = st.hour, st.minute
@@ -717,7 +717,8 @@ def _prev_opening_time(self, other: datetime) -> datetime:
717717
"""
718718
return self._next_opening_time(other, sign=-1)
719719

720-
def _get_business_hours_by_sec(self, start: datetime, end: datetime) -> int:
720+
def _get_business_hours_by_sec(self, start: datetime, end: datetime
721+
) -> int:
721722
"""
722723
Return business hours in a day by seconds.
723724
"""
@@ -783,7 +784,7 @@ def apply(self, other):
783784
other.second, other.microsecond)
784785
n = self.n
785786

786-
# adjust other to reduce cases to handle
787+
# adjust other to reduce number of cases to handle
787788
if n >= 0:
788789
if (other.time() in self.end or
789790
not self._onOffset(other)):
@@ -835,7 +836,8 @@ def apply(self, other):
835836
while bhour_remain != timedelta(0):
836837
# business hour left in this business time interval
837838
bhour = self._next_opening_time(other) - other
838-
if bhour_remain > bhour or bhour_remain == bhour and nanosecond != 0:
839+
if (bhour_remain > bhour or
840+
bhour_remain == bhour and nanosecond != 0):
839841
# finish adjusting if possible
840842
other += bhour_remain
841843
bhour_remain = timedelta(0)

0 commit comments

Comments
 (0)