mbauman / Signals.jl

An abandoned work-in-progress for a high level Signal type with a common timebase (in seconds) and groups of channels. Deprecated in favor of AxisArrays.jl.
github.com/JuliaArrays/AxisArrays.jl
Other
6 stars 0 forks source link

Custom channel names and indexing #3

Open mbauman opened 10 years ago

mbauman commented 10 years ago

It'd be nice to allow custom channel names for indexing. Since channels are so often integers, I could see allowing Union(Symbol, Integer) for this. Then a Signal s with 3 channels and names [:snips, 3, 5] would index like so:

s[:snips] -> s.channels[1]
s[3] -> s.channels[2]
s[5] -> s.channels[3]

s[2] -> BoundsError?  Or perhaps there's be a better error type.
tshort commented 9 years ago

Mixing Ints and Symbols seems confusing to me. It'd be nice to have a way to index to channels by position. I rarely run into channels that are numbered in my area of work. That includes monitoring data from scope-like devices and time series data in R (the zoo package is my favorite there).

Using Ints that way is definitely not in line with the AbstractDataFrame interface.

mbauman commented 9 years ago

Yes, I agree. I don't think I should overload integer indexing anymore. And for other types, I'm thinking about only supporting intervals as they will generally be Real numbers and shooting for exact equality or doing interpolation under the hood just seems too magical.