pioreactor-precision-temperature-plugin 0.2.8__tar.gz → 0.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {pioreactor_precision_temperature_plugin-0.2.8/pioreactor_precision_temperature_plugin.egg-info → pioreactor_precision_temperature_plugin-0.2.9}/PKG-INFO +1 -1
  2. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/fir_temperature_automation.py +3 -2
  3. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9/pioreactor_precision_temperature_plugin.egg-info}/PKG-INFO +1 -1
  4. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/setup.py +1 -1
  5. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/tests/test_fir_temperature_automation.py +30 -0
  6. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/LICENSE.txt +0 -0
  7. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/MANIFEST.in +0 -0
  8. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/README.md +0 -0
  9. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/THIRD_PARTY_LICENSE_ADAFRUIT_MLX90632.txt +0 -0
  10. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/__init__.py +0 -0
  11. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/adafruit_mlx90632.py +0 -0
  12. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/additional_config.ini +0 -0
  13. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/estimators/fir_temperature_estimator_linear_mlx_ambient_pcb_v1.yaml +0 -0
  14. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/post_install.sh +0 -0
  15. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin/ui/contrib/charts/temperature.yaml +0 -0
  16. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin.egg-info/SOURCES.txt +0 -0
  17. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin.egg-info/dependency_links.txt +0 -0
  18. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin.egg-info/entry_points.txt +0 -0
  19. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/pioreactor_precision_temperature_plugin.egg-info/top_level.txt +0 -0
  20. {pioreactor_precision_temperature_plugin-0.2.8 → pioreactor_precision_temperature_plugin-0.2.9}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pioreactor-precision-temperature-plugin
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: Precision temperature automation for Pioreactor using FIR + MLX90632
5
5
  Home-page: https://github.com/Pioreactor/pioreactor-precision-temperature-plugin
6
6
  Author: Cam Davidson-Pilon
@@ -71,6 +71,7 @@ STABILIZATION_MAX_SLOPE_C_PER_MIN = 0.02
71
71
  STABILIZATION_WINDOW_S = 2.0 * 60
72
72
  STABILIZATION_SLOPE_SAMPLE_DELAY_S = 4.1
73
73
  STABILIZATION_TIMEOUT_S = 90 * 60
74
+ DANGER_ZONE_DUTY_CYCLE_REDUCTION_FACTOR = 0.9965
74
75
 
75
76
  available_temperature_automations: dict[str, type["TemperatureAutomationJobFIR"]] = {}
76
77
 
@@ -365,9 +366,9 @@ class TemperatureAutomationJobFIR(AutomationJob):
365
366
 
366
367
  elif temp > self.MAX_TEMP_TO_REDUCE_HEATING:
367
368
  self.logger.debug(
368
- f"Temperature of heating surface exceeded {self.MAX_TEMP_TO_REDUCE_HEATING}℃ (currently {temp}℃). Reducing heater by 10%."
369
+ f"Temperature of heating surface exceeded {self.MAX_TEMP_TO_REDUCE_HEATING}℃ (currently {temp}℃). Reducing heater slightly."
369
370
  )
370
- self._update_heater(self.heater_duty_cycle * 0.9)
371
+ self._update_heater(self.heater_duty_cycle * DANGER_ZONE_DUTY_CYCLE_REDUCTION_FACTOR)
371
372
 
372
373
  return temp
373
374
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pioreactor-precision-temperature-plugin
3
- Version: 0.2.8
3
+ Version: 0.2.9
4
4
  Summary: Precision temperature automation for Pioreactor using FIR + MLX90632
5
5
  Home-page: https://github.com/Pioreactor/pioreactor-precision-temperature-plugin
6
6
  Author: Cam Davidson-Pilon
@@ -4,7 +4,7 @@ from setuptools import setup
4
4
 
5
5
  setup(
6
6
  name="pioreactor-precision-temperature-plugin",
7
- version="0.2.8",
7
+ version="0.2.9",
8
8
  python_requires=">=3.13,<3.14",
9
9
  license_files=("LICENSE.txt",),
10
10
  description="Precision temperature automation for Pioreactor using FIR + MLX90632",
@@ -412,6 +412,36 @@ def test_update_heater_respects_pwm_lock() -> None:
412
412
  assert calls == [50.0]
413
413
 
414
414
 
415
+ def test_check_if_exceeds_max_temp_reduces_heater_gently_in_danger_zone(
416
+ monkeypatch: pytest.MonkeyPatch,
417
+ ) -> None:
418
+ monkeypatch.setattr(
419
+ fta,
420
+ "get_pioreactor_model",
421
+ lambda: SimpleNamespace(
422
+ max_temp_to_reduce_heating=50.0,
423
+ max_temp_to_disable_heating=60.0,
424
+ max_temp_to_shutdown=70.0,
425
+ ),
426
+ )
427
+
428
+ job: Any = object.__new__(fta.TemperatureAutomationJobFIR)
429
+ job.heater_duty_cycle = 80.0
430
+ job.logger = SimpleNamespace(debug=lambda *_args, **_kwargs: None)
431
+ reductions: list[float] = []
432
+
433
+ def fake_update_heater(new_dc: float) -> bool:
434
+ reductions.append(new_dc)
435
+ return True
436
+
437
+ job._update_heater = fake_update_heater
438
+
439
+ observed_temp = job._check_if_exceeds_max_temp(55.0)
440
+
441
+ assert observed_temp == pytest.approx(55.0)
442
+ assert reductions == [pytest.approx(80.0 * fta.DANGER_ZONE_DUTY_CYCLE_REDUCTION_FACTOR)]
443
+
444
+
415
445
  def test_bias_trim_probe_step_ui_uses_store_estimator(monkeypatch: pytest.MonkeyPatch) -> None:
416
446
  base = SimpleNamespace(
417
447
  estimator_name="baseline-estimator",