Skip to content

Commit 2def44c

Browse files
renaming some datasets and charts for new raw ods
1 parent a2248fa commit 2def44c

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

contrib/charts/05_od.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
chart_key: raw_optical_density
2+
chart_key: optical_density
33
data_source: od_readings # SQL table
44
title: Optical density
55
mqtt_topic: [od_reading/od1, od_reading/od2]

contrib/charts/09_raw_od.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
chart_key: raw_optical_density
3+
data_source: raw_od_readings # SQL table
4+
title: Raw optical density (uncalibrated)
5+
mqtt_topic: [od_reading/raw_od1, od_reading/raw_od2]
6+
source: app
7+
payload_key: od
8+
y_axis_label: Reading
9+
interpolation: stepAfter
10+
lookback: parseFloat(config['ui.overview.settings']['raw_od_lookback_hours'])
11+
fixed_decimals: 3
12+
y_axis_domain: [0.001, 0.05] # good default for near 0 OD, but will break out after growth.
13+
down_sample: true

pioreactorui/api.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1446,6 +1446,28 @@ def get_experiment(experiment: str) -> ResponseReturnValue:
14461446
## CONFIG CONTROL
14471447

14481448

1449+
@api.route("/unit/<pioreactor_unit>/configuration", methods=["GET"])
1450+
def get_configuration_for_pioreactor_unit(pioreactor_unit: str) -> ResponseReturnValue:
1451+
"""get configuration for a pioreactor unit"""
1452+
try:
1453+
if is_testing_env():
1454+
global_config_path = Path(env["DOT_PIOREACTOR"]) / "config.dev.ini"
1455+
else:
1456+
global_config_path = Path(env["DOT_PIOREACTOR"]) / "config.ini"
1457+
1458+
specific_config_path = Path(env["DOT_PIOREACTOR"]) / f"config_{pioreactor_unit}.ini"
1459+
1460+
config_files = [global_config_path, specific_config_path]
1461+
config = configparser.ConfigParser(strict=False)
1462+
config.read(config_files)
1463+
1464+
return {section: dict(config[section]) for section in config.sections()}
1465+
1466+
except Exception as e:
1467+
publish_to_error_log(str(e), "get_configuration_for_pioreactor_unit")
1468+
abort(400)
1469+
1470+
14491471
@api.route("/configs/<filename>", methods=["GET"])
14501472
def get_config(filename: str) -> ResponseReturnValue:
14511473
"""get a specific config.ini file in the .pioreactor folder"""

0 commit comments

Comments
 (0)