nightscout / nightscout/AndroidAPS

[DynISF] Dynamically calculated ISF is not used consistently throughout AAPS

Open
#2,893 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Kotlin
Stars
1.2k
Forks
6.4k
Avg merge
2d 7h
Merged PRs (30d)
19

Description

I'd like to post it as an issue before DynISF reaches stable.

There still are many parts of AAPS, where profile_ISF is used, even if DynISF has been selected - this causes confusion and may pose risks:
1 ) Bolus wizard
2 ) COB decay model
3 ) COB (orange) prediction
4 ) UAM (yellow) prediction

DynISF is used for:
5 ) IOB (dark blue) prediction
6 ) ZT (light blue) prediction

As I have only partial understanding of DynISF, I'd like to kindly ask @tim2000s to take a stand, especially regarding 3)-6) - where I'm unsure.


Regarding 1) bolus wizard:
As the bolus wizard only uses a single calculation for the end of the DIA, using profile_ISF may result in significant differences compared to the loop calculation.

Example case:

  • profile_ISF is tuned for a normal BG level
  • BG is high, DynISF calculates a more aggressive ISF, the loop builds up some IOB
  • bolus wizard is launched with profile_ISF and thinks the IOB would be too much, and heavily reduces insulin delivered for carbs
  • which results in an even greater hyperglycemia
  • to avoid this, user may set a more aggressive profile_ISF
  • but then the bolus wizard itself may cause a hypoglycemia

As long as the wizard uses another calculation, than the loop, the difference remains. DynISF just leverages it by using another ISF. IMHO there is no easy solution - see suggestion here for implementing the loop algorithm to the bolus wizard: https://github.com/nightscout/AndroidAPS/issues/2561#issuecomment-1701021539


2)-6) affect the loop calculation - which is even more complex - but at least one can get used to it and tune the settings accordingly.


I'm using DynISF for more than 1,5 years with hard coded customizations and I'm basically happy with it, as it performs better than pure SMB did. I hope the above contribution will help to make it ready for master - please don't treat it as criticism. Credits go to Chris, Tim, Milos, and co who have brought it to us.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing profile_ISF and DynISF usage in the bolus wizard, COB decay model, COB prediction, UAM prediction, IOB prediction, and ZT prediction. Read the linked discussion for the proposed loop-algorithm approach, then establish the intended behavior with maintainers; done requires an agreed, consistent ISF calculation across the affected paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.