Raise when thermocycler hold time is unavailable#1010
Raise when thermocycler hold time is unavailable#1010rickwierenga merged 3 commits intoPyLabRobot:mainfrom
Conversation
Made-with: Cursor
rickwierenga
left a comment
There was a problem hiding this comment.
thanks for the PR! one small comment/ suggestion
| total_steps = await self.get_total_step_count(**backend_kwargs) | ||
| except NotImplementedError: | ||
| raise | ||
| except RuntimeError: | ||
| return False |
There was a problem hiding this comment.
do you want to raise on RuntimeError here as well? False seems incorrect
Made-with: Cursor
|
Thanks, that makes sense. I updated this so \is_profile_running()\ now propagates the \RuntimeError\ instead of returning \False\, and adjusted the test accordingly. |
There was a problem hiding this comment.
Let's maybe keep the return values in the chatterbox until we have a proper simulator for it. This breaks CI and potentially existing protocols.
Made-with: Cursor
|
Good point. I reverted the Chatterbox behavior and kept its existing |
|
thanks! |
Summary
RuntimeErrorin the Opentrons HTTP thermocycler backend when hold time is unavailable because no profile is running.is_profile_running()propagate backendRuntimeErrors instead of converting them toFalse.Fixes #635
Test plan
python -m ruff check pylabrobot/thermocycling/thermocycler.py pylabrobot/thermocycling/opentrons_backend.py pylabrobot/thermocycling/thermocycler_tests.py pylabrobot/thermocycling/opentrons_backend_tests.pypython -m pytest pylabrobot/thermocycling/thermocycler_tests.py::ThermocyclerTests::test_is_profile_running_raises_if_no_profile_runningpython -m pytest pylabrobot/thermocycling/thermocycler_tests.py::ThermocyclerTests::test_is_profile_running_preserves_not_implemented_errorpython -m pytest pylabrobot/thermocycling/opentrons_backend_tests.py::TestOpentronsThermocyclerBackend::test_get_hold_time_raises_if_not_runningskipped locally becauseot_apiis not installed.