Skip to content

Commit 4022e52

Browse files
changes for 25.2.11
1 parent cf3e35d commit 4022e52

File tree

7 files changed

+29
-28
lines changed

7 files changed

+29
-28
lines changed

developer-guide/07-Plugins/03-plugin-as-python-package.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ setup(
118118
#### 1. Your plugins Python files
119119

120120
This Python file contains the core code for your plugin. If your plugin is implementing a background job, then there should be a
121-
function decorated with `@click.command` at the bottom of the file. See example [here](https://github.com/CamDavidsonPilon/pioreactor-relay-plugin/blob/e25b46997d6e6b3b1b2e2bf1141299ddba4eaa49/pioreactor_relay_plugin/relay.py#L79-L93). For discovery reasons, this function's name **should start with `click_`**.
121+
function decorated with `@run.command` at the bottom of the file. See example [here](https://github.com/CamDavidsonPilon/pioreactor-relay-plugin/blob/e25b46997d6e6b3b1b2e2bf1141299ddba4eaa49/pioreactor_relay_plugin/relay.py#L79-L93).
122122

123123
#### 2. A Python `__init__.py` file
124124

@@ -140,10 +140,10 @@ function decorated with `@click.command` at the bottom of the file. See example
140140
Example for the relay plugin:
141141

142142
```python
143-
from pioreactor_relay_plugin.relay import click_relay
143+
from pioreactor_relay_plugin.relay import start_relay
144144
```
145145

146-
where `click_relay` is the function decorated with `@click.command`.
146+
where `start_relay` is the function decorated with `@run.command`.
147147

148148

149149
#### 3. Optional: A configuration file, named `additional_config.ini`

developer-guide/09-Storage and the filesystem/01-data-stores/01-data-stores-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Pioreactor software will automatically backup the SQLite database via a sche
1717

1818
## Local key-value datastore
1919

20-
SQLite3 is also used by the library *diskcache*. This is essentially a fast key-value store on the Raspberry Pi. For Pioreactor, we use it to store "machine-specific" data, like calibration curves, locks on GPIOs, state of LEDs, jobs running, etc. Instead of one large file containing all these keys, we have split them into multiple locations based on category and level of persistence. The persistent databases are stored in `/home/pioreactor/.pioreactor/storage` and the temporary databases are in `/tmp`. You can access them from Python using `pioreactor.utils.local_persistant_storage` and `pioreactor.utils.local_intermittent_storage`, respectively.
20+
SQLite3 is also used by the library *diskcache*. This is essentially a fast key-value store on the Raspberry Pi. For Pioreactor, we use it to store "machine-specific" data, like calibration curves, locks on GPIOs, state of LEDs, jobs running, etc. Instead of one large file containing all these keys, we have split them into multiple locations based on category and level of persistence. The persistent databases are stored in `/home/pioreactor/.pioreactor/storage` and the temporary databases are in `/tmp`. You can access them from Python using `pioreactor.utils.local_persistent_storage` and `pioreactor.utils.local_intermittent_storage`, respectively.
2121

2222
:::info
2323
What are temporary and persistent? Something like GPIO locks or LED state are physically reset between cycles of the Raspberry Pi. So when the Pi power-cycles, the state is wiped, and by have the database in `/tmp`, the databases are wiped as well.

developer-guide/20-User interface/01-introduction.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Both workers and leaders have this backend. However, workers only use expose the
2626

2727
The frontend is a React app, built with Material UI. The source code is at [pioreactorui_frontend](https://github.com/Pioreactor/pioreactorui_frontend). A lot of the "data" for the frontend comes from YAML files on the RPi's filesystem. For example, all the charts, activities, and automations are defined in their own YAML file in a `contrib` folder on the filesystem. This way, it's easy to add new data to the frontend without having to write new JS.
2828

29-
A lot of the live data
30-
3129

3230
### DNS name resolution to `pioreactor.local`
3331

@@ -41,7 +39,7 @@ To update on the UI on Pioreactor leader, use `pio update ui`. This also restart
4139
To restart:
4240

4341
```
44-
sudo systemctl restart lighttp && sudo systemctl restart huey
42+
sudo systemctl restart lighttpd && sudo systemctl restart huey
4543
```
4644

4745
### Logs

developer-guide/25-Calibrations/01-Calibrations.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,20 @@ class PHCalibration(CalibrationBase, kw_only=True, tag="ph"):
4949

5050
# not required, but helpful
5151
def voltage_to_ph(self, voltage: float) -> float:
52-
return self.predict(voltage)
52+
return self.y_to_x(voltage)
5353

5454
def ph_to_voltage(self, ph: float) -> float:
55-
return self.ipredict(ph)
55+
return self.x_to_y(ph)
5656
```
5757

5858
The `predict` and `ipredict` functions are used to convert between the two variables. The `i` in `ipredict` stands for "inverse".
5959

6060

6161

62-
## Creating a new protocol for an existing device
62+
## (Optional) Creating a new protocol for an existing device
63+
64+
If you want to add a custom script to create a calibration on the Pioreactor, you can do that by creating a new protocol.
65+
6366

6467
Define a `CalibrationProtocol` subclass that will hold metadata for your protocol. It should have a `run` method that returns a calibration (a subclass of `CalibrationBase` - see above).
6568

@@ -70,6 +73,7 @@ from pioreactor.utils.timing import current_utc_datetime
7073
class BufferBasedPHProtocol(CalibrationProtocol):
7174
target_device = "ph"
7275
protocol_name = "buffer_based"
76+
description = "Calibrate the pH sensor using buffer solutions"
7377

7478
def run(self, target_device: str) -> PHCalibration:
7579
return run_ph_calibration()
@@ -94,7 +98,7 @@ def run_ph_calibration() -> PHCalibration:
9498
```
9599

96100

97-
### Adding it to the plugins folder
101+
## Adding it to the plugins folder
98102

99103
You can add your code to the `~/.pioreactor/plugins` folder on the Pioreactor, it will auto-magically populate the CLI
100104
and UI. To complete our pH example, add the following to a new Python file in the `~/.pioreactor/plugins` folder:
@@ -111,14 +115,15 @@ class PHCalibration(CalibrationBase, kw_only=True, tag="ph"):
111115
y: str = "Voltage"
112116

113117
def voltage_to_ph(self, voltage: float) -> float:
114-
return self.predict(voltage)
118+
return self.y_to_x(voltage)
115119

116120
def ph_to_voltage(self, ph: float) -> float:
117-
return self.ipredict(ph)
121+
return self.x_to_y(ph)
118122

119123
class BufferBasedPHProtocol(CalibrationProtocol):
120124
target_device = "ph"
121125
protocol_name = "buffer_based"
126+
description = "Calibrate the pH sensor using buffer solutions"
122127

123128
def run(self, target_device: str) -> PHCalibration:
124129
return run_ph_calibration()
@@ -145,10 +150,10 @@ def run_ph_calibration() -> PHCalibration:
145150

146151
And run it with:
147152
```
148-
pio calibrations run --device ph --protocol-name buffer_based
153+
pio calibrations run --device ph
149154
```
150155

151-
### Tips
156+
## Tips
152157

153158
- use the Python library `click` to create an interactive CLI for your calibration protocol.
154159
- the pair `(device, calibration_name)` must be unique. The final directory structure looks like `~/.pioreactor/storage/calibrations/<device>/<calibration_name>.yaml`

user-guide/01-getting-started/02-software-set-up.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ We recommend running a [self-test](/user-guide/running-self-test) on all Pioreac
156156
#### My leader Pioreactor never flashes the blue LED
157157
- First, confirm that when you press the HAT button, the blue LED does not show up. If it does, you're good to go.
158158
- It's likely that the installation failed (due to a settings issue), or there is a problem with the SD card. Double check the settings that you used and try reinstalling the image.
159-
- Are you using a microSD card with a size *larger* than 32GB? You may need to reformat it to FAT32. To do this, in the Raspberry Pi Imager, first select "Erase: format card as FAT32" under "Choose OS". Then proceed with writing the image.
159+
- Are you using a microSD card with a size *larger* than 32GB or with exFAT format? You may need to reformat it to FAT32. To do this, in the Raspberry Pi Imager, first select "Erase: format card as FAT32" under "Choose OS". Then proceed with writing the image.
160160

161161

162162
#### My Pioreactor keeps flashing the blue LED

user-guide/03-Extending your Pioreactor/05-calibrate-od600.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ import * as colors from '@site/src/components/constants';
1111

1212
## Calibrating your OD600 readings
1313

14-
Depending on the purposes of your research, you may want to calibrate your Pioreactor against known samples and OD600 values. We've given you the option to do this through the command line, similar to how pump calibrations currently work. _Calibrations using the UI are coming soon!_
14+
Depending on the purposes of your research, you may want to calibrate your Pioreactor against known samples and OD600 values. We've given you the option to do this through the command line, similar to how pump and stirring calibrations currently work.
1515

16-
OD600 calibrations are straightforward, and only require one vial, your sample of interest, and an accurate way to measure liquids. We recommend a micropipette of volume range 100 to 1000 uL.
16+
There are two protocols to create an OD calibration.
17+
18+
The first requires only require one vial, your sample of interest, and an accurate way to measure liquids (we recommend a micropipette of volume range 100 to 1000 uL). The protocol works by reading a dilution series. You will start with 10mL of your sample of interest cultivated in your media, at the highest density you expect to observe. During the calibration, you will specify and add an amount of your media to dilute your sample. To avoid overflowing, the program will prompt you to reduce the volume in your vial to 10mL at set intervals. Depending on your number of measurements, you may be prompted to reduce your vial volume to 10 mL. _OPTIONAL_: At this point, you may take the OD600 reading of your vial on a different instrument and input this OD600 value for the current measurement.
19+
20+
21+
22+
The second requires multiple vials that will work as standards. This option is quicker for calibrating multiple Pioreactors, too.
1723

18-
The calibration works by reading a dilution series. You will start with 10mL of your sample of interest cultivated in your media, at the highest density you expect to observe. During the calibration, you will specify and add an amount of your media to dilute your sample. To avoid overflowing, the program will prompt you to reduce the volume in your vial to 10mL at set intervals.
1924

2025
Calibrations should be specific to your experiment setup. Any changes to your media, culture, or optical setup (i.e. changing IR intensity, replacing pieces, or changing the angle) may require a new calibration. If everything remains consistent, then we recommend running calibrations every 6 months, or whatever suits your purposes.
2126

@@ -39,9 +44,6 @@ Following the questions, stirring and optical density reading will begin. A grap
3944

4045
![Graph generated as you measure.](/img/user-guide/generating_graph.png)
4146

42-
Depending on your number of measurements, you may be prompted to reduce your vial volume to 10 mL. _OPTIONAL_: At this point, you may take the OD600 reading of your vial on a different instrument and input this OD600 value for the current measurement.
43-
44-
![Input an external OD600 value.](/img/user-guide/add_new_od600.png)
4547

4648
Once you complete all your measurements, a calibration curve will appear over your graph. If you are satisfied with this, save your calibration.
4749

@@ -74,6 +76,5 @@ pio calibrations analyze --device od --name <name of your calibration>
7476
## Sharing calibrations
7577

7678
Since the calibrations are just YAML files, you can easily share existing calibrations to other Pioreactors.
77-
```
7879

7980

user-guide/99-common-questions.mdx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ The button can be [reprogrammed](/developer-guide/hat-button), too.
3636

3737
### How do I change the date or time on the Pioreactor?
3838

39-
[SSH](/user-guide/accessing-raspberry-pi) into your Pioreactor, and run:
40-
```
41-
sudo date --set "2023-11-02 09:46:50"
39+
Under _Inventory_ -> _Leader_, there is a card titled _Cluster clocks_. You can change the date and time there.
4240

43-
```
4441

4542

4643
## Optical density and LEDs
@@ -183,7 +180,7 @@ _Note that the official Raspberry Pi microSD card (32 GB) is now included in all
183180

184181
### What power supply unit (PSU) do I need?
185182

186-
If you look at the power rating, it should be about 5 V and at least 2.25 A, or above 12 W. We really like the [official Raspberry Pi PSUs](https://www.raspberrypi.com/products/#power-supplies-and-cables), available at most places you can purchase Raspberry Pis.
183+
If you look at the power rating, it should be about 5 V and at least 2.25 A, or above 12 W. We really like the [official Raspberry Pi PSUs](https://www.raspberrypi.com/products/power-supply/), available at most places you can purchase Raspberry Pis, Amazon, etc.
187184

188185
If you need to power multiple Pioreactors, you might consider a single PSU with USB ports [detailed here](/user-guide/powering-cluster).
189186

0 commit comments

Comments
 (0)