From d407065defc38fdb0c501ee9b708fc6212b7a96f Mon Sep 17 00:00:00 2001 From: Simon Humpohl Date: Wed, 27 Nov 2019 18:19:24 +0100 Subject: [PATCH 1/2] Update release notes and add test --- ReleaseNotes.txt | 1 + tests/_program/loop_tests.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index ac81923bf..dfb1d7a0f 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -8,6 +8,7 @@ - Add a `set_measurement_mask` to DAC interface. This method is used by the QCoDeS integration. - Add a `get_sample_times` util method to share code for exact and fast sample time calculation - Add a driver for Tektronix AWG5000/7000 + - Warn the user if waveforms need to be concatenated to be compatible with hardware requirements. - Pulse Templates: - `MappingPulseTemplate`: diff --git a/tests/_program/loop_tests.py b/tests/_program/loop_tests.py index d289c2d48..f53083ec4 100644 --- a/tests/_program/loop_tests.py +++ b/tests/_program/loop_tests.py @@ -5,7 +5,8 @@ from string import ascii_uppercase from qupulse.utils.types import TimeType, time_from_float -from qupulse._program._loop import Loop, MultiChannelProgram, _make_compatible, _is_compatible, _CompatibilityLevel, RepetitionWaveform, SequenceWaveform, make_compatible +from qupulse._program._loop import Loop, MultiChannelProgram, _make_compatible, _is_compatible, _CompatibilityLevel,\ + RepetitionWaveform, SequenceWaveform, make_compatible, MakeCompatibleWarning from qupulse._program.instructions import InstructionBlock, ImmutableInstructionBlock from tests.pulses.sequencing_dummies import DummyWaveform from qupulse.pulses.multi_channel_pulse_template import MultiChannelWaveform @@ -583,7 +584,8 @@ def test_make_compatible_repetition_count(self): program = Loop(children=[Loop(waveform=wf1, repetition_count=3), Loop(waveform=wf2)]) duration = program.duration - make_compatible(program, minimal_waveform_length=1, waveform_quantum=1, sample_rate=time_from_float(1.)) + with self.assertWarns(MakeCompatibleWarning): + make_compatible(program, minimal_waveform_length=1, waveform_quantum=1, sample_rate=time_from_float(1.)) self.assertEqual(program.duration, duration) program = Loop(children=[Loop(waveform=wf1, repetition_count=3), From 72cd836f7e5f65334274022f5173077dd04422a8 Mon Sep 17 00:00:00 2001 From: Simon Humpohl Date: Wed, 27 Nov 2019 18:20:25 +0100 Subject: [PATCH 2/2] Add missing export --- qupulse/_program/_loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qupulse/_program/_loop.py b/qupulse/_program/_loop.py index 79c925302..01104f87d 100644 --- a/qupulse/_program/_loop.py +++ b/qupulse/_program/_loop.py @@ -16,7 +16,7 @@ from qupulse._program.waveforms import SequenceWaveform, RepetitionWaveform -__all__ = ['Loop', 'MultiChannelProgram', 'make_compatible'] +__all__ = ['Loop', 'MultiChannelProgram', 'make_compatible', 'MakeCompatibleWarning'] class Loop(Node):