Skip to content

Commit 6e9347e

Browse files
changes for 24.12 version
1 parent 7cb1b07 commit 6e9347e

File tree

8 files changed

+108
-160
lines changed

8 files changed

+108
-160
lines changed

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

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,33 @@ class JustPause(BackgroundJobWithDodgingContrib):
3636

3737
```
3838

39-
3. We also want some "buffer" time before and after an OD reading. For example, if using a bubbler, we want the bubbles to dissipate completely before taking an OD reading. We should stop bubbling early then. To set these times, add the following to your config.ini:
39+
3. You should also consider what the job should do if OD reading isn't turned on. That is, what should the default behaviour be without OD reading. Also, what should occur when the OD reading is turned on _late_.
40+
41+
You can handle the "dodging" case and "continuous" with the `initialize_*` methods:
42+
43+
```python
44+
class JustPause(BackgroundJobWithDodgingContrib):
45+
46+
...
47+
48+
def initialize_dodging_operation(self):
49+
self.logger("OD reading is ON and I'm enabled for dodging, so set up what I need...")
50+
51+
def initialize_continuous_operation(self):
52+
self.logger("OD reading is off, or being ignored, so set up what I need for that...")
53+
54+
def action_to_do_before_od_reading(self):
55+
# example
56+
self.logger.debug("Pausing")
57+
self.stop_pumping()
58+
59+
def action_to_do_after_od_reading(self):
60+
# example
61+
self.logger.debug("Unpausing")
62+
self.start_pumping()
63+
```
64+
65+
4. We also want some "buffer" time before and after an OD reading. For example, if using a bubbler, we want the bubbles to dissipate completely before taking an OD reading. We should stop bubbling early then. To set these times, add the following to your config.ini:
4066

4167
```
4268
[<job_name>]

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ fields:
206206

207207
There are lots of examples of automation yaml files [here](https://github.com/Pioreactor/pioreactorui/tree/master/contrib/automations).
208208

209-
#### 5. Optional: adding tables to the SQL store
209+
#### 5. Optional: adding tables to the SQL database and exposing them on the Export Data page
210210

211211
You can also add a file called `additional_sql.sql` that will run against the SQLite database. For example, a CO₂ sensor may want to create a new table in the database to store its sensor data. It's `additional_sql.sql` may look like:
212212

@@ -267,6 +267,33 @@ include <PLUGIN_NAME>/additional_sql.sql
267267

268268
See an example plugin that uses this idea [here](https://github.com/Pioreactor/co2-reading-plugin).
269269

270+
----
271+
272+
Now that you've added the code for adding to the database, you can also allow users to export your data from the UI's Export Data page. To do this, added a new folder `/exportable_datasets` to your project's source folder (along side the `__init__.py` file), and add a YAML file:
273+
274+
```yaml
275+
dataset_name: some_unique_dataset_name
276+
default_order_by: timestamp # for example
277+
description: A lovely description which shows up in the UI
278+
display_name: A lovely name which shows up in the UI
279+
has_experiment: true # does your SQL table have an experiment column.?
280+
has_unit: true # does your SQL table have an pioreactor_unit column.?
281+
source: your_plugin_name
282+
table: the_target_table # see also query below
283+
timestamp_columns:
284+
- timestamp
285+
always_partition_by_unit: false
286+
query: SELECT * FROM the_target_table WHERE reading < 4 AND ... # optional: you can specify a query.
287+
```
288+
289+
You can add multiple dataset YAML files, too.
290+
291+
:::note
292+
Include the following in your MANIFEST.IN:
293+
```
294+
recursive-include your_plugin_name/exportable_datasets *.yaml
295+
```
296+
:::
270297

271298
#### 6. Optional: adding a custom chart to the UI
272299

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Adding datasets to the Export Data page
3+
slug: /dataset-to-ui
4+
---
5+
6+
You can allow users to export your data from the UI's Export Data page. To do this, add a YAML file to `~/.pioreactor/plugins/exportable_datasets` with the following information:
7+
8+
```yaml
9+
dataset_name: some_unique_dataset_name
10+
default_order_by: timestamp # for example
11+
description: A lovely description which shows up in the UI
12+
display_name: A lovely name which shows up in the UI
13+
has_experiment: true # does your SQL table have an experiment column.?
14+
has_unit: true # does your SQL table have an pioreactor_unit column.?
15+
source: app
16+
table: the_target_table # see also query below
17+
timestamp_columns:
18+
- timestamp
19+
always_partition_by_unit: false
20+
query: SELECT * FROM the_target_table WHERE reading < 4 AND ... # optional: you can specify a query.
21+
```
22+
23+
After adding this file, visit the Export Page in the UI.

developer-guide/30-Development/01-local-development.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ slug: /local-development
1414
pip3 install -e .
1515
pip3 install -r requirements/requirements_dev.txt
1616
```
17-
4. In the pioreactor folder, create a folder called `.pioreactor/` and `.pioreactor/storage`.
17+
4. In the pioreactor folder, create a folder called `.pioreactor/` and other important subdirectories.
1818
```
1919
mkdir .pioreactor
20-
mkdir .pioreactor/storage
20+
mkdir .pioreactor/storage .pioreactor/plugins .pioreactor/exportable_datasets
2121
```
22-
5. The configuration file that is used is `config.dev.ini`, and is provided in the repository.
22+
5. The configuration file that is used is `config.dev.ini`, and is provided in the repository. Move this to `.pioreactor/`.
2323
2424
### MQTT
2525

package-lock.json

Lines changed: 11 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"@docusaurus/theme-classic": "^3.0.1",
2020
"@docusaurus/theme-common": "^3.0.1",
2121
"@easyops-cn/docusaurus-search-local": "^0.38.1",
22-
"@emeraldpay/hashicon-react": "^0.5.2",
2322
"@mdx-js/react": "^3.0.0",
2423
"@svgr/webpack": "^5.5.0",
2524
"clsx": "^1.1.1",
@@ -31,7 +30,8 @@
3130
"rehype-katex": "^7.0.0",
3231
"rehype-math": "^0.2.0",
3332
"remark-math": "^6.0.0",
34-
"url-loader": "^4.1.1"
33+
"url-loader": "^4.1.1",
34+
"boring-avatars": "^1.11.2"
3535
},
3636
"browserslist": {
3737
"production": [

src/components/HomepageFeatures.module.css

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@
1010
width: auto;
1111
margin-bottom: 10px;
1212
transition: transform 0.4s ease, fill 0.4s ease;
13+
}
1314

15+
.featureSvg, .featureCard {
16+
transition: transform 0.3s ease, box-shadow 0.3s ease, fill 0.3s ease;
1417
}
1518

1619
.featureCard {
17-
transition: transform 0.4s ease, box-shadow 0.4s ease;
18-
border-radius: 8px; /* Optional: for rounded corners */
19-
padding: 16px;
20+
transition: transform 0.3s ease, box-shadow 0.3s ease;
21+
border-radius: 8px;
22+
padding: 24px; /* Increased padding for more breathing room */
23+
text-align: center; /* Ensure content stays centered */
2024
}
2125

26+
2227
.featureCard:hover {
23-
transform: translateY(-2px); /* Less lift */
24-
box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1); /* Softer shadow */
28+
transform: translateY(-1px); /* Slight hover effect */
29+
box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08); /* Softer shadow */
2530
}
2631

2732

2833
.featureCard:hover .featureSvg {
29-
transform: scale(1.05); /* Slightly smaller scale */
30-
fill: #FFB84D; /* Subtle color change */
34+
transform: scale(1.03); /* Even smaller scale */
35+
fill: #FFCC80; /* Softer, lighter color */
3136
}
3237

0 commit comments

Comments
 (0)