openaps.glucose package

Submodules

openaps.glucose.convert module

class openaps.glucose.convert.Convert

Bases: object

How to convert from mg/dL (World Wide format) to mmol/L (mostly UK and ex-UK colonies)

Please note that rounding of these values is a view related function, and should happen at the very last point before data is being viewed, not here. See http://physics.stackexchange.com/a/63330

This code could be used for mathematical processing of results by someone down the line, so we take pain to avoid throwing away potentially significant data by rounding.

MMOLL_CONVERT_FACTOR = 18.0
classmethod mg_dl_to_mmol_l(klass, mg_dl)
classmethod mmol_l_to_mg_dl(klass, mmol_l)

openaps.glucose.display module

class openaps.glucose.display.Display

Bases: object

Round Glucose values for display, so that they are consistent in all OpenAPS apps

Example:

from openaps.glucose.display import Display print(Display.display(‘mmol/L’, 5.5)) print(Display.display(‘mg/dL’, 100))
classmethod display(klass, unit, val)

Module contents