diff --git a/pioreactor/actions/leader/experiment_profile.py b/pioreactor/actions/leader/experiment_profile.py index 012ca8e4..7b085bf5 100644 --- a/pioreactor/actions/leader/experiment_profile.py +++ b/pioreactor/actions/leader/experiment_profile.py @@ -547,7 +547,7 @@ def _callable() -> None: "env": {"JOB_SOURCE": "experiment_profile", "EXPERIMENT": experiment}, "args": args, }, - ) + ).raise_for_status() else: logger.debug(f"Action's `if` condition, `{if_}`, evaluated False. Skipping action.") @@ -584,7 +584,7 @@ def _callable() -> None: patch_into_leader( f"/api/workers/{unit}/jobs/update/job_name/{job_name}/experiments/{experiment}", json={"settings": {"$state": "sleeping"}}, - ) + ).raise_for_status() else: logger.debug(f"Action's `if` condition, `{if_}`, evaluated False. Skipping action.") @@ -622,7 +622,7 @@ def _callable() -> None: patch_into_leader( f"/api/workers/{unit}/jobs/update/job_name/{job_name}/experiments/{experiment}", json={"settings": {"$state": "ready"}}, - ) + ).raise_for_status() else: logger.debug(f"Action's `if` condition, `{if_}`, evaluated False. Skipping action.") @@ -659,7 +659,7 @@ def _callable() -> None: logger.debug(f"Stopping {job_name} on {unit}.") patch_into_leader( f"/api/workers/{unit}/jobs/stop/job_name/{job_name}/experiments/{experiment}", - ) + ).raise_for_status() else: logger.debug(f"Action's `if` condition, `{if_}`, evaluated False. Skipping action.") @@ -701,7 +701,7 @@ def _callable() -> None: patch_into_leader( f"/api/workers/{unit}/jobs/update/job_name/{job_name}/experiments/{experiment}", json={"settings": {setting: value}}, - ) + ).raise_for_status() else: logger.debug(f"Action's `if` condition, `{if_}`, evaluated False. Skipping action.") @@ -763,7 +763,7 @@ def push_labels_to_ui(experiment, labels_map: dict[str, str]) -> None: for unit_name, label in labels_map.items(): patch_into_leader( f"/api/experiments/{experiment}/unit_labels", json={"unit": unit_name, "label": label} - ) + ).raise_for_status() except Exception: pass diff --git a/pioreactor/calibrations/stirring_calibration.py b/pioreactor/calibrations/stirring_calibration.py index e8719d36..1abe93e5 100644 --- a/pioreactor/calibrations/stirring_calibration.py +++ b/pioreactor/calibrations/stirring_calibration.py @@ -50,9 +50,9 @@ def run_stirring_calibration( # go up and down to observe any hysteresis. dcs = ( - list(range(round(max_dc), round(min_dc), -3)) - + list(range(round(min_dc), round(max_dc), 3)) - + list(range(round(max_dc), round(min_dc), -3)) + list(range(round(max_dc), round(min_dc) - 3, -3)) + + list(range(round(min_dc), round(max_dc) + 3, 3)) + + list(range(round(max_dc), round(min_dc) - 3, -3)) ) n_samples = len(dcs) @@ -71,7 +71,7 @@ def run_stirring_calibration( for count, dc in enumerate(dcs, start=1): st.set_duty_cycle(dc) - sleep(3) + sleep(1.5) rpm = rpm_calc.estimate(2) measured_rpms.append(rpm) logger.debug(f"Detected {rpm=:.1f} RPM @ {dc=}%")