Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit bbf4144

Browse files
committed
Fix edge case with resample min-time
1 parent b22c040 commit bbf4144

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/timedata/timedata.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ func ResampleTimeSeriesData(data [][]float64, start float64, end float64, numSte
1818
idx := sort.Search(l, func(i int) bool { return data[i][0] >= pos })
1919
var val float64
2020
if idx == 0 {
21-
val = math.NaN() // off the left
21+
if data[0][0] == pos {
22+
val = data[0][1] // exactly left
23+
} else {
24+
val = math.NaN() // off the left
25+
}
2226
} else if idx == l {
2327
val = math.NaN() // off the right
2428
} else {

0 commit comments

Comments
 (0)