mirror of
https://github.com/nqrduck/nqrduck-spectrometer.git
synced 2024-11-09 12:30:01 +00:00
Added error handling for missing version in pulse sequence .
This is the case for older pulse sequences.
This commit is contained in:
parent
17d5e79a70
commit
423fb3d9a0
1 changed files with 6 additions and 1 deletions
|
@ -163,7 +163,12 @@ class PulseSequence:
|
||||||
Raises:
|
Raises:
|
||||||
KeyError: If the pulse parameter options are not the same as the ones in the pulse sequence
|
KeyError: If the pulse parameter options are not the same as the ones in the pulse sequence
|
||||||
"""
|
"""
|
||||||
obj = cls(sequence["name"], version = sequence["version"])
|
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"]:
|
for event_data in sequence["events"]:
|
||||||
obj.events.append(cls.Event.load_event(event_data, pulse_parameter_options))
|
obj.events.append(cls.Event.load_event(event_data, pulse_parameter_options))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue