Skip to content

Conversation

@dm61
Copy link
Contributor

@dm61 dm61 commented Jan 18, 2020

Adds delay to the insulin model presets, reverts hard coded delay and subtraction of delay in DoseMath. This is a companion PR to LoopKit PR LoopKit/LoopKit#315. Upon review, and any further updates, the two PR's should be merged concurrently. This Loop PR and the LoopKit PR 315 serve the same main purpose of fixing the dose math as #1238, which should be closed once these two PR's are merged.

}
}

var effectDelay: TimeInterval {
Copy link

Choose a reason for hiding this comment

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

@dm61 ideally, this should be user configurable (due to YDMV) IMHO. In many cases 15 or even 20 minutes might be more adequate (without the user needing to make a code change).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the comment. The main purpose of this PR is to address a slight inconsistency in dosing versus prediction algorithms, as discussed in #1238. UI-related decisions and design are separate issues, beyond the scope of this particular PR.

@ps2
Copy link
Collaborator

ps2 commented Jan 19, 2020

Thanks @dm61. Looks great!

@ps2 ps2 merged commit 824fe6a into LoopKit:dev Jan 19, 2020
@sarisarisari
Copy link

sarisarisari commented Jan 19, 2020

Can I please clarify that this means that the algorhythm will now assume that the insulin doesn't begin it's function until 10 min after it's been programmed? Where previously the algorhythm assumed immediate action? And that now this is has been merged to the dev branch?

@ps2
Copy link
Collaborator

ps2 commented Jan 19, 2020

The main algorithm has always assumed a 10 minute delay, and you would see this in the forecast, IOB charts, etc. The fix here is how dosing is calculated. Loop iterates to see what size dose will correct any highs without bringing you below range. That calculation wasn't using the 10 minute delay, so doses could be smaller, depending on the timing of carbs and your current bg.

@sarisarisari
Copy link

Oh interesting. Ok. Thank you for the clarification.

@dm61 dm61 deleted the insulin-model-delay branch January 23, 2020 05:41
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.

4 participants