Skip to content
Snippets Groups Projects
Commit ced0d2cd authored by Laurent Mercadier's avatar Laurent Mercadier
Browse files

raise ValueError if sase is unknownn

parent 0229c1b9
No related branches found
No related tags found
1 merge request!234Only use bunch pattern table when necessary
......@@ -35,7 +35,7 @@ def npulses_has_changed(run, sase='sase3', run_mnemonics=None):
"""
Checks if the number of pulses has changed during the run for
a specific location `sase` (='sase1', 'sase3', 'scs_ppl' or 'laser')
If the source is not found, returns True.
If the source is not found in the run, returns True.
Parameters
----------
......@@ -52,6 +52,10 @@ def npulses_has_changed(run, sase='sase3', run_mnemonics=None):
True if the number of pulses has changed or the source was not
found, False if the number of pulses did not change.
"""
sase_list = ['sase1', 'sase3', 'laser', 'scs_ppl']
if sase not in sase_list:
raise ValueError(f"Unknow sase location '{sase}'. Expected one in"
f"{sase_list}")
if run_mnemonics is None:
run_mnemonics = mnemonics_for_run(run)
if sase == 'scs_ppl':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment