Artificial-Pancreas / iAPS

MIT License
176 stars 720 forks source link

Display error on target ranges in mmol/l #28

Closed LiroyvH closed 1 year ago

LiroyvH commented 1 year ago

Hi,

When attempting to set the following targets: 00:00 5.8 - 6.3mmol/l 07:00 5.6 - 6.1mmol/l

I noticed that that second entry always goes back to 5.6-5.6. Upon inspecting the JSON file, it seemingly did write it properly; but due the conversion it was an exceptionally large fraction (eg: 6.09340030303030303). When changing the upper target to 6.0 or 6.2: it does display properly. Only setting it to 6.1 results in the lower target also being shown for the upper target.

Jon-b-m commented 1 year ago

Thanks for reporting. I can confirm/replicate this bug.

Jon-b-m commented 1 year ago

Just FYI in iAPS and in the oref0 algo, which iAPS is using, only the lower target is used. So the easiest way to fix this issue is just to have same lower and upper target. I will look at removing the range option in iAPS.

Jon-b-m commented 1 year ago

I now made a commit to remove the target ranges in settings. I have a testing branch, "single_target", for for it: https://github.com/Artificial-Pancreas/iAPS/tree/single_target

Jon-b-m commented 1 year ago

Fixed with commit https://github.com/Artificial-Pancreas/iAPS/commit/e0454e4849ed52495ab9166c3f6b82448b5f8b6c