Skip to content

Commit 0c302ea

Browse files
note on dosing
1 parent 1634419 commit 0c302ea

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

developer-guide/04-Automations/02-writing-automations-1.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@ Finally, every `duration` (specified in the controller, later in this section) m
7777

7878
Since we are working with a fixed volume, `media_ml` must equal `waste_ml`, else an error will be thrown. What is `latest_od` attribute? Our class, when active, is listening to new optical densities being recorded. Hence when `execute` runs, we'll have access to the most up-to-date value of optical density. Likewise, there are also `latest_normalized_od` and `latest_growth_rate` attributes that update when a new growth-rate value is calculated. All three attributes are defined and maintained in the parent class.
7979

80+
:::tip
81+
Prefer `self.execute_io_action(...)` inside `execute`. If you need to call `add_media_to_bioreactor(...)` directly, remember to forward `mqtt_client=self.pub_client` and `logger=self.logger`:
82+
83+
```python
84+
def execute(self):
85+
if self.latest_growth_rate < self.target_mu:
86+
self.add_media_to_bioreactor(
87+
ml=self.dosing_volume,
88+
source_of_event=f"{self.job_name}:{self.automation_name}",
89+
unit=self.unit,
90+
experiment=self.experiment,
91+
mqtt_client=self.pub_client,
92+
logger=self.logger,
93+
)
94+
```
95+
96+
Without those extra arguments, your custom dosing automation can appear to run while the pump action never starts.
97+
:::
98+
8099
### Running the automation
81100

82101
How do we run this automation now? Let's copy the code into a file called `naive_turbidostat.py` and place it into the folder `~/.pioreactor/plugins`.
@@ -192,4 +211,4 @@ class NaiveTurbidostat(DosingAutomationJobContrib):
192211
else:
193212
self.execute_io_action(media_ml=self.volume, waste_ml=self.volume)
194213

195-
```
214+
```

user-guide/99-common-questions.mdx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Go to the **Inventory** page and use the **Model** dropdown on the Pioreactor ca
6767

6868

6969

70+
Glass thickness: 1.297mm +- 0.004mm
71+
72+
7073
## Optical density and LEDs
7174

7275

0 commit comments

Comments
 (0)