diff --git a/pioreactor/automations/__init__.py b/pioreactor/automations/__init__.py index 834a5acd..e69de29b 100644 --- a/pioreactor/automations/__init__.py +++ b/pioreactor/automations/__init__.py @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import annotations - -# from . import dosing -# from . import events -# from . import led -# from . import temperature diff --git a/pioreactor/background_jobs/dosing_automation.py b/pioreactor/background_jobs/dosing_automation.py index b12fe3f0..58d0821f 100644 --- a/pioreactor/background_jobs/dosing_automation.py +++ b/pioreactor/background_jobs/dosing_automation.py @@ -736,7 +736,6 @@ def start_dosing_automation( experiment: Optional[str] = None, **kwargs, ) -> DosingAutomationJob: - # TODO: find the automation class from automation_name, set it to klass unit = unit or whoami.get_unit_name() experiment = experiment or whoami.get_assigned_experiment_name(unit) klass = available_dosing_automations[automation_name] diff --git a/pioreactor/background_jobs/led_automation.py b/pioreactor/background_jobs/led_automation.py index dec6a4a6..6e892036 100644 --- a/pioreactor/background_jobs/led_automation.py +++ b/pioreactor/background_jobs/led_automation.py @@ -324,10 +324,14 @@ def start_led_automation( experiment: Optional[str] = None, **kwargs, ) -> LEDAutomationJob: - # TODO: find the automation class from automation_name, set it to klass unit = unit or whoami.get_unit_name() experiment = experiment or whoami.get_assigned_experiment_name(unit) - klass = available_led_automations[automation_name] + try: + klass = available_led_automations[automation_name] + except KeyError: + raise KeyError( + f"Unable to find {automation_name}. Available automations are {list(available_led_automations.keys())}" + ) return klass( unit=unit, diff --git a/pioreactor/background_jobs/temperature_automation.py b/pioreactor/background_jobs/temperature_automation.py index 423ab4fc..ada9e1fb 100644 --- a/pioreactor/background_jobs/temperature_automation.py +++ b/pioreactor/background_jobs/temperature_automation.py @@ -675,10 +675,14 @@ def start_temperature_automation( experiment: Optional[str] = None, **kwargs, ) -> TemperatureAutomationJob: - # TODO: find the automation class from automation_name, set it to klass unit = unit or whoami.get_unit_name() experiment = experiment or whoami.get_assigned_experiment_name(unit) - klass = available_temperature_automations[automation_name] + try: + klass = available_temperature_automations[automation_name] + except KeyError: + raise KeyError( + f"Unable to find {automation_name}. Available automations are {list( available_temperature_automations.keys())}" + ) if "skip_first_run" in kwargs: del kwargs["skip_first_run"] diff --git a/setup.py b/setup.py index ab1d6ca1..d5cb88cb 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ LEADER_REQUIREMENTS = [ "blinker==1.8.2", - "Flask==3.0.2", + "flask==3.0.2", "flup6==1.1.1", "huey==2.5.0", "ifaddr==0.2.0",