Commit 3aeeeb0
authored
Cap prediction cone to shortest predBG array length (#653)
Fixes #637.
The cone of uncertainty in updateOpenAPSPredictionDisplay() was capped
at the longest predBG array (.max()), which let the band visibly deform
at the tail as shorter arrays dropped out one by one.
Cap at the shortest array length instead so every cone point is computed
from the same set of contributing arrays. Matches Trio's ForecastSetup
(Trio/Sources/Modules/Home/HomeStateModel+Setup/ForecastSetup.swift),
which uses allForecastValues.map(\.count).min() and then iterates
0 ..< localMinCount.
Renamed maxLength to coneLength since the variable no longer represents
a max.1 parent 17991b7 commit 3aeeeb0
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2062 | 2062 | | |
2063 | 2063 | | |
2064 | 2064 | | |
2065 | | - | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
2066 | 2068 | | |
2067 | | - | |
| 2069 | + | |
2068 | 2070 | | |
2069 | 2071 | | |
2070 | 2072 | | |
| |||
0 commit comments