iints-sdk-python35 1.5.0__py3-none-any.whl → 1.5.1__py3-none-any.whl
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.
- iints/__init__.py +9 -1
- iints/ai/cli.py +9 -0
- iints/ai/prompts.py +5 -4
- iints/analysis/__init__.py +28 -0
- iints/analysis/study_analysis.py +721 -0
- iints/analysis/study_poster.py +150 -0
- iints/analysis/study_protocol.py +310 -0
- iints/cli/cli.py +846 -15
- iints/data/__init__.py +20 -0
- iints/data/certify.py +80 -0
- iints/data/study_corruption.py +267 -0
- iints/scenarios/__init__.py +16 -1
- iints/scenarios/study_pack.py +293 -0
- iints_sdk_python35-1.5.1.dist-info/METADATA +99 -0
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/RECORD +21 -15
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/entry_points.txt +0 -1
- iints_sdk_python35-1.5.0.dist-info/METADATA +0 -425
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/WHEEL +0 -0
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/licenses/LICENSE +0 -0
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/licenses/LICENSE-MIT-IINTS-LEGACY +0 -0
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/licenses/NOTICE +0 -0
- {iints_sdk_python35-1.5.0.dist-info → iints_sdk_python35-1.5.1.dist-info}/top_level.txt +0 -0
iints/__init__.py
CHANGED
|
@@ -11,7 +11,7 @@ except ImportError: # pragma: no cover - Python < 3.8 fallback
|
|
|
11
11
|
try:
|
|
12
12
|
__version__ = version("iints-sdk-python35")
|
|
13
13
|
except PackageNotFoundError: # pragma: no cover - source tree fallback
|
|
14
|
-
__version__ = "1.5.
|
|
14
|
+
__version__ = "1.5.1"
|
|
15
15
|
|
|
16
16
|
# Note to developers: this SDK is currently maintained by a single author.
|
|
17
17
|
# Please report bugs via GitHub issues and feel free to contribute fixes via PRs.
|
|
@@ -70,11 +70,13 @@ from .data.nightscout import NightscoutConfig, import_nightscout
|
|
|
70
70
|
from .data.tidepool import TidepoolClient, load_openapi_spec
|
|
71
71
|
from .data.guardians import mdmp_gate, MDMPGateError
|
|
72
72
|
from .data.synthetic_mirror import generate_synthetic_mirror, SyntheticMirrorArtifact
|
|
73
|
+
from .data.study_corruption import AVAILABLE_STUDY_CORRUPTIONS, apply_study_corruptions, write_corrupted_study_csv
|
|
73
74
|
from .analysis.metrics import generate_benchmark_metrics # Added for benchmark
|
|
74
75
|
from .analysis.booth_demo import build_booth_demo
|
|
75
76
|
from .analysis.carelink_workbench import build_carelink_workbench
|
|
76
77
|
from .analysis.poster import generate_results_poster
|
|
77
78
|
from .analysis.reporting import ClinicalReportGenerator
|
|
79
|
+
from .analysis.study_protocol import build_study_protocol_payload, render_study_protocol_markdown, write_study_protocol_bundle
|
|
78
80
|
from .analysis.edge_efficiency import EnergyEstimate, estimate_energy_per_decision
|
|
79
81
|
from .ai import AIResponse, IINTSAssistant, MDMPGuard
|
|
80
82
|
from .highlevel import run_simulation, run_full, run_population
|
|
@@ -184,10 +186,16 @@ __all__ = [
|
|
|
184
186
|
"MDMPGateError",
|
|
185
187
|
"generate_synthetic_mirror",
|
|
186
188
|
"SyntheticMirrorArtifact",
|
|
189
|
+
"AVAILABLE_STUDY_CORRUPTIONS",
|
|
190
|
+
"apply_study_corruptions",
|
|
191
|
+
"write_corrupted_study_csv",
|
|
187
192
|
# Analysis Metrics
|
|
188
193
|
"generate_benchmark_metrics",
|
|
189
194
|
"build_booth_demo",
|
|
190
195
|
"build_carelink_workbench",
|
|
196
|
+
"build_study_protocol_payload",
|
|
197
|
+
"render_study_protocol_markdown",
|
|
198
|
+
"write_study_protocol_bundle",
|
|
191
199
|
"ClinicalReportGenerator",
|
|
192
200
|
"EnergyEstimate",
|
|
193
201
|
"estimate_energy_per_decision",
|
iints/ai/cli.py
CHANGED
|
@@ -70,6 +70,15 @@ def _resolve_cli_inputs(
|
|
|
70
70
|
|
|
71
71
|
if input_path.is_dir():
|
|
72
72
|
ai_dir = input_path / "ai"
|
|
73
|
+
if (
|
|
74
|
+
not ai_dir.exists()
|
|
75
|
+
or not any((ai_dir / candidate).is_file() for candidate in ("report_payload.json", "trends_payload.json", "anomalies_payload.json", "step_riskiest.json", "review_payload.json"))
|
|
76
|
+
or (resolved_cert is None and not (ai_dir / "report.signed.mdmp").is_file())
|
|
77
|
+
):
|
|
78
|
+
prepare_ai_ready_artifacts(
|
|
79
|
+
input_path,
|
|
80
|
+
create_dev_mdmp_cert=resolved_cert is None,
|
|
81
|
+
)
|
|
73
82
|
resolved_input = _default_prepared_payload(task, ai_dir)
|
|
74
83
|
if resolved_cert is None:
|
|
75
84
|
candidate_cert = ai_dir / "report.signed.mdmp"
|
iints/ai/prompts.py
CHANGED
|
@@ -63,10 +63,11 @@ TASK_TEMPLATES: dict[TaskName, str] = {
|
|
|
63
63
|
"Be conservative and do not overclaim. If the payload is incomplete, say so clearly.\n"
|
|
64
64
|
"Respond in markdown with these sections:\n"
|
|
65
65
|
"1. Overall realism verdict (Likely realistic / Needs review / Likely unrealistic)\n"
|
|
66
|
-
"2.
|
|
67
|
-
"3.
|
|
68
|
-
"4.
|
|
69
|
-
"5.
|
|
66
|
+
"2. What looks realistic\n"
|
|
67
|
+
"3. What looks suspicious\n"
|
|
68
|
+
"4. Priority fixes\n"
|
|
69
|
+
"5. What to improve next\n"
|
|
70
|
+
"6. Suggested follow-up validation checks\n\n"
|
|
70
71
|
"Focus on glycemic ranges, excursion patterns, insulin behavior, safety overrides, and whether the data looks internally coherent.\n\n"
|
|
71
72
|
"Input JSON:\n{data}"
|
|
72
73
|
),
|
iints/analysis/__init__.py
CHANGED
|
@@ -4,15 +4,43 @@ from .booth_demo import build_booth_demo
|
|
|
4
4
|
from .carelink_workbench import build_carelink_workbench
|
|
5
5
|
from .poster import generate_results_poster
|
|
6
6
|
from .reporting import ClinicalReportGenerator
|
|
7
|
+
from .study_poster import generate_study_poster
|
|
8
|
+
from .study_protocol import (
|
|
9
|
+
build_study_protocol_payload,
|
|
10
|
+
render_study_protocol_markdown,
|
|
11
|
+
write_study_protocol_bundle,
|
|
12
|
+
)
|
|
13
|
+
from .study_analysis import (
|
|
14
|
+
analyze_run_directory,
|
|
15
|
+
analyze_study_directory,
|
|
16
|
+
compare_studies,
|
|
17
|
+
load_study_summary,
|
|
18
|
+
quality_badges_for_metrics,
|
|
19
|
+
StudyComparison,
|
|
20
|
+
StudyRunSummary,
|
|
21
|
+
StudySummary,
|
|
22
|
+
)
|
|
7
23
|
|
|
8
24
|
__all__ = [
|
|
25
|
+
"analyze_run_directory",
|
|
26
|
+
"analyze_study_directory",
|
|
9
27
|
"build_booth_demo",
|
|
10
28
|
"build_carelink_workbench",
|
|
11
29
|
"ClinicalMetricsCalculator",
|
|
12
30
|
"ClinicalMetricsResult",
|
|
13
31
|
"ClinicalReportGenerator",
|
|
14
32
|
"compute_metrics",
|
|
33
|
+
"compare_studies",
|
|
15
34
|
"generate_results_poster",
|
|
35
|
+
"generate_study_poster",
|
|
36
|
+
"build_study_protocol_payload",
|
|
37
|
+
"render_study_protocol_markdown",
|
|
38
|
+
"write_study_protocol_bundle",
|
|
39
|
+
"load_study_summary",
|
|
40
|
+
"quality_badges_for_metrics",
|
|
16
41
|
"run_baseline_comparison",
|
|
42
|
+
"StudyComparison",
|
|
43
|
+
"StudyRunSummary",
|
|
44
|
+
"StudySummary",
|
|
17
45
|
"write_baseline_comparison",
|
|
18
46
|
]
|