├── .gitignore
├── .idea
├── .gitignore
├── UVAPadovaAPI.iml
├── inspectionProfiles
│ ├── Project_Default.xml
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── .nojekyll
├── README.md
├── docs
├── .buildinfo
├── .doctrees
│ ├── OESimulator.DataProcessing.doctree
│ ├── OESimulator.SimulationData.doctree
│ ├── OESimulator.doctree
│ ├── Simulator.OESimulator.DataProcessing.doctree
│ ├── Simulator.OESimulator.SimulationData.doctree
│ ├── Simulator.OESimulator.doctree
│ ├── Simulator.UVAPadova.doctree
│ ├── Simulator.doctree
│ ├── UVAPadova.doctree
│ ├── UVAPadovaAPI.doctree
│ ├── UVAPadovaAPIWrapper.doctree
│ ├── environment.pickle
│ ├── index.doctree
│ ├── modules.doctree
│ ├── uva_padova_API.doctree
│ └── uva_padova_API_Wrapper.doctree
├── .nojekyll
├── Makefile
├── OESimulator.DataProcessing.html
├── OESimulator.SimulationData.html
├── OESimulator.html
├── Simulator.OESimulator.DataProcessing.html
├── Simulator.OESimulator.SimulationData.html
├── Simulator.OESimulator.html
├── Simulator.UVAPadova.html
├── Simulator.html
├── UVAPadova.html
├── UVAPadovaAPI.html
├── UVAPadovaAPIWrapper.html
├── _modules
│ ├── OESimulator
│ │ ├── DataProcessing
│ │ │ ├── DBFile.html
│ │ │ └── ErrorCodes.html
│ │ ├── DataProcessor.html
│ │ └── SimulationData
│ │ │ ├── DataContainer.html
│ │ │ ├── ParamsT1DMS.html
│ │ │ ├── PatientData.html
│ │ │ ├── PatientParams.html
│ │ │ ├── Position.html
│ │ │ ├── Scenario.html
│ │ │ ├── SimulationData.html
│ │ │ ├── Timestamp.html
│ │ │ └── Units.html
│ ├── Simulator
│ │ ├── OESimulator
│ │ │ ├── DataProcessing
│ │ │ │ ├── DBFile.html
│ │ │ │ └── ErrorCodes.html
│ │ │ ├── DataProcessor.html
│ │ │ └── SimulationData
│ │ │ │ ├── DataContainer.html
│ │ │ │ ├── ParamsT1DMS.html
│ │ │ │ ├── PatientData.html
│ │ │ │ ├── PatientParams.html
│ │ │ │ ├── Position.html
│ │ │ │ ├── Scenario.html
│ │ │ │ ├── SimulationData.html
│ │ │ │ ├── Timestamp.html
│ │ │ │ └── Units.html
│ │ └── UVAPadova
│ │ │ ├── UVAPadovaSimulator.html
│ │ │ ├── VirtualPatientT1DMS.html
│ │ │ └── uva_padova_simulator.html
│ ├── UVAPadova
│ │ └── VirtualPatientT1DMS.html
│ ├── UVAPadovaAPI.html
│ ├── UVAPadovaAPIWrapper.html
│ ├── flask_restful.html
│ ├── index.html
│ ├── uva_padova_API.html
│ └── uva_padova_API_Wrapper.html
├── _sources
│ ├── OESimulator.DataProcessing.rst.txt
│ ├── OESimulator.SimulationData.rst.txt
│ ├── OESimulator.rst.txt
│ ├── Simulator.OESimulator.DataProcessing.rst.txt
│ ├── Simulator.OESimulator.SimulationData.rst.txt
│ ├── Simulator.OESimulator.rst.txt
│ ├── Simulator.UVAPadova.rst.txt
│ ├── Simulator.rst.txt
│ ├── UVAPadova.rst.txt
│ ├── UVAPadovaAPI.rst.txt
│ ├── UVAPadovaAPIWrapper.rst.txt
│ ├── index.rst.txt
│ ├── modules.rst.txt
│ ├── uva_padova_API.rst.txt
│ └── uva_padova_API_Wrapper.rst.txt
├── _static
│ ├── basic.css
│ ├── css
│ │ ├── jast.css
│ │ └── redactor.css
│ ├── doctools.js
│ ├── documentation_options.js
│ ├── file.png
│ ├── fonts
│ │ ├── materialdesignicons-webfont.eot
│ │ ├── materialdesignicons-webfont.svg
│ │ ├── materialdesignicons-webfont.ttf
│ │ ├── materialdesignicons-webfont.woff
│ │ └── materialdesignicons-webfont.woff2
│ ├── jquery-3.5.1.js
│ ├── jquery.js
│ ├── js
│ │ └── theme-min.js
│ ├── language_data.js
│ ├── minus.png
│ ├── plus.png
│ ├── pygments.css
│ ├── searchtools.js
│ ├── underscore-1.13.1.js
│ └── underscore.js
├── genindex.html
├── index.html
├── make.bat
├── modules.html
├── objects.inv
├── py-modindex.html
├── search.html
├── searchindex.js
├── source
│ ├── Simulator.OESimulator.DataProcessing.rst
│ ├── Simulator.OESimulator.SimulationData.rst
│ ├── Simulator.OESimulator.rst
│ ├── Simulator.UVAPadova.rst
│ ├── Simulator.rst
│ ├── UVAPadovaAPI.rst
│ ├── UVAPadovaAPIWrapper.rst
│ ├── conf.py
│ ├── index.rst
│ ├── layout.svg
│ └── modules.rst
├── uva_padova_API.html
└── uva_padova_API_Wrapper.html
├── examples
└── tests
│ ├── cohort_simulation.py
│ ├── test01.py
│ ├── test01_5min.py
│ ├── test02.py
│ ├── test02_5min.py
│ ├── test03.py
│ ├── test03_5min.py
│ ├── test04.py
│ ├── test04_5min.py
│ ├── test05.py
│ ├── test05_5min.py
│ ├── test06.py
│ └── test06_5min.py
├── requirements.txt
└── src
├── Simulator
├── OESimulator
│ ├── DataProcessing
│ │ ├── DBFile.py
│ │ ├── ErrorCodes.py
│ │ └── __init__.py
│ ├── DataProcessor.py
│ ├── SimulationData
│ │ ├── CONSTANTS.py
│ │ ├── DataContainer.py
│ │ ├── ParamsT1DMS.py
│ │ ├── PatientData.py
│ │ ├── PatientParams.py
│ │ ├── Position.py
│ │ ├── Scenario.py
│ │ ├── SimulationData.py
│ │ ├── Timestamp.py
│ │ ├── Units.py
│ │ └── __init__.py
│ └── __init__.py
├── UVAPadova
│ ├── LicenseManagerAPI.bat
│ ├── UVAPadovaSimulator.py
│ ├── VirtualPatientT1DMS.py
│ ├── __init__.py
│ └── connect_function.m
└── __init__.py
├── UVAPadovaAPI.py
└── UVAPadovaAPIWrapper.py
/.gitignore:
--------------------------------------------------------------------------------
1 | __pycache__
2 | .ropeproject
3 | /doc/build
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/.idea/UVAPadovaAPI.iml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 | ## How to get the API up and running?
14 |
15 | ### Requirements:
16 | * Working Matlab version:
17 | * Academic version of the UVA/Padova Type 1 Diabetes Metabolic Simulator.
18 | * Installed Matlab Engine.
19 | * Installed Python.
20 | ### Setup:
21 | * Clone the repository.
22 | * Install requirements.txt.
23 | * Copy src\UVAPadova\connect_function.m to your UVA/Padova Simulator installation folder.
24 | * Run uva_padova_API.py
25 | * Run one of the examples.
26 |
27 | ### Notes:
28 | * If the UVA/Padova Simulator is not installed in the default path, src\UVAPadova\LicenseManagerAPI.bat and src\UVAPadova\VirtualPatientT1DMS.py has to be modified.
29 |
30 | ## Documentation
31 |
32 | https://neurodiab.github.io/UVAPadovaAPI/
33 |
34 | ## Cite
35 |
--------------------------------------------------------------------------------
/docs/.buildinfo:
--------------------------------------------------------------------------------
1 | # Sphinx build info version 1
2 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3 | config: e3f6d8dfd6c374490b39fd52f240188c
4 | tags: 645f666f9bcd5a90fca523b33c5a78b7
5 |
--------------------------------------------------------------------------------
/docs/.doctrees/OESimulator.DataProcessing.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/OESimulator.DataProcessing.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/OESimulator.SimulationData.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/OESimulator.SimulationData.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/OESimulator.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/OESimulator.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/Simulator.OESimulator.DataProcessing.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/Simulator.OESimulator.DataProcessing.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/Simulator.OESimulator.SimulationData.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/Simulator.OESimulator.SimulationData.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/Simulator.OESimulator.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/Simulator.OESimulator.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/Simulator.UVAPadova.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/Simulator.UVAPadova.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/Simulator.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/Simulator.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/UVAPadova.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/UVAPadova.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/UVAPadovaAPI.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/UVAPadovaAPI.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/UVAPadovaAPIWrapper.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/UVAPadovaAPIWrapper.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/environment.pickle:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/environment.pickle
--------------------------------------------------------------------------------
/docs/.doctrees/index.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/index.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/modules.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/modules.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/uva_padova_API.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/uva_padova_API.doctree
--------------------------------------------------------------------------------
/docs/.doctrees/uva_padova_API_Wrapper.doctree:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.doctrees/uva_padova_API_Wrapper.doctree
--------------------------------------------------------------------------------
/docs/.nojekyll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/NeuroDiab/UVAPadovaAPI/82ac3382ea81fa821be4146b4f05e7bd8fad67a5/docs/.nojekyll
--------------------------------------------------------------------------------
/docs/Makefile:
--------------------------------------------------------------------------------
1 | # Minimal makefile for Sphinx documentation
2 | #
3 |
4 | # You can set these variables from the command line, and also
5 | # from the environment for the first two.
6 | SPHINXOPTS ?=
7 | SPHINXBUILD ?= sphinx-build
8 | SOURCEDIR = source
9 | BUILDDIR = build
10 |
11 | # Put it first so that "make" without argument is like "make help".
12 | help:
13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 |
15 | .PHONY: help Makefile
16 |
17 | # Catch-all target: route all unknown targets to Sphinx using the new
18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19 | %: Makefile
20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21 |
--------------------------------------------------------------------------------
/docs/OESimulator.DataProcessing.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
108 | from enum import Enum
109 | [docs]class ERROR_CODES(Enum):
110 | DATE_INVALID = 1
111 | CGM_EMPTY = 100
112 | CGM_INVALID = 101
113 | CGM_OUTOFRANGE = 102
114 | CGM_GAP = 103
115 | INSULIN_EMPTY = 200
116 | INSULIN_INVALID = 201
117 | CHO_EMPTY = 300
118 | CHO_INVALID = 301
119 |
109 | [docs]class ParamsT1DMS:
110 | """ ParamsT1DMS stores the Uva/Padova simulator related scenario parameters.
111 |
112 | Note:
113 | All the member variables all the equivalent of the Uva/Padova Matlab simulator variables.
114 |
115 | """
116 | __slots__ = ['Tsimul','simToD','Qmeals','Tclosed','BGinit','Treg','basal','Qbasal','CR','Qbolus',
117 | 'IV_glucose','IV_insulin','SQg','OB','CR','meal_duration','hardwareN_sensor','hardwareN_pump',
118 | 'hardware_sensorType']
119 |
120 | def __init__(self):
121 | self.simToD : float = 0.0
122 | self.Qmeals : str = 'total'
123 | self.Treg : float = 0.0
124 | self.meal_duration : float = 15.0
125 | self.Qbasal : str = 'fixed'
126 | self.OB : str = 'off'
127 | self.CR : str = 'off'
128 | self.Qbolus : str = 'total'
129 | self.SQg : float = 1.0
130 |
108 | import numpy as np
109 | from .PatientParams import PatientParams
110 |
111 | [docs]class PatientData(object):
112 | """ Patient data.
113 | Defined by __slots__ as the class only serves quick data access purposes.
114 | """
115 | __slots__ = ['x_hist_timestamped','patient_params_timestamped','patient_id','patient_params']
116 |
117 | def __init__(self):
118 | """ Constructor.
119 |
120 | """
121 | # Stores the historically estimated states with timestamps.
122 | self.x_hist_timestamped: np.ndarray = np.array([], dtype=np.float32)
123 | # Stores the historically estimated patient parameters.
124 | self.patient_params_timestamped: np.ndarray = np.array([], dtype=np.float32)
125 | # Patient ID as in the database.
126 | self.patient_id: str = ""
127 | # Current patient parameters.
128 | self.patient_params = PatientParams()
129 |
130 | @property
131 | def __dict__(self):
132 | return {s: getattr(self, s, None) for s in self.__slots__}
133 |
109 | from enum import Enum
110 | [docs]class ERROR_CODES(Enum):
111 | DATE_INVALID = 1
112 | CGM_EMPTY = 100
113 | CGM_INVALID = 101
114 | CGM_OUTOFRANGE = 102
115 | CGM_GAP = 103
116 | INSULIN_EMPTY = 200
117 | INSULIN_INVALID = 201
118 | CHO_EMPTY = 300
119 | CHO_INVALID = 301
120 |
109 | [docs]class ParamsT1DMS:
110 | """ ParamsT1DMS stores the Uva/Padova simulator related scenario parameters.
111 |
112 | Note:
113 | All the member variables all the equivalent of the Uva/Padova Matlab simulator variables.
114 |
115 | """
116 | __slots__ = ['Tsimul','simToD','Qmeals','Tclosed','BGinit','Treg','basal','Qbasal','CR','Qbolus',
117 | 'IV_glucose','IV_insulin','SQg','OB','CR','meal_duration','hardwareN_sensor','hardwareN_pump',
118 | 'hardware_sensorType']
119 |
120 | def __init__(self):
121 | self.simToD : float = 0.0
122 | self.Qmeals : str = 'total'
123 | self.Treg : float = 0.0
124 | self.meal_duration : float = 15.0
125 | self.Qbasal : str = 'fixed'
126 | self.OB : str = 'off'
127 | self.CR : str = 'off'
128 | self.Qbolus : str = 'total'
129 | self.SQg : float = 1.0
130 |
109 | import numpy as np
110 | from .PatientParams import PatientParams
111 |
112 | [docs]class PatientData(object):
113 | """ Patient data.
114 | Defined by __slots__ as the class only serves quick data access purposes.
115 | """
116 | __slots__ = ['x_hist_timestamped','patient_params_timestamped','patient_id','patient_params']
117 |
118 | def __init__(self):
119 | """ Constructor.
120 |
121 | """
122 | # Stores the historically estimated states with timestamps.
123 | self.x_hist_timestamped: np.ndarray = np.array([], dtype=np.float32)
124 | # Stores the historically estimated patient parameters.
125 | self.patient_params_timestamped: np.ndarray = np.array([], dtype=np.float32)
126 | # Patient ID as in the database.
127 | self.patient_id: str = ""
128 | # Current patient parameters.
129 | self.patient_params = PatientParams()
130 |
131 | @property
132 | def __dict__(self):
133 | return {s: getattr(self, s, None) for s in self.__slots__}
134 |
Contents:
109 |