Skip to content

Commit ddfbb0d

Browse files
changelog and test
1 parent 3033ace commit ddfbb0d

File tree

3 files changed

+43
-46
lines changed

3 files changed

+43
-46
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
#### Enhancements
44
- new _System logs_ under _Inventory_ to track logs happening outside of experiments in your cluster.
5+
- Better organization of logs in the UI. System logs, like calibrations, worker additions, etc. won't show up on the Overview page.
56
- Exported data zips have folders for each dataset requested.
6-
- Improvements to the Kalman filter. For users using the growth-rate model with dosing, you should see improvements to your growth-rate time series. We recommend the following configuration:
7+
- Improvements to the Kalman filter. For users using the growth-rate model with media dosing, you should see improvements to your growth-rate time series. We recommend the following configuration:
78
```
89
[growth_rate_kalman]
910
# obs_std ↑ smooths growth rate, rate_std ↑ more responsive growth rate
@@ -14,13 +15,13 @@ rate_std=0.25
1415
- New image installs only:
1516
- updated base OS to the latest 25-05-06 Raspberry Pi OS. The big change is using Linux kernel 6.12.
1617
- Added the column `hours_since_experiment_created` to dataset exports that details hours since experiment was created.
17-
- Better organization of logs in the UI.
18+
- Performance optimizations
1819

1920
#### Bug fixes
2021
- fixed stirrer not spinning on Pioreactor page (UI) in some cases
2122
- alert user if their OD reading is constant before starting the growth-rate calculator, which would break things.
2223
- alert user if their software is installed in a non-standard location. If so, try `pio uninstall pioreactor -y`.
23-
- Added a warning if the OD calibration is invalid (constant)
24+
- Added a warning if the OD calibration is invalid (ex: a constant line)
2425

2526

2627

pioreactor/tests/test_mqtt_to_db_streaming.py

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,6 @@ def test_kalman_filter_entries() -> None:
173173
with local_persistent_storage("od_normalization_variance") as cache:
174174
cache[exp] = json.dumps({"1": 1e-6, "2": 1e-4})
175175

176-
# turn on data collection
177-
interval = 0.5
178-
od = start_od_reading(
179-
od_angle_channel1="135",
180-
od_angle_channel2="90",
181-
interval=interval,
182-
fake_data=True,
183-
unit=unit,
184-
experiment=exp,
185-
)
186-
187-
gr = GrowthRateCalculator(unit=unit, experiment=exp)
188-
189176
# turn on our mqtt to db
190177
parsers = [
191178
m2db.TopicToParserToTable(
@@ -195,37 +182,46 @@ def test_kalman_filter_entries() -> None:
195182
)
196183
]
197184

198-
m = m2db.MqttToDBStreamer(unit, exp, parsers)
199-
200-
# let data collect
201-
sleep(10)
202-
203-
cursor.execute("SELECT * FROM kalman_filter_outputs WHERE experiment = ?", (exp,))
204-
results = cursor.fetchall()
205-
assert len(results) > 0
206-
207-
cursor.execute(
208-
"SELECT state_0, state_1, state_2 FROM kalman_filter_outputs WHERE experiment = ? ORDER BY timestamp DESC LIMIT 1",
209-
(exp,),
210-
)
211-
results = cursor.fetchone()
212-
assert results[0] != 0.0
213-
assert results[1] != 0.0
214-
assert results[2] != 0.0
215-
216-
cursor.execute(
217-
"SELECT cov_00, cov_11, cov_22 FROM kalman_filter_outputs WHERE experiment = ? ORDER BY timestamp DESC LIMIT 1",
218-
(exp,),
219-
)
220-
results = cursor.fetchone()
185+
# turn on data collection
186+
interval = 0.5
221187

222-
assert results[0] != 0.0
223-
assert results[1] != 0.0
224-
assert results[2] != 0.0
188+
with (
189+
start_od_reading(
190+
od_angle_channel1="135",
191+
od_angle_channel2="90",
192+
interval=interval,
193+
fake_data=True,
194+
unit=unit,
195+
experiment=exp,
196+
),
197+
GrowthRateCalculator(unit=unit, experiment=exp),
198+
m2db.MqttToDBStreamer(unit, exp, parsers),
199+
):
200+
# let data collect
201+
sleep(10)
202+
203+
cursor.execute("SELECT * FROM kalman_filter_outputs WHERE experiment = ?", (exp,))
204+
results = cursor.fetchall()
205+
assert len(results) > 0
206+
207+
cursor.execute(
208+
"SELECT state_0, state_1, state_2 FROM kalman_filter_outputs WHERE experiment = ? ORDER BY timestamp DESC LIMIT 1",
209+
(exp,),
210+
)
211+
results = cursor.fetchone()
212+
assert results[0] != 0.0
213+
assert results[1] != 0.0
214+
assert results[2] != 0.0
215+
216+
cursor.execute(
217+
"SELECT cov_00, cov_11, cov_22 FROM kalman_filter_outputs WHERE experiment = ? ORDER BY timestamp DESC LIMIT 1",
218+
(exp,),
219+
)
220+
results = cursor.fetchone()
225221

226-
od.clean_up()
227-
gr.clean_up()
228-
m.clean_up()
222+
assert results[0] != 0.0
223+
assert results[1] != 0.0
224+
assert results[2] != 0.0
229225

230226

231227
def test_empty_payload_is_filtered_early() -> None:

pioreactor/utils/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ def __enter__(self):
344344
self.cursor.executescript(
345345
"""
346346
PRAGMA busy_timeout = 5000;
347-
PRAGMA temp_store = 2; -- stop writing small files to disk, use mem
347+
PRAGMA temp_store = 2;
348348
PRAGMA cache_size = -4000;
349349
"""
350350
)

0 commit comments

Comments
 (0)