Skip to content

negative_insulin: add version compatible with Loop next-dev#79

Open
bjorkert wants to merge 1 commit into
mainfrom
nextdev_negative_insulin
Open

negative_insulin: add version compatible with Loop next-dev#79
bjorkert wants to merge 1 commit into
mainfrom
nextdev_negative_insulin

Conversation

@bjorkert

@bjorkert bjorkert commented Jul 14, 2026

Copy link
Copy Markdown
Member

The existing negative_insulin patches do not apply to the Loop next-dev branch, so the customization shows as incompatible.

On next-dev the glucose-prediction pipeline (including DoseMath and the insulin model) moved into the standalone LoopAlgorithm Swift package, which no longer depends on LoopKit. The original approach — a doseEnd parameter on DoseStore.getGlucoseEffects, the LoopKit insulin-model changes, LoopState.negativeInsulinDamper, etc. — no longer applies. nextdev_negative_insulin.patch keeps the same behavior with a smaller, retargeted change: the damper coefficient is computed in LoopDataManager and threaded into the algorithm as an optional AlgorithmInput.negativeInsulinDamper, with the damping applied inside LoopAlgorithm.generatePrediction.

The Negative Insulin Damper is an opt-in Algorithm Experiment, off by default. With it off the coefficient is nil and the algorithm behaves exactly as stock.

Test

Requires LoopWorkspace on the Loop next-dev branch. No lnl-scripts change is needed; only PATCH_BRANCH is overridden.

reset command

This command resets the branch to default state.

git submodule foreach 'git reset --hard; git clean -fd;'

apply

export PATCH_BRANCH="nextdev_negative_insulin"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/loopandlearn/lnl-scripts/main/CustomizationSelect.sh)" \
    negative_insulin
unset PATCH_BRANCH

@bjorkert bjorkert requested a review from marionbarker July 14, 2026 17:39
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.

1 participant