@@ -583,21 +583,13 @@ def __init__(self, start='09:00', end='17:00', offset=timedelta(0)):
583
583
if _iterable_not_string (start ):
584
584
start = np .asarray (start )
585
585
if len (start ) == 0 :
586
- < << << << HEAD
587
586
raise ValueError ('Must include at least 1 start time' )
588
- == == == =
589
- raise ValueError ('number of starting time cannot be 0' )
590
- >> >> >> > Edit comments and tests
591
587
else :
592
588
start = np .array ([start ])
593
589
if _iterable_not_string (end ):
594
590
end = np .asarray (end )
595
591
if len (end ) == 0 :
596
- < << << << HEAD
597
592
raise ValueError ('Must include at least 1 end time' )
598
- == == == =
599
- raise ValueError ('number of ending time cannot be 0' )
600
- >> >> >> > Edit comments and tests
601
593
else :
602
594
end = np .array ([end ])
603
595
@@ -653,16 +645,10 @@ def _get_daytime_flag(self, start, end):
653
645
654
646
def _next_opening_time (self , other , sign = 1 ):
655
647
"""
656
- <<<<<<< HEAD
657
648
If self.n and sign have the same sign, return the earliest opening time
658
649
later than or equal to current time.
659
650
Otherwise the latest opening time earlier than or equal to current
660
651
time.
661
- =======
662
- If self.n and dir have the same sign, return the earliest opening time
663
- later than or equal to current time.
664
- Otherwise the latest opening time earlier than or equal to current time.
665
- >>>>>>> Edit comments and tests
666
652
667
653
Opening time always locates on BusinessDay.
668
654
However, closing time may not if business hour extends over midnight.
@@ -671,20 +657,14 @@ def _next_opening_time(self, other, sign=1):
671
657
latest_start = self .start [- 1 ]
672
658
if not self .next_bday .onOffset (other ):
673
659
# today is not business day
674
- < << << << HEAD
675
660
other = other + sign * self .next_bday
676
661
if self .n * sign >= 0 :
677
- == == == =
678
- other = other + dir * self .next_bday
679
- if self .n * dir >= 0 :
680
- > >> >> >> Edit comments and tests
681
662
return datetime (other .year , other .month , other .day ,
682
663
earliest_start .hour , earliest_start .minute )
683
664
else :
684
665
return datetime (other .year , other .month , other .day ,
685
666
latest_start .hour , latest_start .minute )
686
667
else :
687
- << << << < HEAD
688
668
if self .n * sign >= 0 and latest_start < other .time ():
689
669
# current time is after latest starting time in today
690
670
other = other + sign * self .next_bday
@@ -696,19 +676,6 @@ def _next_opening_time(self, other, sign=1):
696
676
return datetime (other .year , other .month , other .day ,
697
677
latest_start .hour , latest_start .minute )
698
678
if self .n * sign >= 0 :
699
- == == == =
700
- if self .n * dir >= 0 and latest_start < other .time ():
701
- # current time is after latest starting time in today
702
- other = other + dir * self .next_bday
703
- return datetime (other .year , other .month , other .day ,
704
- earliest_start .hour , earliest_start .minute )
705
- elif self .n * dir < 0 and other .time () < earliest_start :
706
- # current time is before earliest starting time in today
707
- other = other + dir * self .next_bday
708
- return datetime (other .year , other .month , other .day ,
709
- latest_start .hour , latest_start .minute )
710
- if self .n * dir >= 0 :
711
- > >> >> >> Edit comments and tests
712
679
# find earliest starting time later than or equal to current time
713
680
for st in self .start :
714
681
if other .time () <= st :
@@ -725,12 +692,8 @@ def _prev_opening_time(self, other):
725
692
"""
726
693
If n is positive, return the latest opening time earlier than or equal
727
694
to current time.
728
- <<<<<<< HEAD
729
695
Otherwise the earliest opening time later than or equal to current
730
696
time.
731
- =======
732
- Otherwise the earliest opening time later than or equal to current time.
733
- >>>>>>> Edit comments and tests
734
697
735
698
"""
736
699
return self ._next_opening_time (other , sign = - 1 )
0 commit comments