diff --git a/qupulse/hardware/util.py b/qupulse/hardware/util.py index ec1a91ea..35dcd01d 100644 --- a/qupulse/hardware/util.py +++ b/qupulse/hardware/util.py @@ -250,7 +250,7 @@ def check_invalid_values(ch_data): if ch2 is None: ch2 = np.zeros(size) else: - check_invalid_values(ch1) + check_invalid_values(ch2) marker_data = np.zeros(size, dtype=np.uint16) for idx, marker in enumerate(markers): if marker is not None: diff --git a/tests/hardware/util_tests.py b/tests/hardware/util_tests.py index 9b983c28..7693ca3c 100644 --- a/tests/hardware/util_tests.py +++ b/tests/hardware/util_tests.py @@ -98,6 +98,8 @@ def test_size_exception(self): def test_range_exception(self): with self.assertRaisesRegex(ValueError, "invalid"): zhinst_voltage_to_uint16(2.*np.ones(192), None, (None, None, None, None)) + with self.assertRaisesRegex(ValueError, "invalid"): + zhinst_voltage_to_uint16(None, 2.*np.ones(192), (None, None, None, None)) # this should work zhinst_voltage_to_uint16(None, None, (2. * np.ones(192), None, None, None))