Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Jul 24, 2024
1 parent dfa6264 commit 73040c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pioreactor/background_jobs/led_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def set_led_intensity(self, channel: pt.LedChannel, intensity: pt.LedIntensityVa
A float between 0-100, inclusive.
"""
attempts = 12
attempts = 6
for _ in range(attempts):
success = led_intensity(
{channel: intensity},
Expand Down
2 changes: 1 addition & 1 deletion pioreactor/background_jobs/od_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ def _determine_best_ir_led_intensity(
initial_ir_intensity / culture_on_signal * 3.0
) / 50 # divide by N since the culture is unlikely to Nx.

ir_intensity_max = 85.0
ir_intensity_max = 80.0
return min(ir_intensity_max, ir_intensity_argmax_ANGLE_can_be, ir_intensity_argmax_REF_can_be)

def _prepare_post_callbacks(self) -> list[Callable]:
Expand Down
14 changes: 14 additions & 0 deletions pioreactor/tests/test_temperature_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ def test_setting_pid_control_after_startup_will_start_some_heating() -> None:
assert t.heater_duty_cycle > 0


def test_setting_heat_is_turned_off_when_paused() -> None:
# this test tries to replicate what a user does in the UI
experiment = "test_setting_pid_control_after_startup_will_start_some_heating"
with Thermostat(unit=unit, experiment=experiment, target_temperature=35) as t:
pause(2)
assert t.state == t.READY
assert t.heater_duty_cycle > 0

t.set_state(t.SLEEPING)

assert t.state == t.SLEEPING
assert t.heater_duty_cycle == 0


def test_duty_cycle_is_published_and_not_settable() -> None:
experiment = "test_duty_cycle_is_published_and_not_settable"
dc_msgs = []
Expand Down

0 comments on commit 73040c2

Please sign in to comment.