add test to check for channel locations.
@@ -33,14 +33,16 @@ def test_remove_bad_channels():
probe.set_device_channel_indices(np.arange(num_channels))
rec.set_probe(probe, in_place=True)
-
rec2 = remove_bad_channels(rec, bad_threshold=5.)
+
# Check that the noisy channel is taken out
- assert np.array_equal(rec2.get_channel_ids(), [0,2,3])
+ assert np.array_equal(rec2.get_channel_ids(), [0,2,3]), "wrong channel detected."
# Check that the number of segments is maintained after preprocessor
- assert np.array_equal(rec2.get_num_segments(), rec.get_num_segments())
+ assert np.array_equal(rec2.get_num_segments(), rec.get_num_segments()), "wrong numbber of segments."
# Check that the size of the segments os maintained after preprocessor
- assert np.array_equal(*([r.get_num_frames(x) for x in range(rec.get_num_segments())] for r in [rec, rec2]))
+ assert np.array_equal(*([r.get_num_frames(x) for x in range(rec.get_num_segments())] for r in [rec, rec2])), "wrong lenght of resulting segments."
+ # Check that locations are mantained
+ assert np.array_equal(rec.get_channel_locations()[[0,2,3]], rec2.get_channel_locations()), "wrong channels locations."
if __name__ == '__main__':
