Skip to content

Commit

Permalink
fix tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Nov 28, 2023
1 parent a5a4636 commit b5934a6
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 43 deletions.
23 changes: 15 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
### Upcoming
- Fix experiment profile validation error
- The "Stop" button is always available now in the "Dosing" tab for "Manage all Pioreactors".
- Fix for Ngrok remote access.
- `ws_url` in the configuration now requires a fully qualified url. Example: `ws://...` or `wss://...`.

#### Breaking changes
- Merged the turbidostat automations into one. You can either select target target nOD or target OD, but not both!
- `ws_url` in the configuration now requires a fully qualified url. Example: `ws://...` or `wss://...`.
- Removed `morbidostat` dosing automation, users should try to use pid_morbidostat. The morbidostat code is still available to be added as a custom plugin here: https://github.com/Pioreactor/automation-examples/blob/main/dosing/morbidostat.py
- Removed `constant_duty_cycle` temperature automation. Again, the code is available here: https://github.com/Pioreactor/automation-examples/blob/main/temperature/constant_duty_cycle.py

#### Enhancements
- Both "Target OD" and "Target nOD" displayed and editable in the UI.
- `pid_morbidostat` now explicitly uses the keyword arg `target_normalized_od`, instead of `target_od`. It always has been nOD.
- Previously, if the LED channel was locked (most common when OD reading was running), then any changes to the LED intensity (via the UI) would be silently rejected. This is changed: we have added retry logic that will attempt to keep changing it a few more times (hopefully to avoid the lock)
- Fixed a race condition between starting an automation and not getting OD data in time.
- `pid_morbidostat` now explicitly uses the keyword arg `target_normalized_od`, instead of `target_od`. It always has been nOD.
- Added some light form validation in the automations dialog in the UI.
- New environment variable to skip loading plugins, `SKIP_PLUGINS`. Useful for debugging. Ex:
```
SKIP_PLUGINS=1 pio run stirring
```

#### Bug Fixes
- Fix experiment profile validation error
- The "Stop" button is always available now in the "Dosing" tab for "Manage all Pioreactors".
- Fix for Ngrok remote access.
- Fixed a race condition between starting an automation and not getting OD data in time.
- The automation form in the UI for pid_morbidostat was missing `volume`, that's been added now.
- Removed `morbidostat` dosing automation, users should try to use pid_morbidostat. The morbidostat code is still available to be added as a custom plugin here: https://github.com/Pioreactor/automation-examples/blob/main/dosing/morbidostat.py
- Removed `constant_duty_cycle` temperature automation. Again, the code is available here: https://github.com/Pioreactor/automation-examples/blob/main/temperature/constant_duty_cycle.py


### 23.11.18
- No more waiting around for growth-rate-calculating to get to "Ready" state
Expand Down
72 changes: 38 additions & 34 deletions pioreactor/tests/test_automation_yamls.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,41 @@ def get_specific_yaml(path):


def test_automations_and_their_yamls_have_the_same_data():
for automation_name, klass in LEDController.available_automations.items():
data = get_specific_yaml(f"contrib/automations/led/{automation_name}.yaml")
assert data["automation_name"] == automation_name

# check yaml -> settings
for field in data["fields"]:
key = field["key"]
assert field["unit"] == klass.published_settings[key]["unit"]

# check settings -> yaml
for setting in klass.published_settings:
assert any([f["key"] == setting for f in data["fields"]])

for automation_name, klass in DosingController.available_automations.items():
data = get_specific_yaml(f"contrib/automations/dosing/{automation_name}.yaml")
assert data["automation_name"] == automation_name

for field in data["fields"]:
key = field["key"]
assert field["unit"] == klass.published_settings[key]["unit"]

for setting in klass.published_settings:
assert any([f["key"] == setting for f in data["fields"]])

for automation_name, klass in TemperatureController.available_automations.items():
data = get_specific_yaml(f"contrib/automations/temperature/{automation_name}.yaml")
assert data["automation_name"] == automation_name

for field in data["fields"]:
key = field["key"]
assert field["unit"] == klass.published_settings[key]["unit"]

for setting in klass.published_settings:
assert any([f["key"] == setting for f in data["fields"]])
try:
for automation_name, klass in LEDController.available_automations.items():
data = get_specific_yaml(f"contrib/automations/led/{automation_name}.yaml")
assert data["automation_name"] == automation_name

# check yaml -> settings
for field in data["fields"]:
key = field["key"]
assert field["unit"] == klass.published_settings[key]["unit"]

# check settings -> yaml
for setting in klass.published_settings:
assert any([f["key"] == setting for f in data["fields"]])

for automation_name, klass in DosingController.available_automations.items():
data = get_specific_yaml(f"contrib/automations/dosing/{automation_name}.yaml")
assert data["automation_name"] == automation_name

for field in data["fields"]:
key = field["key"]
assert field["unit"] == klass.published_settings[key]["unit"]

for setting in klass.published_settings:
assert any([f["key"] == setting for f in data["fields"]])

for automation_name, klass in TemperatureController.available_automations.items():
data = get_specific_yaml(f"contrib/automations/temperature/{automation_name}.yaml")
assert data["automation_name"] == automation_name

for field in data["fields"]:
key = field["key"]
assert field["unit"] == klass.published_settings[key]["unit"]

for setting in klass.published_settings:
assert any([f["key"] == setting for f in data["fields"]])
except Exception as e:
print(automation_name, klass)
raise e
2 changes: 1 addition & 1 deletion pioreactor/tests/test_led_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_light_duration_hour_to_zero() -> None:
unit=unit,
experiment=experiment,
) as lc:
pause(12)
pause(22)
assert lc.automation_job.light_active

lc.automation_job.set_light_duration_minutes(60 * 0)
Expand Down

0 comments on commit b5934a6

Please sign in to comment.