Skip to content

Commit

Permalink
reverse order of class init args: unit is higher priority
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Sep 6, 2023
1 parent cbe868b commit f160bd9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pioreactor/actions/self_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def test_positive_correlation_between_temperature_and_heating(
) -> None:
assert is_heating_pcb_present()

with TemperatureController("only_record_temperature", unit=unit, experiment=experiment) as tc:
with TemperatureController(unit, experiment, "only_record_temperature") as tc:
measured_pcb_temps = []
dcs = list(range(0, 22, 3))
logger.debug("Varying heating.")
Expand Down
4 changes: 2 additions & 2 deletions pioreactor/background_jobs/dosing_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DosingController(BackgroundJob):
"automation_name": {"datatype": "string", "settable": False},
}

def __init__(self, automation_name: str, unit: str, experiment: str, **kwargs) -> None:
def __init__(self, unit: str, experiment: str, automation_name: str, **kwargs) -> None:
super().__init__(unit=unit, experiment=experiment)

try:
Expand Down Expand Up @@ -149,9 +149,9 @@ def start_dosing_control(
**kwargs,
) -> DosingController:
return DosingController(
automation_name,
unit=unit or whoami.get_unit_name(),
experiment=experiment or whoami.get_latest_experiment_name(),
automation_name=automation_name,
duration=duration,
skip_first_run=skip_first_run,
**kwargs,
Expand Down
4 changes: 2 additions & 2 deletions pioreactor/background_jobs/led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class LEDController(BackgroundJob):
"automation_name": {"datatype": "string", "settable": False},
}

def __init__(self, automation_name: str, unit: str, experiment: str, **kwargs) -> None:
def __init__(self, unit: str, experiment: str, automation_name: str, **kwargs) -> None:
super(LEDController, self).__init__(unit=unit, experiment=experiment)

if not hardware.is_HAT_present():
Expand Down Expand Up @@ -114,9 +114,9 @@ def start_led_control(
**kwargs,
) -> LEDController:
return LEDController(
automation_name=automation_name,
unit=unit or get_unit_name(),
experiment=experiment or get_latest_experiment_name(),
automation_name=automation_name,
skip_first_run=skip_first_run,
duration=duration,
**kwargs,
Expand Down
4 changes: 2 additions & 2 deletions pioreactor/background_jobs/temperature_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class TemperatureController(BackgroundJob):

def __init__(
self,
automation_name: str,
unit: str,
experiment: str,
automation_name: str,
**kwargs,
) -> None:
super().__init__(unit=unit, experiment=experiment)
Expand Down Expand Up @@ -564,9 +564,9 @@ def start_temperature_control(
**kwargs,
) -> TemperatureController:
return TemperatureController(
automation_name=automation_name,
unit=unit or whoami.get_unit_name(),
experiment=experiment or whoami.get_latest_experiment_name(),
automation_name=automation_name,
**kwargs,
)

Expand Down

0 comments on commit f160bd9

Please sign in to comment.