Skip to content
Snippets Groups Projects
Commit 07c10e03 authored by Karim Ahmed's avatar Karim Ahmed
Browse files

fix: use if/raise instead of assert

parent aa60bebc
No related branches found
No related tags found
1 merge request!1035feat[Jungfrau][Dark]: use CalibrationData to retrieve prior CCVs
This commit is part of merge request !1035. Comments created here will be created in the context of that merge request.
...@@ -500,8 +500,10 @@ class CalibrationData(Mapping): ...@@ -500,8 +500,10 @@ class CalibrationData(Mapping):
begin_at_strategy="closest", begin_at_strategy="closest",
): ):
accepted_strategies = ["closest", "prior"] accepted_strategies = ["closest", "prior"]
strategy_error_msg = f"Invalid begin_at_strategy. Expected one of {accepted_strategies}" if begin_at_strategy not in accepted_strategies:
assert begin_at_strategy in accepted_strategies, strategy_error_msg raise ValueError(
"Invalid begin_at_strategy. "
f"Expected one of {accepted_strategies}")
if calibrations is None: if calibrations is None:
calibrations = set(condition.calibration_types) calibrations = set(condition.calibration_types)
......
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