Skip to content

Commit 089af8e

Browse files
Merge pull request NeuralEnsemble#1300 from zm711/analog-proxy-test
Add round down test to analogsignal proxy
2 parents ca2ec91 + 6cd827a commit 089af8e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

neo/test/iotest/test_proxyobjects.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,18 @@ def test_AnalogSignalProxy(self):
5151
assert anasig.shape == (30000, 8)
5252
assert_same_attributes(proxy_anasig.time_slice(2. * pq.s, 5 * pq.s), anasig)
5353

54-
# ceil next sample when slicing
54+
# round up next sample when slicing
5555
anasig = proxy_anasig.load(time_slice=(1.99999 * pq.s, 5.000001 * pq.s))
5656
assert anasig.t_start == 2. * pq.s
5757
assert anasig.duration == 3. * pq.s
5858
assert anasig.shape == (30000, 8)
5959

60+
# round down sample test
61+
anasig = proxy_anasig.load(time_slice=(2.00001 * pq.s, 4.99999 * pq.s))
62+
assert anasig.t_start == 2. * pq.s
63+
assert anasig.duration == 3. * pq.s
64+
assert anasig.shape == (30000, 8)
65+
6066
# buggy time slice
6167
with self.assertRaises(AssertionError):
6268
anasig = proxy_anasig.load(time_slice=(2. * pq.s, 15 * pq.s))

0 commit comments

Comments
 (0)