Repository navigation
Report the guard band's actual depth - #13
Merged
Merged
Conversation
Loop leaves out forecast points where nothing changes, so a forecast may have no point near 60 min, where the band is deepest. bandDepth is now the most the band lowered any point of the forecast, not the band's depth at 60 min.
This was referenced Oct 25, 2026
Trpl7ca
pushed a commit
to Trpl7ca/LoopWorkspace
that referenced
this pull request
Oct 25, 2026
- LoopKit/LoopAlgorithm#12: AlgorithmOutput.guardAndRunway - LoopKit/LoopAlgorithm#13: Report the guard band's actual depth - LoopKit/Loop#2611: Show and record what Guard + Runway did
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #12.
GuardAndRunwayOutput.bandDepthreported the band's depth at 60 min. Loop leaves out forecast points where nothing changes, so a forecast can have no point near 60 min. A flat forecast with no insulin or carb effects has points only out to about 56 min and then jumps to the end. In the simulator, a forecast like that was lowered about 2 mg/dL whilebandDepthsaid 12.bandDepthis now the most the band actually lowered any point of the forecast. The test now checks it equals the largest difference between the standard and guarded forecasts.swift testpasses (179).