def test_get_as_single_waveform(self): prog = PlottableProgram(self.segments, self.sequencer_tables, self.adv_sequencer_table) expected_single_waveform_0 = np.fromiter(prog.iter_samples(0), dtype=np.uint16) expected_single_waveform_1 = np.fromiter(prog.iter_samples(1), dtype=np.uint16) np.testing.assert_equal(prog.get_as_single_waveform(0), expected_single_waveform_0) np.testing.assert_equal(prog.get_as_single_waveform(1), expected_single_waveform_1)
def test_iter(self): prog = PlottableProgram(self.segments, self.sequencer_tables, self.adv_sequencer_table) ch = itertools.chain.from_iterable(self.ch_a[idx] for idx in self.selection_order) ch_0 = np.fromiter(ch, dtype=np.uint16) ch_1 = ch_0 + 1000 for expected, found in zip(ch_0, prog.iter_samples(0, True, True)): self.assertEqual(expected, found) for expected, found in zip(ch_1, prog.iter_samples(1, True, True)): self.assertEqual(expected, found)