Added error handling for missing version in pulse sequence .

This is the case  for older pulse sequences.
This commit is contained in:
jupfi 2024-04-28 07:39:34 +02:00
parent 17d5e79a70
commit 423fb3d9a0

View file

@ -163,7 +163,12 @@ class PulseSequence:
Raises:
KeyError: If the pulse parameter options are not the same as the ones in the pulse sequence
"""
try:
obj = cls(sequence["name"], version = sequence["version"])
except KeyError:
logger.error("Pulse sequence version not found")
raise KeyError("Pulse sequence version not found")
for event_data in sequence["events"]:
obj.events.append(cls.Event.load_event(event_data, pulse_parameter_options))