Skip to content

Commit ea81f50

Browse files
some updateS
1 parent 6a8a173 commit ea81f50

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/test-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- uses: actions/setup-node@v3
1717
with:
18-
node-version: 16.x
18+
node-version: 18.x
1919
cache: npm
2020

2121
- name: Install dependencies

developer-guide/03-Background jobs/03-avoiding-od.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class JustPause(BackgroundJobWithDodgingContrib):
2121
```python
2222
class JustPause(BackgroundJobWithDodgingContrib):
2323

24-
...
24+
def __init__(self, ...):
25+
super().__init__(..., enable_dodging_od=True or False) # set to True if you want the dodging behaviour right away.
2526

2627

2728
def action_to_do_before_od_reading(self):
@@ -43,6 +44,9 @@ You can handle the "dodging" case and "continuous" with the `initialize_*` metho
4344
```python
4445
class JustPause(BackgroundJobWithDodgingContrib):
4546

47+
def __init__(self, ...):
48+
super().__init__(..., enable_dodging_od=True or False) # set to True if you want the dodging behaviour right away.
49+
4650
...
4751

4852
def initialize_dodging_operation(self):
@@ -68,7 +72,7 @@ class JustPause(BackgroundJobWithDodgingContrib):
6872
[<job_name>]
6973
pre_delay_duration=<float>
7074
post_delay_duration=<float>
71-
enable_dodging_od=1 # 1 if you want the behaviour, 0 to disable it.
75+
enable_dodging_od=1
7276
```
7377

7478
The diagram of timing, actions, and OD reading, looks like the following:

developer-guide/08-Custom pumps/20-writing-pump-software.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ may be provided via another system, for example an Arduino.
1414
The first thing to do is to add a hook to your custom pump into Pioreactor's software. To do this, we attach new functions to a dosing automation that are invoked when `execute_io_action` is called. These functions will call your logic that runs the external pump. Specifically, if we wish to overwrite the `media` pump, we create a function called `add_media_to_bioreactor`, with signature
1515

1616
```
17-
(cls, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client: pioreactor.pubsub.Client) -> float)
17+
(cls, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client: pioreactor.pubsub.Client, logger: logger) -> float)
1818
```
1919

2020
To see this in an example:
@@ -30,12 +30,12 @@ class CustomPumper(DosingAutomationJob):
3030
def __init__(self, **kwargs):
3131
super().__init__(**kwargs)
3232

33-
def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
33+
def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client, logger) -> float:
3434
# overrides the built in add_media_to_bioreactor
3535
# add your custom logic here. Example could be interfacing with i2c, serial, PWM, etc.
3636
...
3737
pwm = PWM(...)
38-
self.logger.info(f"pumping {ml}")
38+
logger.info(f"pumping {ml}")
3939
return ml
4040

4141
def execute(self):
@@ -49,17 +49,17 @@ class CustomPumper(DosingAutomationJob):
4949

5050
automation_name = "custom_pumper"
5151

52-
def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
52+
def add_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client, logger) -> float:
5353
# overrides the built in add_media_to_bioreactor
5454
...
5555
return ml
5656

57-
def add_alt_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
57+
def add_alt_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client, logger) -> float:
5858
# overrides the built in remove_waste_from_bioreactor
5959
...
6060
return ml
6161

62-
def remove_waste_from_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
62+
def remove_waste_from_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client, logger) -> float:
6363
# overrides the built in remove_waste_from_bioreactor
6464
...
6565
return ml
@@ -83,7 +83,7 @@ class ThreePumps(DosingAutomationJob):
8383

8484
automation_name = "three_pumps"
8585

86-
def add_salty_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client) -> float:
86+
def add_salty_media_to_bioreactor(self, ml: float, unit: str, experiment: str, source_of_event: str, mqtt_client, logger) -> float:
8787
# call an external pump, via i2c, serial, GPIO, etc.,
8888
# or pumping_functions.add_salt_media
8989
...

0 commit comments

Comments
 (0)