In [3]: a=neo.AnalogSignalArray([1,2,3]*pq.mV,sampling_period=1*pq.ms)
In [4]: print a
[ 1. 2. 3.] mV
# This is correct
In [6]: a.time_slice(0*pq.ms,1*pq.ms)
Out[6]:
AnalogSignalArray in 1.0 mV with 1 float64 values
channel index: None
sampling rate: 1.0 1/ms
time: 0.0 s to 0.001 s
# This is wrong: it should return an array of length 2 (for time points 0 ms and 1 ms)
In [7]: a.time_slice(0*pq.ms,1.1*pq.ms)
Out[7]:
AnalogSignalArray in 1.0 mV with 1 float64 values
channel index: None
sampling rate: 1.0 1/ms
time: 0.0 s to 0.001 s
# This is correct
In [8]: a.time_slice(0*pq.ms,1.7*pq.ms)
Out[8]:
AnalogSignalArray in 1.0 mV with 2 float64 values
channel index: None
sampling rate: 1.0 1/ms
time: 0.0 s to 0.002 s