Skip to content

Conversation

mpangburn
Copy link

Features:

  • Pump simulator with controllable reservoir and battery, ability to force errors on bolus/temp/suspend/resume.
  • CGM simulator with controllable glucose production model (constant or sine curve) and composable effects (glucose noise, random outliers, random errors).
  • Simulator configuration via settings; ability to clear out simulator data from HealthKit.

Notes:

  • Strings are deliberately not localized; this is a development tool and not for production.
  • Bolus and suspend states don't make use of transitional "bolusing" or "suspending" states.

ps2 and others added 30 commits November 19, 2018 17:50
(pushing early to simplify workspace setup, still much to do here)
… into mock-managers

# Conflicts:
#	LoopKit/Extensions/Collection.swift
#	LoopKitUI/MockPumpManager+UI.swift
#	LoopKitUI/View Controllers/MockCGMManagerSettingsViewController.swift
# Conflicts:
#	LoopKit.xcodeproj/project.pbxproj
@mpangburn mpangburn requested review from darinkrauss and ps2 March 6, 2019 02:48
Copy link

@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.

Just nits. Looks great!

@ps2 ps2 merged commit ff6041d into dev Mar 15, 2019
@ps2 ps2 deleted the mock-managers branch April 3, 2019 14:41
@ps2 ps2 mentioned this pull request Dec 31, 2019
ps2 pushed a commit that referenced this pull request Apr 21, 2023
* Add unannounced meal func to CarbStoreProtocol

* V1 of UAM algo

* Fix issues with time intervals not lining up

* Fix issue with ICE not being cumulative

* Make carb threshold a static const

* Handle errors in fetching glucose effects

* Add date range unit test

* Style improvement

* Update build settings so watch can access LoopNotificationUserInfoKey

* Add debug info for feature to carbstore

* Remove unneeded variable set

* Save last UAM notification time in UserDefaults

* Add debug info

* Update naming to make constant transition easier

* Use constants instead of variables

* Only restrict notification delivery so we don't detect the same meal twice

* Retract UAM notifications after the carbs have expired

* Simplify change & meal checks into a single threshold

* Fix effects from outside of the search window being included & triggering false-positive UAM detections

* Improve function naming

* Add enhanced debug info

* Move notification logic from LoopKit to Loop

* Improve debug logs

* Make current date configurable

* Add preliminary tests

* Add test

* Fix carb entries being purged bc of current date not being set during unit testing

* Update UAM tests

* Update status enum naming for point-of-use clarity

* Fix observation start for unit testing

* Pull UAM constants into separate struct

* Fix unexpected effect not including all needed effects

* Fix carb effects not being carb _counteraction_ effects

* Update tests for algo changes

* Add noisy cgm testcase

* Add test for non-unannounced meal with COB

* Add realistic unannounced meal test

* Improve algo commenting

* Update UAM algo to detect more-aggressively

* Remove TODO

* Update debug information

* Schedule missed meal notifications to avoid notification during an microbolus (#2)

* Add ability to estimate delivery duration of bolus

* Add tests for UAM notification delay

* Update `estimatedDuration` function headers in response to PR feedback

* Add UAM banner to carb entry screen (#4)

* UAM algo updates: only use directly observed carb absorption (#5)

* Add ability to calculate the number of carbs in a missed meal (#3)

* Plumb a customizable carb amount through UAM notification architecture

* Refactor carb effect threshold computation into helper function

* Add first draft of dynamic carb selection for meal

* Bump max carb autofill limit from 100 -> 150

* Add tests for carb autofill

* Bump max carb threshold limit because of dynamic autofill clamping

* Lower the UAM max autofill

* Require that unannounced meals have ICE onboard that is >= the meal threshold, and only autofill observed ICE

* Lower ICE threshold for a UAM notification

* Update tests

* Improve debug info

* Update commenting

* Remove unused test

* Update test

* `dateRange` -> `simulationDateRange`

* Create `MealDetectionManager` from old UAM functions in `CarbStore`

* Add fixme

* Updates based on feedback for UAM PR (#6)

* `dateRange` -> `simulationDateRange`

* Create `MealDetectionManager` from old UAM functions in `CarbStore`

* Add fixme

* Move UAM test fixtures from LoopKit to Loop

* Unannounced meal / UAM -> missed meal
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