beacon-biosignals / TimeSpans.jl

A Julia package that provides a `TimeSpan` type for representing a continuous span between two points in time.
Other
6 stars 2 forks source link

add some more `index_from_time` tests #34

Closed ericphanson closed 2 years ago

ericphanson commented 2 years ago

I was looking into https://github.com/beacon-biosignals/Onda.jl/pull/120 and was getting very confused. I started to doubt TimeSpans.index_from_time, so I wrote a test to compare to an extremely naive algorithm in exact arithmetic, to be sure the +1 was right and rounding wasn't causing an issue. As these tests show, our index_from_time seems perfectly fine (as expected probably 🙂). I figured they could still be useful to have here so others can be reassured as well (or me in the future,) and so we don't regress.