Skip to content

Commit

Permalink
enhance: timeseries: update TimeSeriesSet.ToSetTimesRangeUpper()
Browse files Browse the repository at this point in the history
  • Loading branch information
grokify committed Jul 26, 2021
1 parent 45d2a54 commit a56d483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/timeseries/time_series_set_xf.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (set *TimeSeriesSet) NewTimesLowerBound(times ...time.Time) (TimeSeriesSets
}
*/

func (set *TimeSeriesSet) NewTimesUpperBound(times ...time.Time) (TimeSeriesSet, error) {
func (set *TimeSeriesSet) ToSetTimesRangeUpper(inclusive bool, times ...time.Time) (TimeSeriesSet, error) {
_, max := set.MinMaxTimes()
times = append(times, max)
timeSlice := timeslice.TimeSlice(times)
Expand All @@ -48,7 +48,7 @@ func (set *TimeSeriesSet) NewTimesUpperBound(times ...time.Time) (TimeSeriesSet,
if timeItem.SeriesName != seriesName {
return newSet, errors.New("timeItem.SeriesName != TimeSeriesSet seriesName")
}
tRangeUpper, err := timeSlice.RangeUpper(timeItem.Time, true)
tRangeUpper, err := timeSlice.RangeUpper(timeItem.Time, inclusive)
if err != nil {
panic("time item greater than set max time")
}
Expand Down

0 comments on commit a56d483

Please sign in to comment.