Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Slice of AnalogSignal Array deals incorrectly with right (exclusive) border #16

Open
mdenker opened this issue Jun 11, 2015 · 1 comment
Labels

Comments

@mdenker
Copy link
Member

mdenker commented Jun 11, 2015

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
@mdenker mdenker added the bug label Jun 11, 2015
@mdenker
Copy link
Member Author

mdenker commented May 2, 2017

This is still an issue in Neo 0.5: It should be clarified how borders are defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant