Closed mchitre closed 3 years ago
Wouldn't the typed range 1s:2s
have the same amount of information and dispatch possibilities?
I played around with that, and had an implementation in the initial days. It would work with unitful quantities (which are supported but optional in the package). If someone wanted to use just numbers for time, dispatching on integer vs float is possible, but error-prone in usage. Hence my thought on using intervals rather than ranges.
But thoughts welcome, as I am ambivalent about it.
Done. Will be part of 0.4.0 release.
Final implementation is as @baggepinnen suggested, but with 𝓈
instead of s
to avoid conflict with single letter variables in code. If using SignalAnalysis.Units
in included, then s
will work too.
Suggested syntax:
x[1..2]
orx[1s..2s]
as signal from 1 seconds to 2 seconds.Interval
data type from https://github.com/invenia/Intervals.jl