Skip to content

Comments

PumpManagers must be able to recommend supported TB and Bolus amounts#6

Merged
ps2 merged 4 commits intodevfrom
pump-precision
Mar 9, 2019
Merged

PumpManagers must be able to recommend supported TB and Bolus amounts#6
ps2 merged 4 commits intodevfrom
pump-precision

Conversation

@ps2
Copy link

@ps2 ps2 commented Mar 8, 2019

No description provided.

Copy link

@darinkrauss darinkrauss left a comment

Choose a reason for hiding this comment

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

One question and a couple nits for your consideration.

var maximumBolusVolume: Double { get }

// Maximum pump allowed basal rate in U/Hr
var maximumBasalRate: Double { get }

Choose a reason for hiding this comment

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

[nit] I would move this just below supportedBasalRates so you have supported/maximum for basal rates, and then supported/maximum for bolus volumes.

var supportedBolusVolumes: [Double] { get }

// Maximum pump allowed bolus volume in U
var maximumBolusVolume: Double { get }

Choose a reason for hiding this comment

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

Will a pump always have supported(BasalRates/BolusVolumes)? If so, then is there a need for maximum(BasalRate/BolusVolume)? Wouldn't the maximum just be dictated by the supported values?

/// - Parameters:
/// - unitsPerHour: A desired rate of delivery in Units/hr
/// - Returns: a supported rate of delivery in Units/hr. The rate returned should not be larger than the passed in rate.
func roundToSupportedTemporaryBasalRate(unitsPerHour: Double) -> Double

Choose a reason for hiding this comment

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

[nit] Remove the "Temporary" aspect here. Just roundToSupportedBasalRate for consistency.

Copy link

@darinkrauss darinkrauss left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@ps2 ps2 merged commit c00dac3 into dev Mar 9, 2019
@ps2 ps2 deleted the pump-precision branch April 3, 2019 14:40
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