Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sympy 1.4 support #452

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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