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

Incorrect handling of overrideFactor

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

+ 1 - 1
Trio/Sources/APS/OpenAPSSwift/DetermineBasal/DosingEngine.swift

@@ -487,7 +487,7 @@ enum DosingEngine {
                 }
                 let glucoseUndershoot = targetGlucose - naiveEventualGlucose
                 let worstCaseInsulinRequired = glucoseUndershoot / adjustedSensitivity
-                var durationRequired = (60 * worstCaseInsulinRequired / (currentBasal * overrideFactor)).jsRounded()
+                var durationRequired = (60 * worstCaseInsulinRequired / currentBasal * overrideFactor).jsRounded()
 
                 if durationRequired < 0 {
                     durationRequired = 0

+ 1 - 1
TrioTests/OpenAPSSwiftTests/DetermineBasalJsonTests.swift

@@ -103,7 +103,7 @@ import Testing
         // this test is meant for one-off analysis so it's ok to hard code
         // a file, just make sure to _not_ check in updates to this to
         // avoid polluting our change logs
-        let algorithmComparison = try await HttpFiles.downloadFile(at: "/files/6e9415ea-b890-47eb-bb37-4a9a9ad432d3.2.json")
+        let algorithmComparison = try await HttpFiles.downloadFile(at: "/files/b8ba96ae-09e2-4eeb-badb-89b1fbd9d3ab.0.json")
         let determineBasalInput = algorithmComparison.determineBasalInput!
 
         let encoder = JSONCoding.encoder