iints-sdk-python35 0.1.7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. iints_sdk_python35-0.1.7/LICENSE +28 -0
  2. iints_sdk_python35-0.1.7/PKG-INFO +122 -0
  3. iints_sdk_python35-0.1.7/README.md +87 -0
  4. iints_sdk_python35-0.1.7/pyproject.toml +60 -0
  5. iints_sdk_python35-0.1.7/setup.cfg +4 -0
  6. iints_sdk_python35-0.1.7/src/iints/__init__.py +134 -0
  7. iints_sdk_python35-0.1.7/src/iints/analysis/__init__.py +12 -0
  8. iints_sdk_python35-0.1.7/src/iints/analysis/algorithm_xray.py +387 -0
  9. iints_sdk_python35-0.1.7/src/iints/analysis/baseline.py +92 -0
  10. iints_sdk_python35-0.1.7/src/iints/analysis/clinical_benchmark.py +198 -0
  11. iints_sdk_python35-0.1.7/src/iints/analysis/clinical_metrics.py +551 -0
  12. iints_sdk_python35-0.1.7/src/iints/analysis/clinical_tir_analyzer.py +136 -0
  13. iints_sdk_python35-0.1.7/src/iints/analysis/diabetes_metrics.py +43 -0
  14. iints_sdk_python35-0.1.7/src/iints/analysis/edge_performance_monitor.py +315 -0
  15. iints_sdk_python35-0.1.7/src/iints/analysis/explainability.py +94 -0
  16. iints_sdk_python35-0.1.7/src/iints/analysis/explainable_ai.py +232 -0
  17. iints_sdk_python35-0.1.7/src/iints/analysis/hardware_benchmark.py +221 -0
  18. iints_sdk_python35-0.1.7/src/iints/analysis/metrics.py +117 -0
  19. iints_sdk_python35-0.1.7/src/iints/analysis/reporting.py +261 -0
  20. iints_sdk_python35-0.1.7/src/iints/analysis/sensor_filtering.py +54 -0
  21. iints_sdk_python35-0.1.7/src/iints/analysis/validator.py +273 -0
  22. iints_sdk_python35-0.1.7/src/iints/api/__init__.py +0 -0
  23. iints_sdk_python35-0.1.7/src/iints/api/base_algorithm.py +300 -0
  24. iints_sdk_python35-0.1.7/src/iints/api/template_algorithm.py +195 -0
  25. iints_sdk_python35-0.1.7/src/iints/cli/__init__.py +0 -0
  26. iints_sdk_python35-0.1.7/src/iints/cli/cli.py +1286 -0
  27. iints_sdk_python35-0.1.7/src/iints/core/__init__.py +1 -0
  28. iints_sdk_python35-0.1.7/src/iints/core/algorithms/__init__.py +0 -0
  29. iints_sdk_python35-0.1.7/src/iints/core/algorithms/battle_runner.py +138 -0
  30. iints_sdk_python35-0.1.7/src/iints/core/algorithms/correction_bolus.py +86 -0
  31. iints_sdk_python35-0.1.7/src/iints/core/algorithms/discovery.py +92 -0
  32. iints_sdk_python35-0.1.7/src/iints/core/algorithms/fixed_basal_bolus.py +52 -0
  33. iints_sdk_python35-0.1.7/src/iints/core/algorithms/hybrid_algorithm.py +92 -0
  34. iints_sdk_python35-0.1.7/src/iints/core/algorithms/lstm_algorithm.py +138 -0
  35. iints_sdk_python35-0.1.7/src/iints/core/algorithms/mock_algorithms.py +69 -0
  36. iints_sdk_python35-0.1.7/src/iints/core/algorithms/pid_controller.py +88 -0
  37. iints_sdk_python35-0.1.7/src/iints/core/algorithms/standard_pump_algo.py +64 -0
  38. iints_sdk_python35-0.1.7/src/iints/core/device.py +0 -0
  39. iints_sdk_python35-0.1.7/src/iints/core/device_manager.py +64 -0
  40. iints_sdk_python35-0.1.7/src/iints/core/devices/__init__.py +3 -0
  41. iints_sdk_python35-0.1.7/src/iints/core/devices/models.py +155 -0
  42. iints_sdk_python35-0.1.7/src/iints/core/patient/__init__.py +3 -0
  43. iints_sdk_python35-0.1.7/src/iints/core/patient/models.py +246 -0
  44. iints_sdk_python35-0.1.7/src/iints/core/patient/patient_factory.py +117 -0
  45. iints_sdk_python35-0.1.7/src/iints/core/patient/profile.py +41 -0
  46. iints_sdk_python35-0.1.7/src/iints/core/safety/__init__.py +4 -0
  47. iints_sdk_python35-0.1.7/src/iints/core/safety/input_validator.py +87 -0
  48. iints_sdk_python35-0.1.7/src/iints/core/safety/supervisor.py +29 -0
  49. iints_sdk_python35-0.1.7/src/iints/core/simulation/__init__.py +0 -0
  50. iints_sdk_python35-0.1.7/src/iints/core/simulation/scenario_parser.py +61 -0
  51. iints_sdk_python35-0.1.7/src/iints/core/simulator.py +519 -0
  52. iints_sdk_python35-0.1.7/src/iints/core/supervisor.py +275 -0
  53. iints_sdk_python35-0.1.7/src/iints/data/__init__.py +42 -0
  54. iints_sdk_python35-0.1.7/src/iints/data/adapter.py +142 -0
  55. iints_sdk_python35-0.1.7/src/iints/data/column_mapper.py +398 -0
  56. iints_sdk_python35-0.1.7/src/iints/data/demo/__init__.py +1 -0
  57. iints_sdk_python35-0.1.7/src/iints/data/demo/demo_cgm.csv +289 -0
  58. iints_sdk_python35-0.1.7/src/iints/data/importer.py +275 -0
  59. iints_sdk_python35-0.1.7/src/iints/data/ingestor.py +162 -0
  60. iints_sdk_python35-0.1.7/src/iints/data/quality_checker.py +550 -0
  61. iints_sdk_python35-0.1.7/src/iints/data/universal_parser.py +813 -0
  62. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/clinic_safe_baseline.yaml +9 -0
  63. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/clinic_safe_hyper_challenge.yaml +9 -0
  64. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/clinic_safe_hypo_prone.yaml +9 -0
  65. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/clinic_safe_midnight.yaml +9 -0
  66. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/clinic_safe_pizza.yaml +9 -0
  67. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/clinic_safe_stress_meal.yaml +9 -0
  68. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/default_patient.yaml +11 -0
  69. iints_sdk_python35-0.1.7/src/iints/data/virtual_patients/patient_559_config.yaml +11 -0
  70. iints_sdk_python35-0.1.7/src/iints/emulation/__init__.py +80 -0
  71. iints_sdk_python35-0.1.7/src/iints/emulation/legacy_base.py +414 -0
  72. iints_sdk_python35-0.1.7/src/iints/emulation/medtronic_780g.py +337 -0
  73. iints_sdk_python35-0.1.7/src/iints/emulation/omnipod_5.py +367 -0
  74. iints_sdk_python35-0.1.7/src/iints/emulation/tandem_controliq.py +393 -0
  75. iints_sdk_python35-0.1.7/src/iints/highlevel.py +192 -0
  76. iints_sdk_python35-0.1.7/src/iints/learning/__init__.py +3 -0
  77. iints_sdk_python35-0.1.7/src/iints/learning/autonomous_optimizer.py +194 -0
  78. iints_sdk_python35-0.1.7/src/iints/learning/learning_system.py +122 -0
  79. iints_sdk_python35-0.1.7/src/iints/metrics.py +34 -0
  80. iints_sdk_python35-0.1.7/src/iints/presets/__init__.py +28 -0
  81. iints_sdk_python35-0.1.7/src/iints/presets/presets.json +114 -0
  82. iints_sdk_python35-0.1.7/src/iints/templates/__init__.py +0 -0
  83. iints_sdk_python35-0.1.7/src/iints/templates/default_algorithm.py +56 -0
  84. iints_sdk_python35-0.1.7/src/iints/templates/scenarios/__init__.py +0 -0
  85. iints_sdk_python35-0.1.7/src/iints/templates/scenarios/example_scenario.json +34 -0
  86. iints_sdk_python35-0.1.7/src/iints/utils/__init__.py +3 -0
  87. iints_sdk_python35-0.1.7/src/iints/utils/plotting.py +50 -0
  88. iints_sdk_python35-0.1.7/src/iints/validation/__init__.py +117 -0
  89. iints_sdk_python35-0.1.7/src/iints/validation/schemas.py +72 -0
  90. iints_sdk_python35-0.1.7/src/iints/visualization/__init__.py +34 -0
  91. iints_sdk_python35-0.1.7/src/iints/visualization/cockpit.py +691 -0
  92. iints_sdk_python35-0.1.7/src/iints/visualization/uncertainty_cloud.py +612 -0
  93. iints_sdk_python35-0.1.7/src/iints_sdk_python35.egg-info/PKG-INFO +122 -0
  94. iints_sdk_python35-0.1.7/src/iints_sdk_python35.egg-info/SOURCES.txt +96 -0
  95. iints_sdk_python35-0.1.7/src/iints_sdk_python35.egg-info/dependency_links.txt +1 -0
  96. iints_sdk_python35-0.1.7/src/iints_sdk_python35.egg-info/entry_points.txt +2 -0
  97. iints_sdk_python35-0.1.7/src/iints_sdk_python35.egg-info/requires.txt +22 -0
  98. iints_sdk_python35-0.1.7/src/iints_sdk_python35.egg-info/top_level.txt +1 -0
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 IINTS-AF Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ACADEMIC USE DISCLAIMER:
24
+ This software is intended for academic research purposes only. It is not
25
+ intended for clinical use or as a medical device. Users must comply with
26
+ all applicable regulations and obtain proper approvals before any clinical
27
+ application. The authors disclaim any responsibility for clinical use of
28
+ this software.
@@ -0,0 +1,122 @@
1
+ Metadata-Version: 2.4
2
+ Name: iints-sdk-python35
3
+ Version: 0.1.7
4
+ Summary: A pre-clinical Edge-AI SDK for diabetes management validation.
5
+ Author-email: Rune Bobbaers <rune.bobbaers@gmail.com>
6
+ Project-URL: Homepage, https://github.com/python35/IINTS-SDK
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Requires-Python: >=3.8
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: fpdf2>=2.8.0
15
+ Requires-Dist: matplotlib>=3.5.0
16
+ Requires-Dist: numpy>=1.24.0
17
+ Requires-Dist: openpyxl>=3.0.0
18
+ Requires-Dist: pandas>=2.0.0
19
+ Requires-Dist: pydantic>=2.0.0
20
+ Requires-Dist: PyYAML
21
+ Requires-Dist: rich>=12.0.0
22
+ Requires-Dist: scipy>=1.9.0
23
+ Requires-Dist: seaborn>=0.11.0
24
+ Requires-Dist: typer[all]
25
+ Provides-Extra: dev
26
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
27
+ Requires-Dist: flake8; extra == "dev"
28
+ Requires-Dist: mypy; extra == "dev"
29
+ Requires-Dist: pandas-stubs; extra == "dev"
30
+ Requires-Dist: types-PyYAML; extra == "dev"
31
+ Requires-Dist: types-psutil; extra == "dev"
32
+ Provides-Extra: torch
33
+ Requires-Dist: torch>=1.9.0; extra == "torch"
34
+ Dynamic: license-file
35
+
36
+ # IINTS-AF SDK (v0.1.5)
37
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/python35/IINTS-SDK/blob/main/examples/notebooks/00_Quickstart.ipynb)
38
+ [![Python Package CI](https://github.com/python35/IINTS-SDK/actions/workflows/python-package.yml/badge.svg)](https://github.com/python35/IINTS-SDK/actions/workflows/python-package.yml)
39
+
40
+ ## Intelligent Insulin Titration System for Artificial Pancreas
41
+
42
+ IINTS-AF is a **safety-first simulation and validation platform** for insulin dosing algorithms. It lets you test AI or classical controllers on virtual patients, enforce deterministic safety constraints, and generate audit-ready clinical reports before anything touches a real patient.
43
+
44
+ **In one session you can**:
45
+ * Run a clinic-safe preset and compare against PID and standard pump baselines
46
+ * Import real-world CGM CSV into a standard schema + scenario JSON
47
+ * Use the bundled demo CGM data pack (zero setup)
48
+ * Export a clean PDF report plus full audit trail (JSONL/CSV)
49
+ * Stress-test sensor noise, pump limits, and human-in-the-loop interventions
50
+ * Generate patient profiles with ISF/ICR + dawn phenomenon
51
+
52
+ **Who it’s for**:
53
+ * Diabetes researchers and clinicians validating new control strategies
54
+ * ML engineers benchmarking AI controllers with medical safety rails
55
+ * Developers building decision-support systems for closed-loop insulin delivery
56
+
57
+ ### Quick Start (CLI)
58
+ ```bash
59
+ iints quickstart --project-name iints_quickstart
60
+ cd iints_quickstart
61
+ iints presets run --name baseline_t1d --algo algorithms/example_algorithm.py
62
+ ```
63
+
64
+ One-line full run (CSV + audit + PDF + baseline):
65
+ ```bash
66
+ iints run-full --algo algorithms/example_algorithm.py \
67
+ --scenario-path scenarios/clinic_safe_baseline.json \
68
+ --output-dir results/run_full
69
+ ```
70
+
71
+ Import real-world CGM data:
72
+ ```bash
73
+ iints import-data --input-csv data/my_cgm.csv --output-dir results/imported
74
+ ```
75
+
76
+ Try the bundled demo data pack:
77
+ ```bash
78
+ iints import-demo --output-dir results/demo_import
79
+ ```
80
+
81
+ Or run the full demo workflow (import + run + report) in one script:
82
+ ```bash
83
+ python3 examples/demo_quickstart_flow.py
84
+ ```
85
+
86
+ ### Quick Start (Python)
87
+ ```python
88
+ import iints
89
+ from iints.core.algorithms.pid_controller import PIDController
90
+
91
+ outputs = iints.run_simulation(
92
+ algorithm=PIDController(),
93
+ scenario="scenarios/example_scenario.json",
94
+ patient_config="default_patient",
95
+ duration_minutes=720,
96
+ seed=42,
97
+ output_dir="results/quick_run",
98
+ )
99
+ ```
100
+
101
+ ### Notebook Guide
102
+ Hands-on Jupyter notebooks live in `examples/notebooks/` and cover the full workflow (each is Colab-ready):
103
+
104
+ * Quickstart end-to-end run
105
+ * Presets + scenario validation
106
+ * Safety supervisor behavior
107
+ * Audit trail + PDF report export
108
+ * Baseline comparison + clinical metrics
109
+ * Sensor/pump models + human-in-the-loop
110
+ * Optional Torch/LSTM usage
111
+ * Ablation study (with/without Supervisor)
112
+
113
+ ### Documentation
114
+ * Product manual: `SDK_COMPREHENSIVE_GUIDE.md`
115
+ * Notebook index: `examples/notebooks/README.md`
116
+ * Technical README: `TECHNICAL_README.md`
117
+ * API Stability: `API_STABILITY.md`
118
+
119
+ ### Ethics & Safety
120
+ This SDK is for **research and validation**. It is not a medical device and does not provide clinical dosing advice.
121
+
122
+ > “Code shouldn’t be a secret when it’s managing a life.” — Bobbaers Rune
@@ -0,0 +1,87 @@
1
+ # IINTS-AF SDK (v0.1.5)
2
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/python35/IINTS-SDK/blob/main/examples/notebooks/00_Quickstart.ipynb)
3
+ [![Python Package CI](https://github.com/python35/IINTS-SDK/actions/workflows/python-package.yml/badge.svg)](https://github.com/python35/IINTS-SDK/actions/workflows/python-package.yml)
4
+
5
+ ## Intelligent Insulin Titration System for Artificial Pancreas
6
+
7
+ IINTS-AF is a **safety-first simulation and validation platform** for insulin dosing algorithms. It lets you test AI or classical controllers on virtual patients, enforce deterministic safety constraints, and generate audit-ready clinical reports before anything touches a real patient.
8
+
9
+ **In one session you can**:
10
+ * Run a clinic-safe preset and compare against PID and standard pump baselines
11
+ * Import real-world CGM CSV into a standard schema + scenario JSON
12
+ * Use the bundled demo CGM data pack (zero setup)
13
+ * Export a clean PDF report plus full audit trail (JSONL/CSV)
14
+ * Stress-test sensor noise, pump limits, and human-in-the-loop interventions
15
+ * Generate patient profiles with ISF/ICR + dawn phenomenon
16
+
17
+ **Who it’s for**:
18
+ * Diabetes researchers and clinicians validating new control strategies
19
+ * ML engineers benchmarking AI controllers with medical safety rails
20
+ * Developers building decision-support systems for closed-loop insulin delivery
21
+
22
+ ### Quick Start (CLI)
23
+ ```bash
24
+ iints quickstart --project-name iints_quickstart
25
+ cd iints_quickstart
26
+ iints presets run --name baseline_t1d --algo algorithms/example_algorithm.py
27
+ ```
28
+
29
+ One-line full run (CSV + audit + PDF + baseline):
30
+ ```bash
31
+ iints run-full --algo algorithms/example_algorithm.py \
32
+ --scenario-path scenarios/clinic_safe_baseline.json \
33
+ --output-dir results/run_full
34
+ ```
35
+
36
+ Import real-world CGM data:
37
+ ```bash
38
+ iints import-data --input-csv data/my_cgm.csv --output-dir results/imported
39
+ ```
40
+
41
+ Try the bundled demo data pack:
42
+ ```bash
43
+ iints import-demo --output-dir results/demo_import
44
+ ```
45
+
46
+ Or run the full demo workflow (import + run + report) in one script:
47
+ ```bash
48
+ python3 examples/demo_quickstart_flow.py
49
+ ```
50
+
51
+ ### Quick Start (Python)
52
+ ```python
53
+ import iints
54
+ from iints.core.algorithms.pid_controller import PIDController
55
+
56
+ outputs = iints.run_simulation(
57
+ algorithm=PIDController(),
58
+ scenario="scenarios/example_scenario.json",
59
+ patient_config="default_patient",
60
+ duration_minutes=720,
61
+ seed=42,
62
+ output_dir="results/quick_run",
63
+ )
64
+ ```
65
+
66
+ ### Notebook Guide
67
+ Hands-on Jupyter notebooks live in `examples/notebooks/` and cover the full workflow (each is Colab-ready):
68
+
69
+ * Quickstart end-to-end run
70
+ * Presets + scenario validation
71
+ * Safety supervisor behavior
72
+ * Audit trail + PDF report export
73
+ * Baseline comparison + clinical metrics
74
+ * Sensor/pump models + human-in-the-loop
75
+ * Optional Torch/LSTM usage
76
+ * Ablation study (with/without Supervisor)
77
+
78
+ ### Documentation
79
+ * Product manual: `SDK_COMPREHENSIVE_GUIDE.md`
80
+ * Notebook index: `examples/notebooks/README.md`
81
+ * Technical README: `TECHNICAL_README.md`
82
+ * API Stability: `API_STABILITY.md`
83
+
84
+ ### Ethics & Safety
85
+ This SDK is for **research and validation**. It is not a medical device and does not provide clinical dosing advice.
86
+
87
+ > “Code shouldn’t be a secret when it’s managing a life.” — Bobbaers Rune
@@ -0,0 +1,60 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "iints-sdk-python35"
7
+ version = "0.1.7"
8
+ authors = [
9
+ { name="Rune Bobbaers", email="rune.bobbaers@gmail.com" },
10
+ ]
11
+ description = "A pre-clinical Edge-AI SDK for diabetes management validation."
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ classifiers = [
15
+ "Programming Language :: Python :: 3",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Operating System :: OS Independent",
18
+ "Development Status :: 3 - Alpha",
19
+ ]
20
+ dependencies = [
21
+ "fpdf2>=2.8.0",
22
+ "matplotlib>=3.5.0",
23
+ "numpy>=1.24.0",
24
+ "openpyxl>=3.0.0",
25
+ "pandas>=2.0.0",
26
+ "pydantic>=2.0.0",
27
+ "PyYAML",
28
+ "rich>=12.0.0",
29
+ "scipy>=1.9.0",
30
+ "seaborn>=0.11.0",
31
+ "typer[all]",
32
+ ]
33
+
34
+ [project.optional-dependencies]
35
+ dev = [
36
+ "pytest>=7.0.0",
37
+ "flake8",
38
+ "mypy",
39
+ "pandas-stubs",
40
+ "types-PyYAML",
41
+ "types-psutil",
42
+ ]
43
+ torch = [
44
+ "torch>=1.9.0",
45
+ ]
46
+
47
+ [project.scripts]
48
+ iints = "iints.cli.cli:app"
49
+
50
+ [project.urls]
51
+ "Homepage" = "https://github.com/python35/IINTS-SDK"
52
+
53
+ [tool.setuptools.package-data]
54
+ iints = [
55
+ "templates/*.py",
56
+ "templates/scenarios/*.json",
57
+ "data/virtual_patients/*.yaml",
58
+ "data/demo/*.csv",
59
+ "presets/*.json",
60
+ ]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,134 @@
1
+ # src/iints/__init__.py
2
+
3
+ import pandas as pd # Required for type hints like pd.DataFrame
4
+ from typing import Optional
5
+
6
+ __version__ = "0.1.5"
7
+
8
+ # API Components for Algorithm Development
9
+ from .api.base_algorithm import (
10
+ InsulinAlgorithm,
11
+ AlgorithmInput,
12
+ AlgorithmResult,
13
+ AlgorithmMetadata,
14
+ WhyLogEntry,
15
+ )
16
+
17
+ # Core Simulation Components
18
+ from .core.simulator import Simulator, StressEvent, SimulationLimitError
19
+ from .core.patient.models import PatientModel
20
+ from .core.patient.profile import PatientProfile
21
+ try:
22
+ from .core.device_manager import DeviceManager
23
+ except Exception: # pragma: no cover - fallback if torch/device manager import fails
24
+ class DeviceManager: # type: ignore
25
+ def __init__(self):
26
+ self._device = "cpu"
27
+
28
+ def get_device(self):
29
+ return self._device
30
+ from .core.safety import SafetySupervisor
31
+ from .core.devices.models import SensorModel, PumpModel
32
+ from .core.algorithms.standard_pump_algo import StandardPumpAlgorithm
33
+ from .core.algorithms.mock_algorithms import ConstantDoseAlgorithm, RandomDoseAlgorithm
34
+
35
+ # Data Handling
36
+ from .data.ingestor import DataIngestor
37
+ from .data.importer import (
38
+ ImportResult,
39
+ export_demo_csv,
40
+ export_standard_csv,
41
+ guess_column_mapping,
42
+ import_cgm_csv,
43
+ import_cgm_dataframe,
44
+ load_demo_dataframe,
45
+ scenario_from_csv,
46
+ scenario_from_dataframe,
47
+ )
48
+ from .analysis.metrics import generate_benchmark_metrics # Added for benchmark
49
+ from .analysis.reporting import ClinicalReportGenerator
50
+ from .highlevel import run_simulation, run_full
51
+
52
+ # Placeholder for Reporting/Analysis
53
+ # This will be further developed in a dedicated module (e.g., iints.analysis.reporting)
54
+ def generate_report(simulation_results: 'pd.DataFrame', output_path: Optional[str] = None, safety_report: Optional[dict] = None) -> Optional[str]:
55
+ """
56
+ Generate a clinical PDF report from simulation results.
57
+ """
58
+ if output_path is None:
59
+ return None
60
+ generator = ClinicalReportGenerator()
61
+ return generator.generate_pdf(simulation_results, safety_report or {}, output_path)
62
+
63
+ def generate_quickstart_report(
64
+ simulation_results: 'pd.DataFrame',
65
+ output_path: Optional[str] = None,
66
+ safety_report: Optional[dict] = None,
67
+ ) -> Optional[str]:
68
+ """
69
+ Generate a concise Quickstart PDF report from simulation results.
70
+ """
71
+ if output_path is None:
72
+ return None
73
+ generator = ClinicalReportGenerator()
74
+ return generator.generate_pdf(
75
+ simulation_results,
76
+ safety_report or {},
77
+ output_path,
78
+ title="IINTS-AF Quickstart Report",
79
+ )
80
+
81
+ def generate_demo_report(
82
+ simulation_results: 'pd.DataFrame',
83
+ output_path: Optional[str] = None,
84
+ safety_report: Optional[dict] = None,
85
+ ) -> Optional[str]:
86
+ """
87
+ Generate a demo-friendly PDF with big visuals (Maker Faire style).
88
+ """
89
+ if output_path is None:
90
+ return None
91
+ generator = ClinicalReportGenerator()
92
+ return generator.generate_demo_pdf(
93
+ simulation_results,
94
+ safety_report or {},
95
+ output_path,
96
+ title="IINTS-AF Demo Report",
97
+ )
98
+
99
+ # You can also define __all__ to explicitly control what gets imported with `from iints import *`
100
+ __all__ = [
101
+ # API
102
+ "InsulinAlgorithm", "AlgorithmInput", "AlgorithmResult", "AlgorithmMetadata", "WhyLogEntry",
103
+ # Core
104
+ "Simulator", "StressEvent", "PatientModel", "DeviceManager",
105
+ "PatientProfile",
106
+ "SimulationLimitError",
107
+ "SafetySupervisor",
108
+ "SensorModel",
109
+ "PumpModel",
110
+ "StandardPumpAlgorithm",
111
+ "ConstantDoseAlgorithm",
112
+ "RandomDoseAlgorithm",
113
+ # Data
114
+ "DataIngestor",
115
+ "ImportResult",
116
+ "export_demo_csv",
117
+ "export_standard_csv",
118
+ "guess_column_mapping",
119
+ "import_cgm_csv",
120
+ "import_cgm_dataframe",
121
+ "load_demo_dataframe",
122
+ "scenario_from_csv",
123
+ "scenario_from_dataframe",
124
+ # Analysis Metrics
125
+ "generate_benchmark_metrics",
126
+ "ClinicalReportGenerator",
127
+ # Reporting
128
+ "generate_report",
129
+ "generate_quickstart_report",
130
+ "generate_demo_report",
131
+ # High-level API
132
+ "run_simulation",
133
+ "run_full",
134
+ ]
@@ -0,0 +1,12 @@
1
+ from .clinical_metrics import ClinicalMetricsCalculator, ClinicalMetricsResult
2
+ from .baseline import compute_metrics, run_baseline_comparison, write_baseline_comparison
3
+ from .reporting import ClinicalReportGenerator
4
+
5
+ __all__ = [
6
+ "ClinicalMetricsCalculator",
7
+ "ClinicalMetricsResult",
8
+ "ClinicalReportGenerator",
9
+ "compute_metrics",
10
+ "run_baseline_comparison",
11
+ "write_baseline_comparison",
12
+ ]