Skip to content

Commit

Permalink
Merge pull request #452 from qutech/issues/451_new_sympy_version
Browse files Browse the repository at this point in the history
sympy 1.4 support
  • Loading branch information
terrorfisch authored Apr 24, 2019
2 parents 38f986c + 6f80192 commit 7881aa8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions qupulse/pulses/table_pulse_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ def __init__(self, entries: Dict[ChannelID, Sequence[EntryInInit]],
AtomicPulseTemplate.__init__(self, identifier=identifier, measurements=measurements)
ParameterConstrainer.__init__(self, parameter_constraints=parameter_constraints)

if not entries:
raise ValueError("Cannot construct an empty TablePulseTemplate (no entries given). There is currently no "
"specific reason for this. Please submit an issue if you need this 'feature'.")

self._entries = dict((ch, list()) for ch in entries.keys())
for channel, channel_entries in entries.items():
if len(channel_entries) == 0:
Expand Down
2 changes: 1 addition & 1 deletion tests/pulses/table_pulse_template_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_get_entries_auto_insert(self) -> None:
def test_empty_instantiated(self) -> None:
with self.assertRaises(TypeError):
TablePulseTemplate()
with self.assertRaises(ValueError):
with self.assertRaisesRegex(ValueError, 'empty TablePulseTemplate'):
TablePulseTemplate(entries=dict())

def test_get_entries_instantiated_two_equal_entries(self) -> None:
Expand Down

0 comments on commit 7881aa8

Please sign in to comment.