Skip to content

Commit c1f8ee1

Browse files
committed
[Ascii] Add channel_index annotation test
1 parent fdb0e7c commit c1f8ee1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

neo/test/iotest/test_asciisignalio.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ def test_csv_expect_success(self):
6161
for row in sample_data:
6262
writer.writerow(row)
6363

64-
io = AsciiSignalIO(filename, usecols=(0, 1, 3), timecolumn=2,
64+
usecols = (0, 1, 3)
65+
timecolumn = 2
66+
io = AsciiSignalIO(filename, usecols=usecols, timecolumn=timecolumn,
6567
# note that timecolumn applies to the remaining columns
6668
# after applying usecols
6769
time_units="ms", delimiter=',', units="mV", method='csv',
@@ -76,6 +78,11 @@ def test_csv_expect_success(self):
7678
decimal=5)
7779
self.assertAlmostEqual(signal.sampling_period, 0.1 * pq.ms)
7880

81+
expected_channel_index = list(usecols)
82+
# remove time column as it is not loaded as signal channel
83+
expected_channel_index.pop(timecolumn)
84+
assert_array_equal(expected_channel_index, signal.array_annotations['channel_index'])
85+
7986
os.remove(filename)
8087
# test_csv_expect_failure
8188

0 commit comments

Comments
 (0)