Skip to content

[LOOP-5403] Fix Average Glucose Calculation in Preset Performance History#918

Open
Camji55 wants to merge 1 commit intodevfrom
cameron/LOOP-5403-fix-average-glucose-calculation
Open

[LOOP-5403] Fix Average Glucose Calculation in Preset Performance History#918
Camji55 wants to merge 1 commit intodevfrom
cameron/LOOP-5403-fix-average-glucose-calculation

Conversation

@Camji55
Copy link
Member

@Camji55 Camji55 commented Mar 23, 2026

@Camji55 Camji55 requested review from nhamming and ps2 March 23, 2026 18:18
Copy link

@nhamming nhamming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a comment that should be seriously considered. But approving just in case I have a misunderstanding.

var averageGlucose: LoopQuantity {
LoopQuantity(
let valuesAfterStart = allGlucoseValues.dropFirst()
guard !valuesAfterStart.isEmpty else { return LoopQuantity(unit: .milligramsPerDeciliter, doubleValue: 0) }
Copy link

@nhamming nhamming Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm... should this be allowed to return an optional instead of 0? A glucose value of 0 is not biologically possible.

Not sure of the use of this averaging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants