Loop Algorithm
Opened this issue · 0 comments
The loop model currently runs without errors and follows the pyloopkit detailed instructions for implementation. However, we should add tests to ensure that the output is the same as in the Loop Swift implementation. The work is slightly started in tests/test_pyloopkit
.
Here are the answers from Pete:
There isn’t currently a command line interface, but some of the tests run a full top to bottom exercise of the algorithm using a json input file and compare to the contents of a json output file, so a command line program would essentially wrap that.
The loadScenario ones load an input and the output (recommendation). https://github.com/tidepool-org/LoopAlgorithm/blob/main/Tests/LoopAlgorithmTests/LoopAlgorithmTests.swift#L28
LoopAlgorithmTests.swift
let (input, recommendation) = loadScenario("suspend")
tidepool-org/LoopAlgorithm
Test live capture also tests the predicted glucose curve: https://github.com/tidepool-org/LoopAlgorithm/blob/main/Tests/LoopAlgorithmTests/LoopAlgorithmTests.swift#L148
LoopAlgorithmTests.swift
func testLiveCapture() {
We can use these instructions to check the swift model output using different mock data files and compare the loop predictions.