Skip to content

Commit 82a44a2

Browse files
committed
Add no-pruning channel test for AlphaOmegaRawIO
1 parent 8481d70 commit 82a44a2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

neo/test/rawiotest/test_alphaomegarawio.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,34 @@ def test_read_file_blocks_prune(self):
185185
with self.subTest(port_id=port_id):
186186
self.assertTrue(port["samples"])
187187

188+
def test_read_file_blocks_no_prune(self):
189+
"""Check that we keep empty channels when pruning is False"""
190+
path = Path(self.get_local_path("alphaomega/mpx_map_version4"))
191+
reader = AlphaOmegaRawIO(dirname=path)
192+
mpx_file = Path(
193+
self.get_local_path("alphaomega/mpx_map_version4/mapfile0054.mpx")
194+
)
195+
(
196+
metadata,
197+
continuous_analog_channels,
198+
segmented_analog_channels,
199+
digital_channels,
200+
channel_type,
201+
stream_data_channels,
202+
ports,
203+
events,
204+
_, # ignore unknown_blocks
205+
) = reader._read_file_blocks(mpx_file, prune_channels=False)
206+
207+
self.assertFalse(
208+
all(c["positions"] for c in continuous_analog_channels.values())
209+
)
210+
self.assertFalse(
211+
all(c["positions"] for c in segmented_analog_channels.values())
212+
)
213+
self.assertFalse(all(c["samples"] for c in digital_channels.values()))
214+
self.assertFalse(all(c["samples"] for c in ports.values()))
215+
188216
def test_correct_number_of_blocks_and_segments(self):
189217
"""We just check that when we read test data we get what we expect"""
190218
reader = AlphaOmegaRawIO(

0 commit comments

Comments
 (0)