Skip to content

Commit

Permalink
Add test for issue 447
Browse files Browse the repository at this point in the history
  • Loading branch information
terrorfisch committed Apr 3, 2019
1 parent de5a8f2 commit 3e5f512
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/pulses/plotting_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,29 @@ def test_plot_empty_pulse(self) -> None:
with self.assertWarnsRegex(UserWarning, "empty", msg="plot() did not issue a warning for an empty pulse"):
plot(pt, dict(), show=False)

def test_bug_447(self):
"""Code from https://github.com/qutech/qupulse/issues/447"""
TablePT = TablePulseTemplate
SequencePT = SequencePulseTemplate
Sequencing = Sequencer

period = 8.192004194306148e-05
repetitions = 80
sampling_rate = 1e7
sec_to_ns = 1e9

table_pt = TablePT({'test': [(0, 0), (period * sec_to_ns, 0, 'linear')]})

sequencer = Sequencing()
template = SequencePT(*((table_pt,) * repetitions))
channels = template.defined_channels
sequencer.push(template, dict(), channel_mapping={ch: ch for ch in channels},
window_mapping={w: w for w in template.measurement_names})
instructions = sequencer.build()

with self.assertWarns(UserWarning):
(_, voltages, _) = render(instructions, sampling_rate / sec_to_ns)


class PlottingNotPossibleExceptionTests(unittest.TestCase):

Expand Down

0 comments on commit 3e5f512

Please sign in to comment.