Просмотр исходного кода

Remove unused function parameters to simplify

Sam King 9 месяцев назад
Родитель
Сommit
dc27157276

+ 0 - 3
Trio/Sources/APS/OpenAPSSwift/DetermineBasal/DetermineBasalGenerator.swift

@@ -287,9 +287,7 @@ enum DeterminationGenerator {
             meal: mealData,
             currentGlucose: currentGlucose,
             adjustedTargetGlucose: adjustedGlucoseTargets.targetGlucose,
-            adjustedSensitivity: adjustedSensitivity,
             minGuardGlucose: forecastResult.minGuardGlucose,
-            eventualGlucose: forecastResult.eventualGlucose,
             threshold: threshold,
             glucoseStatus: glucoseStatus,
             trioCustomOrefVariables: trioCustomOrefVariables,
@@ -349,7 +347,6 @@ enum DeterminationGenerator {
             threshold: threshold,
             overrideFactor: trioCustomOrefVariables.overrideFactor(),
             profile: profile,
-            eventualGlucose: eventualGlucose,
             adjustedSensitivity: adjustedSensitivity,
             targetGlucose: adjustedGlucoseTargets.targetGlucose,
             currentTemp: currentTemp,

+ 0 - 3
Trio/Sources/APS/OpenAPSSwift/DetermineBasal/DosingEngine.swift

@@ -110,9 +110,7 @@ enum DosingEngine {
         meal: ComputedCarbs,
         currentGlucose: Decimal,
         adjustedTargetGlucose: Decimal,
-        adjustedSensitivity _: Decimal,
         minGuardGlucose: Decimal,
-        eventualGlucose _: Decimal,
         threshold: Decimal,
         glucoseStatus: GlucoseStatus,
         trioCustomOrefVariables: TrioCustomOrefVariables,
@@ -285,7 +283,6 @@ enum DosingEngine {
         threshold: Decimal,
         overrideFactor: Decimal,
         profile: Profile,
-        eventualGlucose _: Decimal,
         adjustedSensitivity: Decimal,
         targetGlucose: Decimal,
         currentTemp: TempBasal,

+ 38 - 42
TrioTests/OpenAPSSwiftTests/DetermineBasalEnableSmbTests.swift

@@ -10,9 +10,7 @@ import Testing
         meal: ComputedCarbs,
         currentGlucose: Decimal,
         adjustedTargetGlucose: Decimal,
-        adjustedSensitivity: Decimal,
         minGuardGlucose: Decimal,
-        eventualGlucose: Decimal,
         threshold: Decimal,
         glucoseStatus: GlucoseStatus,
         trioCustomOrefVariables: TrioCustomOrefVariables,
@@ -75,9 +73,7 @@ import Testing
             meal: meal,
             currentGlucose: 120,
             adjustedTargetGlucose: 100,
-            adjustedSensitivity: 50,
             minGuardGlucose: 110,
-            eventualGlucose: 115,
             threshold: 70,
             glucoseStatus: glucoseStatus,
             trioCustomOrefVariables: trioCustomOrefVariables,
@@ -91,8 +87,8 @@ import Testing
         let inputs = createDefaultInputs()
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -106,8 +102,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -121,8 +117,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -137,8 +133,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -153,8 +149,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -182,8 +178,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -199,8 +195,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -224,8 +220,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -249,8 +245,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -265,8 +261,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -281,8 +277,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -301,8 +297,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -319,8 +315,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -339,8 +335,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -359,8 +355,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -377,8 +373,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -395,8 +391,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -413,8 +409,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )
@@ -431,8 +427,8 @@ import Testing
 
         let decision = try DosingEngine.makeSMBDosingDecision(
             profile: inputs.profile, meal: inputs.meal, currentGlucose: inputs.currentGlucose,
-            adjustedTargetGlucose: inputs.adjustedTargetGlucose, adjustedSensitivity: inputs.adjustedSensitivity,
-            minGuardGlucose: inputs.minGuardGlucose, eventualGlucose: inputs.eventualGlucose,
+            adjustedTargetGlucose: inputs.adjustedTargetGlucose,
+            minGuardGlucose: inputs.minGuardGlucose,
             threshold: inputs.threshold, glucoseStatus: inputs.glucoseStatus,
             trioCustomOrefVariables: inputs.trioCustomOrefVariables, clock: inputs.clock
         )