Skip to content

Conversation

@dm61
Copy link
Contributor

@dm61 dm61 commented Jan 14, 2020

A 10-min delay is included in calculation of effected insulin so that the insulin model used in dose calculations becomes consistent with the insulin model used for prediction calculations.

This addresses an issue brought up in the Partial Bolus Recommendation topic on Loop Zulip where a nonzero bolus recommendation is observed immediately after a bolus recommendation has been accepted. DoseMathTests have been updated accordingly.

Copy link
Collaborator

@ps2 ps2 left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks for hunting this down, @dm61! Need to fix the specification of 10m, so it's not in duplicate places. Could do this with a settings value, or updating LoopKit to included it in the model. I think either way would require a LoopKit change.

let unit = correctionRange.unit
let sensitivityValue = sensitivity.doubleValue(for: unit)
let suspendThresholdValue = suspendThreshold.doubleValue(for: unit)
let delay = TimeInterval(minutes: 10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This value should not be hard-coded. We are also using a default value (of 10m) in LoopKit; if one changes, so should the other, so they should be controlled by a settings value, or at least a single value specified in one place.

Copy link
Contributor Author

@dm61 dm61 Jan 15, 2020

Choose a reason for hiding this comment

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

Yup, I was going to look into how to get that value from LoopKit, but then decided to just put this out so you can quickly take a look.

I'd prefer including the delay in the insulin model, where it really belongs ([edit] (does not look very difficult, so will work on this).

@dm61 dm61 mentioned this pull request Jan 18, 2020
@ps2 ps2 merged commit c45caaa into LoopKit:dev Jan 19, 2020
@dm61 dm61 deleted the delay-in-dose-math branch January 23, 2020 05:40
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