@@ -713,8 +713,6 @@ class TimeRange (BaseTimeRange):
713713 ROUND_OUT = 4
714714 ROUND_START = 5
715715 ROUND_END = 6
716- PRESERVE_START = 7
717- PRESERVE_END = 8
718716
719717 def __init__ (self , start , end , inclusivity = INCLUSIVE ):
720718 """Construct a time range starting at start and ending at end
@@ -1196,7 +1194,7 @@ def is_empty(self):
11961194 self .start == self .end and
11971195 self .inclusivity != TimeRange .INCLUSIVE )
11981196
1199- def normalise (self , rate_num , rate_den = 1 , rounding = ROUND_NEAREST , phase_offset = TimeOffset () ):
1197+ def normalise (self , rate_num , rate_den = 1 , rounding = ROUND_NEAREST ):
12001198 """Returns a normalised half-open TimeRange based on this timerange.
12011199
12021200 The returned TimeRange will always have INCLUDE_START inclusivity.
@@ -1225,10 +1223,6 @@ def normalise(self, rate_num, rate_den=1, rounding=ROUND_NEAREST, phase_offset=T
12251223 as the start
12261224 * ROUND_END -- The end rounds to the nearest normalised timestamp, the start rounds in the same direction
12271225 as the end
1228- * PRESERVE_START -- The start is not rounded at all, the end is adjusted to match its phase offset
1229- (and the phase_offset parameter will be ignored)
1230- * PRESERVE_END -- The end is not rounded at all, the start is adjusted to match its phase offset
1231- (and the phase_offset parameter will be ignored)
12321226 """
12331227 if rounding == TimeRange .ROUND_OUT :
12341228 start_rounding = TimeRange .ROUND_DOWN
@@ -1239,9 +1233,6 @@ def normalise(self, rate_num, rate_den=1, rounding=ROUND_NEAREST, phase_offset=T
12391233 elif rounding in [TimeRange .ROUND_START , TimeRange .ROUND_END ]:
12401234 start_rounding = TimeRange .ROUND_NEAREST
12411235 end_rounding = TimeRange .ROUND_NEAREST
1242- elif rounding in [TimeRange .PRESERVE_START , TimeRange .PRESERVE_END ]:
1243- start_rounding = TimeRange .ROUND_DOWN
1244- end_rounding = TimeRange .ROUND_DOWN
12451236 else :
12461237 start_rounding = rounding
12471238 end_rounding = rounding
@@ -1267,20 +1258,15 @@ def normalise(self, rate_num, rate_den=1, rounding=ROUND_NEAREST, phase_offset=T
12671258 else :
12681259 start = self .start .to_count (rate_num , rate_den , TimeRange .ROUND_DOWN )
12691260
1270- if self .bounded_before () and rounding == TimeRange .PRESERVE_START :
1271- phase_offset = self .start .to_phase_offset (rate_num , rate_den )
1272- elif self .bounded_after () and rounding == TimeRange .PRESERVE_END :
1273- phase_offset = self .end .to_phase_offset (rate_num , rate_den )
1274-
12751261 if start is not None and not self .includes_start ():
12761262 start += 1
12771263 if end is not None and self .includes_end ():
12781264 end += 1
12791265
12801266 if start is not None :
1281- start = Timestamp .from_count (start , rate_num , rate_den ) + phase_offset
1267+ start = Timestamp .from_count (start , rate_num , rate_den )
12821268 if end is not None :
1283- end = Timestamp .from_count (end , rate_num , rate_den ) + phase_offset
1269+ end = Timestamp .from_count (end , rate_num , rate_den )
12841270
12851271 return TimeRange (start ,
12861272 end ,
0 commit comments