An example of how to include a custom dosing / LED / temperature automation
This is an example repository for creating a custom automation for the Pioreactor. By turning your automation into a repository, it can be installed easier into your Pioreactor cluster, and can be shared with others:
If available on PyPI:
pio install-plugin <plugin-name>
(And also pios to install across your entire cluster.)
If avaiable on Github:
pio install-plugin <plugin-name> --url <git+ url>
Components to make your own automation plugin
Python logic
This is the core logic that interacts with the pioreactor software. See the class MyCustomDosingAutomation for details. Note the following:
- subclasses from
DosingAutomationContrib,LEDAutomationContrib, orTemperatureAutomationContrib - requires a
key - requires an
execute
There are many other examples of automations in our core repository
It's important that the class is in this the main __init__.py, as this is how DosingController discovers it.
setup.py
This can be copy-pasted into your project, with the fields updated. The most important field is
entry_points={'pioreactor.plugins': 'pioreactor_custom_dosing_automation = pioreactor_custom_dosing_automation'},
This is necessary, and your code should be updated with the correct name of your plugin.
Adding specific settings to config.ini
Using the file additional_config.ini (must be located in the source code's folder), you can add user-editable settings for your automation. This will be merged into the config.ini.
Adding your automation to the UI
You can specify the automation in the automation drop-down in the UI, and specify its fields and default values to be shown to the user.
Create a folder called ui in the source code folder. Inside it, create a folder called contrib. And inside that, create a folder depending on your automation type: dosing, led, or temperature. See below for example directory structure.
MANIFEST.in
In order for Python to include ui and/or additional_config.ini, we need to specify them in a MANIFEST.in file. Copy-paste the MANIFEST.in from this project, and make the appropriate substitutions in its contents.
Example directory structure for your plugin
plugin_name/
__init__.py
other_python_files.py
additional_config.ini
ui/
contrib/
automations/
dosing/
plugin_name.yaml OR
led/
plugin_name.yaml OR
temperature/
plugin_name.yaml
setup.py
MANIFEST.in
Metadata
Release files for pioreactor-custom-dosing-automation 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pioreactor_custom_dosing_automation-0.0.1.tar.gz | 4.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pioreactor_custom_dosing_automation-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / pioreactor_custom_dosing_automation-0.0.1.tar.gz
| Download URL | pioreactor_custom_dosing_automation-0.0.1.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ed271398cd0891d2a81c3724cbcee2ec1fe5693422ca5cf561fa981bad912b87
|
|
BLAKE2b-256 checksum How to use checksums |
3c9bc8ea20d4b2cdc22ee469b4572b8fceb046bf85f7b5d375c6c317cbe63fdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|
Release files / pioreactor_custom_dosing_automation-0.0.1-py3-none-any.whl
| Download URL | pioreactor_custom_dosing_automation-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
050c66d6a27dfac2dbb2113e41d6ba714903e16efdee03fcd09540e78a0c5df3
|
|
BLAKE2b-256 checksum How to use checksums |
0d758e689e2fbf29066a456779b2676c6f37a119bb0f0fe0e600b2aa22da16b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|