API Reference
This page is generated from the Python source tree by tools/docs/generate_api_reference.py.
Do not edit it by hand; regenerate it after public module changes.
Documented modules: 244
Package Index
| Package |
Modules |
_version |
1 |
ai |
13 |
analysis |
34 |
api |
4 |
cli |
4 |
core |
42 |
data |
27 |
demo_assets |
1 |
emulation |
5 |
governance |
2 |
highlevel |
1 |
jetson |
3 |
learning |
3 |
live_patient |
12 |
mdmp |
3 |
metrics |
1 |
population |
3 |
presets |
1 |
research |
52 |
root |
1 |
safety |
2 |
scenarios |
3 |
templates |
6 |
tools |
3 |
utils |
6 |
validation |
7 |
versioning |
1 |
visualization |
3 |
Module Index
_version
ai
analysis
api
cli
core
data
demo_assets
emulation
governance
highlevel
jetson
learning
live_patient
mdmp
metrics
population
presets
research
root
safety
scenarios
templates
utils
validation
versioning
visualization
iints
- Source:
src/iints/__init__.py
- Summary: No module docstring.
- Explicit exports:
InsulinAlgorithm, AlgorithmInput, AlgorithmResult, AlgorithmMetadata, WhyLogEntry, Simulator, StressEvent, PatientModel, DeviceManager, PatientFactory, PatientProfile, SimulationLimitError, SafetySupervisor, SafetyConfig, SensorModel, PumpModel, SENSOR_PROFILES, create_sensor_model, StandardPumpAlgorithm, ConstantDoseAlgorithm, RandomDoseAlgorithm, RunawayAIAlgorithm, StackingAIAlgorithm, DataIngestor, ImportResult, export_demo_csv, export_standard_csv, guess_column_mapping, import_carelink_csv, import_carelink_timeline, import_cgm_csv, import_cgm_dataframe, load_carelink_event_log, load_demo_dataframe, scenario_from_csv, scenario_from_dataframe, summarize_carelink_csv, NightscoutConfig, import_nightscout, TidepoolClient, TidepoolConfig, import_tidepool, load_openapi_spec, mdmp_gate, MDMPGateError, generate_synthetic_mirror, SyntheticMirrorArtifact, AVAILABLE_STUDY_CORRUPTIONS, apply_study_corruptions, write_corrupted_study_csv, generate_benchmark_metrics, build_booth_demo, build_carelink_workbench, build_study_protocol_payload, render_study_protocol_markdown, write_study_protocol_bundle, ClinicalReportGenerator, EnergyEstimate, estimate_energy_per_decision, AIResponse, IINTSAssistant, MDMPGuard, create_edge_bundle, export_edge_setup, LivePatientDaemon, PatientRuntimeConfig, create_patient_app, export_uno_q_bridge, get_runtime_scenario_profile, list_runtime_scenario_profiles, run_edge_benchmark, summarize_edge_workspace, write_edge_update_script, generate_report, generate_quickstart_report, generate_demo_report, generate_agp_report, generate_agp_assets, generate_results_poster, run_simulation, run_full, run_population, ScenarioGeneratorConfig, generate_random_scenario, PopulationGenerator, PopulationConfig, ParameterDistribution, PopulationRunner, PopulationResult, PatientResult, BergmanPatientModel
Public Functions
run_simulation(*args: Any, **kwargs: Any) -> Any
run_full(*args: Any, **kwargs: Any) -> Any
run_population(*args: Any, **kwargs: Any) -> Any
generate_report(simulation_results: 'pd.DataFrame', output_path: Optional[str] = None, safety_report: Optional[dict] = None) -> Optional[str]
generate_quickstart_report(simulation_results: 'pd.DataFrame', output_path: Optional[str] = None, safety_report: Optional[dict] = None) -> Optional[str]
generate_demo_report(simulation_results: 'pd.DataFrame', output_path: Optional[str] = None, safety_report: Optional[dict] = None) -> Optional[str]
generate_agp_report(simulation_results: 'pd.DataFrame', output_path: Optional[str] = None, safety_report: Optional[dict] = None, subject_name: str = 'Research simulation', summary_json_path: Optional[str] = None) -> Optional[str]
generate_agp_assets(simulation_results: 'pd.DataFrame', output_dir: Optional[str] = None, subject_name: str = 'Research simulation', summary_json_path: Optional[str] = None, export_svg: bool = True) -> Optional[dict]
iints._version
- Source:
src/iints/_version.py
- Summary: Version of the IINTS source code in this distribution.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.ai
- Source:
src/iints/ai/__init__.py
- Summary: No module docstring.
- Explicit exports:
AIResponse, IINTSAssistant, DEFAULT_MINISTRAL_MODEL, DEFAULT_OLLAMA_HOST, OllamaBackend, DETERMINISTIC_DOSE_VERSION, DeterministicDoseResult, DoseSafetyLimits, calculate_deterministic_dose, AI_INSIGHT_CONTEXT_VERSION, build_insight_context, GuardResult, MDMPGuard, DEFAULT_MISTRAL_API_MODEL, DEFAULT_MISTRAL_API_REASONING_EFFORT, LocalMistralModelProfile, MistralAPIMigrationProfile, list_local_mistral_models, list_mistral_api_migrations, migrate_mistral_api_model, prepare_ai_ready_artifacts
No public classes, functions, or all-caps constants are declared directly in this module.
iints.ai.assistant
- Source:
src/iints/ai/assistant.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
AIResponse |
AIResponse |
No module docstring. |
IINTSAssistant |
IINTSAssistant |
Research-only LLM assistant gated by MDMP certification. |
AIResponse methods
to_dict(self) -> dict[str, Any]
IINTSAssistant methods
explain_decision(self, step: dict[str, Any]) -> AIResponse
analyze_trends(self, glucose_payload: list[Any] | dict[str, Any]) -> AIResponse
detect_anomalies(self, results: dict[str, Any]) -> AIResponse
generate_insights(self, run: dict[str, Any]) -> AIResponse
generate_report(self, run: dict[str, Any]) -> AIResponse
review_realism(self, run: dict[str, Any]) -> AIResponse
predict_insulin(self, payload: dict[str, Any]) -> AIResponse
iints.ai.backends
- Source:
src/iints/ai/backends/__init__.py
- Summary: No module docstring.
- Explicit exports:
CompletionBackend, DEFAULT_MINISTRAL_MODEL, DEFAULT_OLLAMA_HOST, OllamaBackend, MistralAPIBackend
No public classes, functions, or all-caps constants are declared directly in this module.
iints.ai.backends.base
- Source:
src/iints/ai/backends/base.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
CompletionBackend |
CompletionBackend(Protocol) |
No module docstring. |
CompletionBackend methods
available(self) -> bool
complete(self, *, system_prompt: str, user_prompt: str) -> str
iints.ai.backends.mistral_api
- Source:
src/iints/ai/backends/mistral_api.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
MistralAPIBackend |
MistralAPIBackend |
No module docstring. |
MistralAPIBackend methods
available(self) -> bool
complete(self, *, system_prompt: str, user_prompt: str) -> str
iints.ai.backends.ollama
- Source:
src/iints/ai/backends/ollama.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
OllamaBackend |
OllamaBackend |
No module docstring. |
OllamaBackend methods
available(self) -> bool
server_version(self) -> str | None
version_supported(self) -> tuple[bool | None, str | None]
list_models(self) -> list[str]
resolve_model_name(self) -> str | None
ensure_model_ready(self) -> str
healthcheck(self) -> dict[str, object]
smoke_test(self) -> dict[str, object]
complete(self, *, system_prompt: str, user_prompt: str) -> str
Public Constants
DEFAULT_MINISTRAL_MODEL
DEFAULT_OLLAMA_HOST
LEGACY_MINISTRAL_MODEL
MINISTRAL_MODEL_ALIASES
MIN_OLLAMA_VERSION_FOR_MINISTRAL_3
iints.ai.cli
- Source:
src/iints/ai/cli.py
- Summary: No module docstring.
Public Functions
models() -> None
prepare(run_dir: Annotated[Path, typer.Argument(help='Run output directory containing results.csv and run_metadata.json.')], create_dev_mdmp_cert: Annotated[bool, typer.Option('--create-dev-mdmp-cert/--no-create-dev-mdmp-cert', help='Generate a local development MDMP certificate and keypair for AI commands.')] = True, grade: Annotated[str, typer.Option(help='Grade to embed in the local development MDMP certificate.')] = 'research_grade', expires_days: Annotated[int, typer.Option(help='Certificate expiry window in days for local development certs.')] = 30, key_dir: Annotated[Optional[Path], typer.Option(help='Optional directory to store the generated local MDMP keypair.')] = None) -> None
local_check(model: Annotated[str, typer.Option(help='Ollama model name to validate locally.')] = DEFAULT_MINISTRAL_MODEL, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama health checks.')] = 120.0, smoke_test: Annotated[bool, typer.Option('--smoke-test/--no-smoke-test', help='Run a tiny generation request after health checks to prove the model can actually answer.')] = True) -> None
explain(input_json: Annotated[Path, typer.Argument(help='Prepared run directory or JSON file with a single simulation step or decision context.')], mdmp_cert: Annotated[Optional[Path], typer.Option(help='Signed MDMP artifact required before AI analysis can run.')] = None, mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = 'auto', model: Annotated[str, typer.Option(help='Ollama model name to use.')] = DEFAULT_MINISTRAL_MODEL, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required to allow analysis.')] = 'research_grade', public_key: Annotated[Optional[Path], typer.Option(help='Explicit MDMP public key for verification.')] = None, trust_store: Annotated[Optional[Path], typer.Option(help='MDMP trust store for verification.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama generation requests.')] = 120.0, output: Annotated[Optional[Path], typer.Option(help='Optional file path to save the explanation.')] = None) -> None
trends(input_json: Annotated[Path, typer.Argument(help='Prepared run directory or JSON file with glucose trace data or a run payload.')], mdmp_cert: Annotated[Optional[Path], typer.Option(help='Signed MDMP artifact required before AI analysis can run.')] = None, mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = 'auto', model: Annotated[str, typer.Option(help='Ollama model name to use.')] = DEFAULT_MINISTRAL_MODEL, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required to allow analysis.')] = 'research_grade', public_key: Annotated[Optional[Path], typer.Option(help='Explicit MDMP public key for verification.')] = None, trust_store: Annotated[Optional[Path], typer.Option(help='MDMP trust store for verification.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama generation requests.')] = 120.0, output: Annotated[Optional[Path], typer.Option(help='Optional file path to save the analysis.')] = None) -> None
anomalies(input_json: Annotated[Path, typer.Argument(help='Prepared run directory or JSON file with simulation results or run summary.')], mdmp_cert: Annotated[Optional[Path], typer.Option(help='Signed MDMP artifact required before AI analysis can run.')] = None, mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = 'auto', model: Annotated[str, typer.Option(help='Ollama model name to use.')] = DEFAULT_MINISTRAL_MODEL, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required to allow analysis.')] = 'research_grade', public_key: Annotated[Optional[Path], typer.Option(help='Explicit MDMP public key for verification.')] = None, trust_store: Annotated[Optional[Path], typer.Option(help='MDMP trust store for verification.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama generation requests.')] = 120.0, output: Annotated[Optional[Path], typer.Option(help='Optional file path to save the anomaly summary.')] = None) -> None
insights(input_json: Annotated[Path, typer.Argument(help='Prepared run directory or JSON file with run-level simulation outputs.')], mdmp_cert: Annotated[Optional[Path], typer.Option(help='Signed MDMP artifact required before AI analysis can run.')] = None, mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = 'auto', model: Annotated[str, typer.Option(help='Ollama model name to use.')] = DEFAULT_MINISTRAL_MODEL, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required to allow analysis.')] = 'research_grade', public_key: Annotated[Optional[Path], typer.Option(help='Explicit MDMP public key for verification.')] = None, trust_store: Annotated[Optional[Path], typer.Option(help='MDMP trust store for verification.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama generation requests.')] = 120.0, output: Annotated[Optional[Path], typer.Option(help='Optional file path to save the insight brief.')] = None) -> None
report(input_json: Annotated[Path, typer.Argument(help='Prepared run directory or JSON file with run-level simulation outputs.')], mdmp_cert: Annotated[Optional[Path], typer.Option(help='Signed MDMP artifact required before AI analysis can run.')] = None, mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = 'auto', model: Annotated[str, typer.Option(help='Ollama model name to use.')] = DEFAULT_MINISTRAL_MODEL, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required to allow analysis.')] = 'research_grade', public_key: Annotated[Optional[Path], typer.Option(help='Explicit MDMP public key for verification.')] = None, trust_store: Annotated[Optional[Path], typer.Option(help='MDMP trust store for verification.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama generation requests.')] = 120.0, output: Annotated[Optional[Path], typer.Option(help='Optional file path to save the markdown report.')] = None) -> None
review(input_json: Annotated[Path, typer.Argument(help='Prepared run directory or JSON file with run-level simulation outputs.')], mdmp_cert: Annotated[Optional[Path], typer.Option(help='Signed MDMP artifact required before AI analysis can run.')] = None, mode: Annotated[str, typer.Option(help="AI backend mode. Use 'local' for Ollama/Ministral.")] = 'auto', model: Annotated[str, typer.Option(help='Ollama model name to use.')] = DEFAULT_MINISTRAL_MODEL, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required to allow analysis.')] = 'research_grade', public_key: Annotated[Optional[Path], typer.Option(help='Explicit MDMP public key for verification.')] = None, trust_store: Annotated[Optional[Path], typer.Option(help='MDMP trust store for verification.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Override the Ollama base URL.')] = None, timeout_seconds: Annotated[float, typer.Option(help='HTTP timeout for Ollama generation requests.')] = 120.0, output: Annotated[Optional[Path], typer.Option(help='Optional file path to save the realism review.')] = None) -> None
iints.ai.deterministic
- Source:
src/iints/ai/deterministic.py
- Summary: Deterministic numerical boundaries for the optional AI assistant.
Public Classes
| Class |
Signature |
Summary |
DoseSafetyLimits |
DoseSafetyLimits |
Fixed research-sandbox limits applied after deterministic MPC output. |
DeterministicDoseResult |
DeterministicDoseResult |
Auditable result produced without invoking a language model. |
DeterministicDoseResult methods
to_dict(self) -> dict[str, Any]
Public Functions
calculate_deterministic_dose(payload: Mapping[str, Any], *, limits: DoseSafetyLimits = DoseSafetyLimits()) -> DeterministicDoseResult
Public Constants
DETERMINISTIC_DOSE_VERSION
iints.ai.insights
- Source:
src/iints/ai/insights.py
- Summary: No module docstring.
Public Functions
build_insight_context(task: str, payload: Any) -> dict[str, Any]
Public Constants
AI_INSIGHT_CONTEXT_VERSION
CARB_KEYS
GLUCOSE_KEYS
INSULIN_KEYS
MAX_RECORDS
OOD_KEYS
SAFETY_KEYS
TIME_KEYS
iints.ai.mdmp_guard
- Source:
src/iints/ai/mdmp_guard.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
GuardResult |
GuardResult |
No module docstring. |
MDMPGuard |
MDMPGuard |
Enforce a valid MDMP-signed artifact before AI analysis can run. |
GuardResult methods
to_dict(self) -> dict[str, Any]
MDMPGuard methods
check(self) -> GuardResult
wrap(self, response: str) -> str
iints.ai.model_catalog
- Source:
src/iints/ai/model_catalog.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
LocalMistralModelProfile |
LocalMistralModelProfile |
No module docstring. |
MistralAPIMigrationProfile |
MistralAPIMigrationProfile |
No module docstring. |
Public Functions
list_local_mistral_models() -> list[LocalMistralModelProfile]
list_mistral_api_migrations() -> list[MistralAPIMigrationProfile]
migrate_mistral_api_model(model_name: str) -> tuple[str, str | None, bool]
Public Constants
DEFAULT_MISTRAL_API_MODEL
DEFAULT_MISTRAL_API_REASONING_EFFORT
DEFAULT_MISTRAL_MODERATION_MODEL
DEFAULT_MISTRAL_OCR_MODEL
DEFAULT_MISTRAL_TRANSCRIBE_MODEL
LOCAL_MISTRAL_MODEL_PROFILES
MISTRAL_API_MIGRATION_PROFILES
STRONG_MISTRAL_API_MODEL
iints.ai.prepare
- Source:
src/iints/ai/prepare.py
- Summary: No module docstring.
Public Functions
prepare_ai_ready_artifacts(run_dir: str | Path, *, create_dev_mdmp_cert: bool = True, grade: str = 'research_grade', expires_days: int = 30, key_dir: str | Path | None = None) -> dict[str, str]
Public Constants
DETERMINISTIC_METRICS_VERSION
iints.ai.prompts
- Source:
src/iints/ai/prompts.py
- Summary: No module docstring.
Public Functions
build_prompt(task: TaskName, payload: Any) -> tuple[str, str]
Public Constants
MAX_PROMPT_PAYLOAD_CHARS
SYSTEM_PROMPT
TASK_TEMPLATES
iints.analysis
- Source:
src/iints/analysis/__init__.py
- Summary: No module docstring.
- Explicit exports:
analyze_run_directory, analyze_study_directory, build_booth_demo, build_carelink_workbench, build_evidence_bundle, ClinicalMetricsCalculator, ClinicalMetricsResult, ClinicalReportGenerator, EVIDENCE_SCOPE, compute_metrics, compare_studies, build_eucys_abstract_draft_markdown, build_eucys_filled_abstract_markdown, build_eucys_jury_qa_markdown, build_eucys_limitations_and_ethics_markdown, build_eucys_poster_outline_markdown, generate_eucys_main_figure, resolve_profile_specs, generate_eucys_results_bundle, generate_results_poster, generate_study_poster, build_algorithm_registry, build_study_design_payload, build_study_protocol_payload, build_study_experiment_template, render_study_protocol_markdown, render_study_experiment_yaml, write_study_protocol_bundle, load_study_experiment_config, load_study_summary, quality_badges_for_metrics, run_baseline_comparison, StudyAlgorithmSpec, StudyArmSpec, StudyComparison, StudyDesignPayload, StudyExperimentConfig, StudyMatrixRow, StudyProfileSpec, StudyRunSummary, StudySummary, write_baseline_comparison
No public classes, functions, or all-caps constants are declared directly in this module.
iints.analysis.algorithm_xray
- Source:
src/iints/analysis/algorithm_xray.py
- Summary: Algorithm X-Ray - IINTS-AF Make invisible medical decisions visible through decision replay and what-if analysis
Public Classes
| Class |
Signature |
Summary |
DecisionPoint |
DecisionPoint |
Single decision point in algorithm timeline |
AlgorithmXRay |
AlgorithmXRay |
X-ray vision into algorithm decision-making process |
DecisionPoint methods
AlgorithmXRay methods
get_quality_report_summary(self) -> Dict[str, Any]
analyze_decision(self, glucose_mgdl: float, glucose_history: List[float], insulin_history: List[float], time_minutes: int) -> DecisionPoint
calculate_personality_profile(self, decision_history: List[DecisionPoint]) -> Dict
generate_decision_replay(self, start_index: int = 0, end_index: Optional[int] = None) -> Dict
compare_what_if_scenarios(self, decision_point: DecisionPoint) -> Dict
export_xray_report(self, filepath: str)
Public Functions
iints.analysis.baseline
- Source:
src/iints/analysis/baseline.py
- Summary: No module docstring.
Public Functions
compute_metrics(results_df: pd.DataFrame) -> Dict[str, float]
run_baseline_comparison(patient_params: Dict[str, Any], stress_event_payloads: List[Dict[str, Any]], duration: int, time_step: int, primary_label: str, primary_results: pd.DataFrame, primary_safety: Dict[str, Any], compare_standard_pump: bool = True, seed: Optional[int] = None, patient_model_type: str = 'auto') -> Dict[str, Any]
write_baseline_comparison(comparison: Dict[str, Any], output_dir: Path) -> Dict[str, str]
iints.analysis.booth_demo
- Source:
src/iints/analysis/booth_demo.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
BoothScenarioSpec |
BoothScenarioSpec |
No module docstring. |
ShowcaseRunSpec |
ShowcaseRunSpec |
No module docstring. |
Public Functions
build_booth_demo(output_dir: str | Path = './results/booth_demo', *, patient_config: str | Path | dict[str, Any] = 'default_patient', duration_minutes: int = 360, time_step: int = 5, seed: int = 42, prepare_ai: bool = True, create_dev_mdmp_cert: bool = True) -> dict[str, str]
iints.analysis.carelink_workbench
- Source:
src/iints/analysis/carelink_workbench.py
- Summary: No module docstring.
Public Functions
build_carelink_workbench(input_csv: str | Path, *, output_dir: str | Path = './results/carelink_workbench', scenario_name: str = 'Imported CareLink Scenario', scenario_version: str = '1.0', carb_threshold: float = 0.1, create_dev_mdmp_cert: bool = True, grade: str = 'research_grade', expires_days: int = 30, key_dir: str | Path | None = None) -> dict[str, str]
iints.analysis.clinical_benchmark
- Source:
src/iints/analysis/clinical_benchmark.py
- Summary: Clinical Benchmark System Compares AI algorithms against real-world clinical outcomes
Public Classes
| Class |
Signature |
Summary |
ClinicalBenchmark |
ClinicalBenchmark |
Clinical benchmark comparison system |
ClinicalBenchmark methods
run_ohio_benchmark(self)
export_benchmark_results(self, results, filename = 'clinical_benchmark.json')
Public Functions
iints.analysis.clinical_metrics
- Source:
src/iints/analysis/clinical_metrics.py
- Summary: Compatibility exports for clinical metrics.
- Explicit exports:
ClinicalMetricsCalculator, ClinicalMetricsResult
Public Functions
demo_clinical_metrics() -> None
iints.analysis.clinical_tir_analyzer
- Source:
src/iints/analysis/clinical_tir_analyzer.py
- Summary: Professional 5-Zone TIR Analysis - IINTS-AF Implements Medtronic clinical standard for glucose zone classification
Public Classes
| Class |
Signature |
Summary |
ClinicalTIRAnalyzer |
ClinicalTIRAnalyzer |
Professional 5-zone Time in Range analysis following clinical standards |
ClinicalTIRAnalyzer methods
analyze_glucose_zones(self, glucose_values)
Public Functions
iints.analysis.clustered_inference
- Source:
src/iints/analysis/clustered_inference.py
- Summary: Uncertainty intervals that respect the study design.
- Explicit exports:
Interval, naive_ci, cluster_t_ci, hierarchical_bootstrap_ci, paired_block_differences, compare_algorithms, DEFAULT_BLOCK_KEYS, DEFAULT_CLUSTER_KEY, MIN_CLUSTERS_FOR_INTERVAL
Public Classes
| Class |
Signature |
Summary |
Interval |
Interval |
A point estimate with a confidence interval and its provenance. |
Interval methods
half_width(self) -> float
excludes_zero(self) -> bool
to_dict(self) -> Dict[str, object]
Public Functions
naive_ci(values: Sequence[float], confidence: float = 0.95) -> Interval
cluster_t_ci(values: Sequence[float], clusters: Sequence, confidence: float = 0.95) -> Interval
hierarchical_bootstrap_ci(values: Sequence[float], clusters: Sequence, confidence: float = 0.95, n_boot: int = 10000, seed: int = 0) -> Interval
paired_block_differences(df: pd.DataFrame, value: str, group_column: str, treatment: str, reference: str, block_keys: Sequence[str] = DEFAULT_BLOCK_KEYS) -> pd.DataFrame
compare_algorithms(df: pd.DataFrame, value: str = 'tir_70_180', group_column: str = 'algorithm_id', reference: str = 'standard_pump', treatments: Optional[Sequence[str]] = None, block_keys: Sequence[str] = DEFAULT_BLOCK_KEYS, cluster_key: str = DEFAULT_CLUSTER_KEY, confidence: float = 0.95, n_boot: int = 10000, seed: int = 0) -> pd.DataFrame
Public Constants
DEFAULT_BLOCK_KEYS
DEFAULT_CLUSTER_KEY
MIN_CLUSTERS_FOR_INTERVAL
iints.analysis.continuous_error_grid
- Source:
src/iints/analysis/continuous_error_grid.py
- Summary: Continuous Glucose-Error Grid Analysis (CG-EGA) from paired series.
- Explicit exports:
CGEGA_MATRIX, CGEGA_LABELS, GLYCEMIC_REGIONS, HYPO_CUTOFF_MGDL, HYPER_CUTOFF_MGDL, PEGA_EXPANSION_MGDL, RATE_CLASSES, RATE_MODERATE_MGDL_MIN, RATE_RAPID_MGDL_MIN, REGA_ZONES, CGEGAResult, cgega, classify_rate, combine_cgega, glycemic_region, pega_zones, rate_deviation, rate_of_change, rega_zones
Public Classes
| Class |
Signature |
Summary |
CGEGAResult |
CGEGAResult |
CG-EGA counts and percentages, overall and per glycemic region. |
CGEGAResult methods
erroneous_pct(self) -> float
summary_line(self) -> str
region_line(self, region: str) -> str
Public Functions
glycemic_region(reference: ArrayLike) -> np.ndarray
rate_of_change(values: ArrayLike, minutes: ArrayLike) -> np.ndarray
classify_rate(rate: ArrayLike) -> np.ndarray
rate_deviation(reference_rate: ArrayLike, estimated_rate: ArrayLike) -> np.ndarray
pega_zones(reference: ArrayLike, predicted: ArrayLike, reference_rate: ArrayLike) -> np.ndarray
rega_zones(reference_rate: ArrayLike, estimated_rate: ArrayLike) -> np.ndarray
combine_cgega(p_zone: str, r_zone: str, region: str) -> str
cgega(reference: ArrayLike, predicted: ArrayLike, minutes: ArrayLike, r_zones: ArrayLike | None = None) -> CGEGAResult
Public Constants
CGEGA_LABELS
CGEGA_MATRIX
GLYCEMIC_REGIONS
HYPER_CUTOFF_MGDL
HYPO_CUTOFF_MGDL
PEGA_EXPANSION_MGDL
RATE_CLASSES
RATE_MODERATE_MGDL_MIN
RATE_RAPID_MGDL_MIN
REGA_ZONES
iints.analysis.diabetes_metrics
- Source:
src/iints/analysis/diabetes_metrics.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DiabetesMetrics |
DiabetesMetrics |
Professional diabetes metrics for algorithm evaluation. |
DiabetesMetrics methods
time_in_range(glucose_values, lower = 70, upper = 180)
coefficient_of_variation(glucose_values)
blood_glucose_risk_index(glucose_values, risk_type = 'high')
calculate_all_metrics(df, baseline = 120)
iints.analysis.edge_efficiency
- Source:
src/iints/analysis/edge_efficiency.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
EnergyEstimate |
EnergyEstimate |
No module docstring. |
Public Functions
estimate_energy_per_decision(power_watts: float, latency_ms: float, decisions_per_day: int = 288) -> EnergyEstimate
- Source:
src/iints/analysis/edge_performance_monitor.py
- Summary: Edge AI Performance Monitor - IINTS-AF Jetson Nano research benchmarking for latency and resource use
Public Classes
| Class |
Signature |
Summary |
EdgeAIPerformanceMonitor |
EdgeAIPerformanceMonitor |
Monitor edge performance; results are not medical-device validation. |
start_monitoring(self)
measure_inference_latency(self, inference_function, input_data, iterations = 100)
generate_performance_report(self)
export_performance_data(self, filepath)
Public Functions
mock_ai_inference(input_data)
main()
iints.analysis.error_grid
- Source:
src/iints/analysis/error_grid.py
- Summary: Clarke Error Grid Analysis computed from paired measurements.
- Explicit exports:
ZONES, HAZARDOUS_ZONES, ClarkeResult, clarke_zones, clarke_error_grid, iso15197_agreement_rate
Public Classes
| Class |
Signature |
Summary |
ClarkeResult |
ClarkeResult |
Zone counts and percentages for a set of paired measurements. |
ClarkeResult methods
clinically_acceptable_pct(self) -> float
hazardous_pct(self) -> float
summary_line(self) -> str
Public Functions
clarke_zones(reference: ArrayLike, predicted: ArrayLike) -> np.ndarray
clarke_error_grid(reference: ArrayLike, predicted: ArrayLike) -> ClarkeResult
iso15197_agreement_rate(reference: ArrayLike, measured: ArrayLike) -> float
Public Constants
iints.analysis.eucys_results
- Source:
src/iints/analysis/eucys_results.py
- Summary: No module docstring.
Public Functions
build_eucys_limitations_and_ethics_markdown() -> str
build_eucys_abstract_draft_markdown() -> str
build_eucys_poster_outline_markdown() -> str
build_eucys_jury_qa_markdown() -> str
build_eucys_filled_abstract_markdown(*, root_summary: dict[str, Any], clean_summary: dict[str, Any], study_design: dict[str, Any]) -> str
generate_eucys_main_figure(clean_summary: dict[str, Any], *, output_path: str | Path, csv_output_path: str | Path | None = None) -> dict[str, str]
generate_eucys_results_bundle(study_root: str | Path, *, output_dir: str | Path | None = None) -> dict[str, str]
Public Constants
iints.analysis.evidence_bundle
- Source:
src/iints/analysis/evidence_bundle.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
EvidenceRun |
EvidenceRun |
No module docstring. |
EvidenceRun methods
to_dict(self) -> Dict[str, Any]
Public Functions
build_evidence_bundle(run_dirs: Iterable[tuple[str, Path]], *, output_dir: Path, title: str = 'IINTS Research Evidence Bundle', local_ai_dir: Optional[Path] = None, pump_bundle_dir: Optional[Path] = None) -> Dict[str, Any]
Public Constants
iints.analysis.explainability
- Source:
src/iints/analysis/explainability.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ExplainabilityAnalyzer |
ExplainabilityAnalyzer |
Provides tools for analyzing and explaining the behavior of insulin algorithms. This module implements 'AI as explainability tool' by performing sensitivity analysis. |
ExplainabilityAnalyzer methods
calculate_glucose_variability(self) -> Dict[str, float]
analyze_insulin_response(self, algorithm_type: str = '') -> Dict[str, Any]
perform_sensitivity_analysis(self, algorithm_instance: Any, parameter_name: str, original_value: float, perturbations: List[float], simulation_run_func: Callable[[Any, List[Any], int], pd.DataFrame], fixed_events: Optional[List[Any]] = None, duration_minutes: int = 1440) -> Dict[float, Dict[str, Union[float, str]]]
iints.analysis.explainable_ai
- Source:
src/iints/analysis/explainable_ai.py
- Summary: Explainable AI Audit Trail - IINTS-AF Clinical decision transparency system for medical AI validation
Public Classes
| Class |
Signature |
Summary |
ClinicalAuditTrail |
ClinicalAuditTrail |
Explainable AI system for clinical decision transparency |
ClinicalAuditTrail methods
generate_ollama_insight(self, times, glucose, ffa, ketones, insulin)
log_decision(self, timestamp, glucose_current, glucose_trend, insulin_decision, algorithm_confidence, safety_override = False, context = None)
generate_clinical_summary(self, hours = 24)
export_audit_trail(self, filepath)
Public Functions
iints.analysis.hardware_benchmark
- Source:
src/iints/analysis/hardware_benchmark.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PerformanceMetrics |
PerformanceMetrics |
No module docstring. |
HardwareBenchmark |
HardwareBenchmark |
Hardware performance monitoring for Jetson and other platforms. |
HardwareBenchmark methods
start_monitoring(self)
stop_monitoring(self)
benchmark_algorithm(self, algorithm, test_data, iterations = 100)
get_current_metrics(self) -> Dict
get_metrics_summary(self) -> Dict
export_metrics(self, filename: str)
clear_metrics(self)
iints.analysis.metrics
- Source:
src/iints/analysis/metrics.py
- Summary: No module docstring.
Public Functions
calculate_tir(df: pd.DataFrame, lower_bound: float = 70.0, upper_bound: float = 180.0) -> float
calculate_hypoglycemia(df: pd.DataFrame, threshold: float = 70.0) -> float
calculate_hyperglycemia(df: pd.DataFrame, threshold: float = 180.0) -> float
calculate_average_glucose(df: pd.DataFrame) -> float
generate_benchmark_metrics(df: pd.DataFrame) -> Dict[str, float]
iints.analysis.population_report
- Source:
src/iints/analysis/population_report.py
- Summary: Population Report Generator — IINTS-AF ======================================== Generates a PDF report with aggregate statistics and visualisations for a Monte Carlo population evaluation run.
Public Classes
| Class |
Signature |
Summary |
PopulationReportGenerator |
PopulationReportGenerator |
Generate a PDF report for population simulation results. |
PopulationReportGenerator methods
generate_pdf(self, summary_df: pd.DataFrame, aggregate_metrics: Dict[str, Any], aggregate_safety: Dict[str, Any], output_path: str, title: str = 'IINTS-AF Population Evaluation Report') -> str
iints.analysis.poster
- Source:
src/iints/analysis/poster.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PosterScenario |
PosterScenario |
No module docstring. |
PosterScenario methods
to_dict(self) -> dict[str, Any]
Public Functions
generate_results_poster(run_dirs: Sequence[str | Path] | None = None, *, labels: Sequence[str] | None = None, output_path: str | Path = './results/posters/iints_results_poster.png', poster_title: str = '288 Decisions. Every Day. We Test Them All.', subtitle: str = 'Three IINTS-AF scenarios showing control, stress handling, and supervisor protection.', results_root: str | Path = './results', auto_limit: int = 3, summary_output_path: str | Path | None = None) -> dict[str, str]
iints.analysis.prediction_accuracy
- Source:
src/iints/analysis/prediction_accuracy.py
- Summary: Rate-aware accuracy analysis for glucose predictions.
- Explicit exports:
RATE_BIN_EDGES, RATE_BIN_LABELS, HYPO_THRESHOLD_MGDL, HYPER_THRESHOLD_MGDL, TREND_REVERSAL_MGDL_MIN, RATE_WINDOW_MINUTES, ACCEPTABLE_CLARKE_ZONES, rate_bin, profile_rate_of_change, glycemic_range, classify_predictions, directional_report
Public Functions
rate_bin(rate_mgdl_min: ArrayLike) -> np.ndarray
profile_rate_of_change(profile: np.ndarray, step_minutes: float, window_minutes: float = RATE_WINDOW_MINUTES) -> np.ndarray
glycemic_range(reference: ArrayLike) -> np.ndarray
classify_predictions(reference_profile: np.ndarray, predicted_profile: np.ndarray, step_minutes: float, window_minutes: float = RATE_WINDOW_MINUTES) -> Dict[str, np.ndarray]
trend_dynamics(reference_profile: np.ndarray, predicted_profile: np.ndarray, step_minutes: float, window_minutes: float = RATE_WINDOW_MINUTES) -> Dict[str, Any]
directional_report(reference_profile: np.ndarray, predicted_profile: np.ndarray, step_minutes: float, window_minutes: float = RATE_WINDOW_MINUTES) -> Dict[str, Any]
Public Constants
ACCEPTABLE_CLARKE_ZONES
HYPER_THRESHOLD_MGDL
HYPO_THRESHOLD_MGDL
RATE_BIN_EDGES
RATE_BIN_LABELS
RATE_WINDOW_MINUTES
TREND_REVERSAL_MGDL_MIN
iints.analysis.reporting
- Source:
src/iints/analysis/reporting.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ClinicalReportGenerator |
ClinicalReportGenerator |
Generate a clean, publication-ready PDF report. |
ClinicalReportGenerator methods
generate_agp_pdf(self, simulation_data: pd.DataFrame, output_path: str, *, title: str = 'IINTS Research AGP-Style Report', subject_name: str = 'Research simulation', safety_report: Optional[Dict[str, Any]] = None, target_low: float = 70.0, target_high: float = 180.0, summary_json_path: Optional[str] = None) -> str
export_agp_assets(self, simulation_data: pd.DataFrame, output_dir: str, *, subject_name: str = 'Research simulation', target_low: float = 70.0, target_high: float = 180.0, summary_json_path: Optional[str] = None, export_svg: bool = True) -> Dict[str, str]
export_plots(self, simulation_data: pd.DataFrame, output_dir: str) -> Dict[str, str]
generate_pdf(self, simulation_data: pd.DataFrame, safety_report: Dict[str, Any], output_path: str, title: str = 'IINTS-AF Clinical Report') -> str
generate_demo_pdf(self, simulation_data: pd.DataFrame, safety_report: Dict[str, Any], output_path: str, title: str = 'IINTS-AF Demo Report') -> str
Public Constants
AGP_TIR_STACK
BRAND_GREEN
BRAND_GREEN_DARK
SOFT_BLUE_PANEL
TEXT_DARK
iints.analysis.run_quality
- Source:
src/iints/analysis/run_quality.py
- Summary: No module docstring.
Public Functions
standardize_simulation_for_realism(results_df: pd.DataFrame) -> pd.DataFrame
build_result_quality_summary(results_df: pd.DataFrame, *, realism_report: Any, safety_report: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
write_run_quality_artifacts(results_df: pd.DataFrame, output_dir: str | Path, *, run_label: Optional[str] = None, safety_report: Optional[Dict[str, Any]] = None, realism_reference: Optional[str] = 'auto', local_ai_review: bool | str | None = None, local_ai_model: str | None = None, local_ai_timeout_seconds: float = 15.0, ollama_host: str | None = None) -> Dict[str, Any]
Public Constants
CORE_RESULT_COLUMNS
LOCAL_AI_REVIEW_ENV
LOCAL_AI_REVIEW_MODEL_ENV
LOCAL_AI_REVIEW_TIMEOUT_ENV
iints.analysis.safety_index
- Source:
src/iints/analysis/safety_index.py
- Summary: IINTS-AF Safety Index ===================== A single composite metric (0–100) that summarises the clinical safety of an insulin dosing algorithm's output. Higher is safer.
Public Classes
| Class |
Signature |
Summary |
SafetyIndexResult |
SafetyIndexResult |
Result of the IINTS Safety Index computation. |
SafetyIndexResult methods
Public Functions
compute_safety_index(results_df: pd.DataFrame, safety_report: Dict, duration_minutes: int, weights: Optional[Dict[str, float]] = None, time_step_minutes: float = 5.0) -> SafetyIndexResult
safety_weights_from_cli(w_below54: Optional[float] = None, w_below70: Optional[float] = None, w_supervisor: Optional[float] = None, w_recovery: Optional[float] = None, w_tail: Optional[float] = None) -> Dict[str, float]
Public Constants
DEFAULT_WEIGHTS
NORM_SCALES
iints.analysis.safety_visualizer
- Source:
src/iints/analysis/safety_visualizer.py
- Summary: No module docstring.
Public Functions
summarize_safety_trace(results_df: pd.DataFrame, safety_report: Optional[Dict[str, Any]] = None) -> Dict[str, Any]
build_safety_visualizer_html(results_df: pd.DataFrame, safety_report: Optional[Dict[str, Any]] = None, *, title: str = 'IINTS Safety Contract Visualizer') -> str
write_safety_visualizer(results_df: pd.DataFrame, output_html: str | Path, *, output_json: str | Path | None = None, safety_report: Optional[Dict[str, Any]] = None, title: str = 'IINTS Safety Contract Visualizer') -> Dict[str, str]
iints.analysis.sensor_filtering
- Source:
src/iints/analysis/sensor_filtering.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SensorNoiseModel |
SensorNoiseModel |
Realistic sensor noise with drift and filtering. |
KalmanFilter |
KalmanFilter |
Simple Kalman filter for glucose smoothing. |
MovingAverageFilter |
MovingAverageFilter |
Simple moving average filter. |
SensorNoiseModel methods
add_noise(self, true_glucose, time_step)
KalmanFilter methods
update(self, measurement)
MovingAverageFilter methods
iints.analysis.study_analysis
- Source:
src/iints/analysis/study_analysis.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StudyRunSummary |
StudyRunSummary |
No module docstring. |
StudySummary |
StudySummary |
No module docstring. |
StudyComparison |
StudyComparison |
No module docstring. |
StudyRunSummary methods
to_dict(self) -> dict[str, Any]
StudySummary methods
to_dict(self) -> dict[str, Any]
StudyComparison methods
to_dict(self) -> dict[str, Any]
Public Functions
quality_badges_for_metrics(metrics: dict[str, float], *, certified: bool | None = None) -> list[str]
analyze_run_directory(run_dir: Path) -> StudyRunSummary
analyze_study_directory(study_dir: Path, *, external_reference_metrics: Path | None = None) -> StudySummary
load_study_summary(path: str | Path) -> StudySummary
compare_studies(left: str | Path, right: str | Path, *, left_label: str | None = None, right_label: str | None = None) -> StudyComparison
Public Constants
CALIBRATION_METRICS
CORE_METRIC_KEYS
PAIRWISE_METRICS
iints.analysis.study_engine
- Source:
src/iints/analysis/study_engine.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StudyProfileSpec |
StudyProfileSpec |
No module docstring. |
StudyAlgorithmSpec |
StudyAlgorithmSpec |
No module docstring. |
StudyArmSpec |
StudyArmSpec |
No module docstring. |
StudyMatrixRow |
StudyMatrixRow |
No module docstring. |
StudyDesignPayload |
StudyDesignPayload |
No module docstring. |
StudyProfileSpec methods
to_dict(self) -> dict[str, str]
StudyAlgorithmSpec methods
to_dict(self) -> dict[str, str]
StudyArmSpec methods
to_dict(self) -> dict[str, Any]
StudyMatrixRow methods
to_dict(self) -> dict[str, Any]
StudyDesignPayload methods
to_dict(self) -> dict[str, Any]
Public Functions
slugify_study_token(value: str) -> str
resolve_profile_specs(profile_set: str = DEFAULT_PROFILE_SET) -> list[StudyProfileSpec]
build_algorithm_registry(*, candidate_algorithm: str, candidate_source_type: str = 'path', candidate_source_ref: str | None = None, include_default_baselines: bool = True, extra_algorithms: list[str] | None = None) -> list[StudyAlgorithmSpec]
build_study_design_payload(*, preset: str = 'default', title: str = 'IINTS Scientific Validation Protocol', primary_hypothesis: str | None = None, scenarios: list[str] | None = None, seeds: list[int] | None = None, candidate_algorithm: str = 'your_algorithm', include_default_baselines: bool = True, extra_algorithms: list[str] | None = None, profile_set: str = DEFAULT_PROFILE_SET, external_reference_label: str = 'CareLink personal workbench metrics', candidate_source_type: str = 'path', candidate_source_ref: str | None = None) -> StudyDesignPayload
Public Constants
DEFAULT_BASELINE_ALGORITHMS
DEFAULT_HYPOTHESES
DEFAULT_METRICS
DEFAULT_PROFILE_SET
DEFAULT_RESEARCH_QUESTION
iints.analysis.study_experiment
- Source:
src/iints/analysis/study_experiment.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StudyExperimentConfig |
StudyExperimentConfig |
No module docstring. |
Public Functions
load_study_experiment_config(path: str | Path) -> StudyExperimentConfig
build_study_experiment_template(*, preset: str, title: str, profile_set: str, seeds: list[int], candidate_algorithm: str, scenarios: list[str], include_default_baselines: bool, extra_algorithms: list[str] | None = None, external_reference_label: str = 'CareLink personal workbench metrics', default_output_dir: str | None = None) -> dict[str, Any]
render_study_experiment_yaml(payload: dict[str, Any]) -> str
iints.analysis.study_poster
- Source:
src/iints/analysis/study_poster.py
- Summary: No module docstring.
Public Functions
generate_study_poster(summary_input: str | Path | StudySummary, *, output_path: str | Path = 'results/study_poster.png', title: str = 'IINTS Study Results', subtitle: str = 'Simulation evidence across runs, safety behavior, and certification quality.', summary_output_path: str | Path | None = None) -> dict[str, str]
iints.analysis.study_protocol
- Source:
src/iints/analysis/study_protocol.py
- Summary: No module docstring.
Public Functions
build_study_protocol_payload(*, preset: str = 'default', title: str = 'IINTS Scientific Validation Protocol', primary_hypothesis: str | None = None, scenarios: list[str] | None = None, seeds: list[int] | None = None, algorithms: list[str] | None = None, corruption_modes: list[str] | None = None, external_reference_label: str = 'CareLink personal workbench metrics', profile_set: str = DEFAULT_PROFILE_SET, include_default_baselines: bool = True, extra_algorithms: list[str] | None = None) -> dict[str, Any]
render_study_protocol_markdown(payload: dict[str, Any]) -> str
write_study_protocol_bundle(output_dir: str | Path, *, preset: str = 'default', title: str = 'IINTS Scientific Validation Protocol', primary_hypothesis: str | None = None, scenarios: list[str] | None = None, seeds: list[int] | None = None, algorithms: list[str] | None = None, corruption_modes: list[str] | None = None, external_reference_label: str = 'CareLink personal workbench metrics', profile_set: str = DEFAULT_PROFILE_SET, include_default_baselines: bool = True, extra_algorithms: list[str] | None = None) -> dict[str, str]
Public Constants
DEFAULT_CORRUPTION_MODES
DEFAULT_SCENARIOS
iints.analysis.validator
- Source:
src/iints/analysis/validator.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ReliabilityLevel |
ReliabilityLevel(Enum) |
No module docstring. |
ValidationResult |
ValidationResult |
No module docstring. |
DataIntegrityValidator |
DataIntegrityValidator |
Validates data integrity for reverse engineering analysis. |
AlgorithmicDriftDetector |
AlgorithmicDriftDetector |
Detects when AI algorithms drift from safe baseline behavior. |
StatisticalReliabilityChecker |
StatisticalReliabilityChecker |
Checks statistical reliability of Monte Carlo results. |
ReverseEngineeringValidator |
ReverseEngineeringValidator |
Main validator for reverse engineering analysis. |
DataIntegrityValidator methods
validate_glucose_data(self, glucose_values: List[float], timestamps: List[float]) -> ValidationResult
validate_insulin_data(self, insulin_values: List[float]) -> ValidationResult
AlgorithmicDriftDetector methods
detect_drift(self, ai_outputs: List[float], baseline_outputs: List[float]) -> ValidationResult
StatisticalReliabilityChecker methods
check_monte_carlo_reliability(self, results: List[List[float]]) -> ValidationResult
ReverseEngineeringValidator methods
validate_simulation_results(self, simulation_df: pd.DataFrame, baseline_results: Optional[List[float]] = None, monte_carlo_results: Optional[List[List[float]]] = None) -> Dict[str, ValidationResult]
generate_reliability_report(self, validation_results: Dict[str, ValidationResult]) -> Dict[str, Any]
iints.api
- Source:
src/iints/api/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.api.base_algorithm
- Source:
src/iints/api/base_algorithm.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
AlgorithmInput |
AlgorithmInput |
Dataclass for inputs to the insulin prediction algorithm. |
AlgorithmMetadata |
AlgorithmMetadata |
Metadata for algorithm registration and identification |
AlgorithmResult |
AlgorithmResult |
Result of an insulin prediction with uncertainty |
WhyLogEntry |
WhyLogEntry |
Single entry in the Why Log explaining a decision reason |
InsulinAlgorithm |
InsulinAlgorithm(ABC) |
Abstract base class for insulin delivery algorithms. |
AlgorithmResult methods
WhyLogEntry methods
InsulinAlgorithm methods
set_isf(self, isf: float)
set_icr(self, icr: float)
get_algorithm_metadata(self) -> AlgorithmMetadata
set_algorithm_metadata(self, metadata: AlgorithmMetadata)
calculate_uncertainty(self, data: AlgorithmInput) -> float
calculate_confidence_interval(self, data: AlgorithmInput, prediction: float, uncertainty: float) -> tuple
explain_prediction(self, data: AlgorithmInput, prediction: Dict[str, Any]) -> str
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
get_why_log(self) -> List[WhyLogEntry]
get_why_log_text(self) -> str
reset(self)
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any])
iints.api.registry
- Source:
src/iints/api/registry.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
AlgorithmListing |
AlgorithmListing |
No module docstring. |
LocalPluginRecord |
LocalPluginRecord |
No module docstring. |
LocalPluginRecord methods
from_dict(cls, payload: Mapping[str, Any]) -> 'LocalPluginRecord'
to_dict(self) -> dict[str, Any]
Public Functions
get_plugin_home() -> Path
get_plugin_registry_path() -> Path
list_local_plugin_records(kind: str | None = None) -> list[LocalPluginRecord]
install_file_plugin(kind: str, source_path: str | Path, name: str | None = None) -> LocalPluginRecord
install_algorithm_plugin(source_path: str | Path, name: str | None = None) -> LocalPluginRecord
uninstall_local_plugin(name: str, kind: str | None = None, *, remove_file: bool = False) -> bool
list_algorithm_plugins() -> List[AlgorithmListing]
Public Constants
IINTS_PLUGIN_HOME_ENV
PLUGIN_REGISTRY_SCHEMA_VERSION
SUPPORTED_LOCAL_PLUGIN_KINDS
iints.api.template_algorithm
- Source:
src/iints/api/template_algorithm.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
TemplateAlgorithm |
TemplateAlgorithm(InsulinAlgorithm) |
This is a template for a user-defined insulin delivery algorithm. It demonstrates the required structure and provides a basic, safe implementation of a correction and meal bolus logic. |
TemplateAlgorithm methods
get_algorithm_metadata(self) -> AlgorithmMetadata
predict_insulin(self, data: AlgorithmInput) -> Dose
reset(self)
iints.cli
- Source:
src/iints/cli/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.cli.cli
- Source:
src/iints/cli/cli.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
BrandedTyperGroup |
BrandedTyperGroup(TyperGroup) |
No module docstring. |
BrandedTyperGroup methods
Public Functions
app_callback(ctx: typer.Context, version: Annotated[bool, typer.Option('--version', help='Show the installed SDK version and exit.', is_eager=True)] = False)
evaluate(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], population: Annotated[int, typer.Option(help='Number of virtual patients to simulate')] = 100, patient_config_name: Annotated[str, typer.Option('--patient-config', help='Base patient configuration name')] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option('--patient-config-path', help='Path to base patient config YAML')] = None, scenario_path: Annotated[Optional[Path], typer.Option('--scenario', help='Path to scenario JSON')] = None, duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 720, time_step: Annotated[int, typer.Option(help='Time step in minutes')] = 5, output_dir: Annotated[Optional[Path], typer.Option(help='Output directory')] = None, max_workers: Annotated[Optional[int], typer.Option(help='Max parallel workers (default: all cores)')] = None, seed: Annotated[Optional[int], typer.Option(help='Random seed for reproducibility')] = None, patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model: auto, bergman, custom, simglucose')] = 'auto')
doctor(smoke_run: Annotated[bool, typer.Option(help='Run a short deterministic smoke simulation')] = False, smoke_duration: Annotated[int, typer.Option(help='Smoke simulation duration in minutes')] = 30, full: Annotated[bool, typer.Option('--full', help='Run extra environment checks that help beginners debug setup issues')] = False, suggest: Annotated[bool, typer.Option('--suggest', help='Print concrete next commands based on what doctor finds')] = False)
version_status(refresh: Annotated[bool, typer.Option('--refresh/--cached', help='Refresh stable release metadata instead of using a fresh cache entry.')] = False, offline: Annotated[bool, typer.Option('--offline', help='Do not access release services; use local and cached information only.')] = False, json_output: Annotated[bool, typer.Option('--json', help='Emit machine-readable JSON.')] = False, fail_if_outdated: Annotated[bool, typer.Option('--fail-if-outdated', help='Exit with code 2 when a newer stable SDK release exists.')] = False, fail_if_unknown: Annotated[bool, typer.Option('--fail-if-unknown', help='Exit with code 3 when the latest stable release cannot be verified.')] = False, fail_if_mismatch: Annotated[bool, typer.Option('--fail-if-mismatch', help='Exit with code 4 when package metadata and active SDK source report different versions.')] = False) -> None
update_sdk(source: Annotated[str, typer.Option(help='Update source: auto, pypi, or github. Auto uses the stable PyPI release channel.')] = 'auto', install_extras: Annotated[str, typer.Option('--extras', help='Comma-separated extras to install, e.g. full,mdmp,research,edge. Use empty string for none.')] = 'full,mdmp,research,edge', github_ref: Annotated[str, typer.Option('--github-ref', help="Git ref used with --source github. Use 'stable' for the latest SDK release tag.")] = 'stable', user: Annotated[bool, typer.Option('--user/--no-user', help='Pass --user to pip for user-site installs.')] = False, pre: Annotated[bool, typer.Option('--pre/--no-pre', help='Allow pre-release versions.')] = False, upgrade_pip: Annotated[bool, typer.Option('--upgrade-pip/--no-upgrade-pip', help='Upgrade pip before installing IINTS.')] = False, repair: Annotated[bool, typer.Option('--repair/--no-repair', help='Uninstall legacy/conflicting IINTS packages before reinstalling.')] = False, force_reinstall: Annotated[bool, typer.Option('--force-reinstall/--no-force-reinstall', help='Ask pip to reinstall even if the version appears current.')] = False, no_cache_dir: Annotated[bool, typer.Option('--no-cache-dir/--use-pip-cache', help="Disable pip's wheel/download cache for this update.")] = False, dry_run: Annotated[bool, typer.Option('--dry-run', help='Print the pip command without executing it.')] = False, yes: Annotated[bool, typer.Option('--yes', '-y', help='Run without asking for confirmation.')] = False, verify: Annotated[bool, typer.Option('--verify/--no-verify', help='Verify the installed package version after the update command completes.')] = True, check_only: Annotated[bool, typer.Option('--check', help='Check stable release metadata without changing the environment.')] = False) -> None
delete_sdk(everything: Annotated[bool, typer.Option('--everything/--standard', help='Remove packages, user data, local generated outputs, and a detected IINTS source checkout.')] = False, packages: Annotated[bool, typer.Option('--packages/--no-packages', help='Uninstall IINTS Python packages from the active Python environment.')] = True, user_data: Annotated[bool, typer.Option('--user-data/--no-user-data', help='Remove user-level IINTS config, plugin, and cache folders.')] = True, local_outputs: Annotated[bool, typer.Option('--local-outputs/--no-local-outputs', help='Also remove known generated IINTS output folders in the current directory.')] = False, source_checkout: Annotated[bool, typer.Option('--source-checkout/--no-source-checkout', help='Also remove the detected local IINTS-SDK source checkout, if running from one.')] = False, extra_path: Annotated[Optional[List[Path]], typer.Option('--path', help='Extra IINTS-owned path to remove. Refuses home, root, and current working directory.')] = None, dry_run: Annotated[bool, typer.Option('--dry-run', help='Show what would be removed without deleting anything.')] = False, yes: Annotated[bool, typer.Option('--yes', '-y', help='Delete without asking for confirmation.')] = False) -> None
run_doctor(algo: Annotated[Optional[Path], typer.Option(help='Algorithm Python file to inspect.')] = None, patient_config_path: Annotated[Optional[Path], typer.Option(help='Patient YAML used for the run.')] = None, scenario_path: Annotated[Optional[Path], typer.Option('--scenario-path', '--scenario', help='Scenario JSON used for the run.')] = None, duration: Annotated[int, typer.Option(help='Requested duration in minutes.')] = 1440, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes.')] = 5, output_dir: Annotated[Optional[Path], typer.Option(help='Output directory to preflight.')] = None, patient_config_name: Annotated[str, typer.Option(help='Packaged patient profile name, if not using a YAML path.')] = 'default_patient', output_json: Annotated[Optional[Path], typer.Option(help='Optional JSON report path.')] = None, fail_on_warning: Annotated[bool, typer.Option(help='Exit with code 1 when any warning is found.')] = False) -> None
evidence_build(run: Annotated[List[str], typer.Option('--run', help='Repeatable run input in label=path form, for example normal=results/normal.')], output_dir: Annotated[Path, typer.Option(help='Output directory for the evidence bundle.')] = Path('results/evidence_bundle'), title: Annotated[str, typer.Option(help='Human-readable bundle title.')] = 'IINTS Research Evidence Bundle', local_ai_dir: Annotated[Optional[Path], typer.Option(help='Optional local AI lab output directory.')] = None, pump_bundle_dir: Annotated[Optional[Path], typer.Option(help='Optional Pico pump bundle directory.')] = None) -> None
validation_profiles(profiles_path: Annotated[Optional[Path], typer.Option(help='Optional custom profiles YAML')] = None)
replay_check(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt)')] = None, patient_config_name: Annotated[str, typer.Option(help='Patient config name')] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Patient config YAML path')] = None, scenario_path: Annotated[Optional[Path], typer.Option(help='Path to scenario JSON')] = None, duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 240, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, seed: Annotated[int, typer.Option(help='Deterministic seed')] = 42, repeats: Annotated[int, typer.Option(help='Replay runs to compare')] = 2, output_json: Annotated[Optional[Path], typer.Option(help='Optional output JSON path')] = None, fail_on_mismatch: Annotated[bool, typer.Option(help='Exit code 1 if replay mismatch is detected')] = True)
golden_benchmark(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt)')] = None, pack_path: Annotated[Optional[Path], typer.Option(help='Optional golden benchmark YAML path')] = None, output_dir: Annotated[Optional[Path], typer.Option(help='Optional output directory for benchmark runs')] = None, seed: Annotated[int, typer.Option(help='Random seed')] = 42, duration_override: Annotated[Optional[int], typer.Option(help='Optional duration override (minutes)')] = None, output_json: Annotated[Optional[Path], typer.Option(help='Write benchmark report JSON')] = None, fail_on_check: Annotated[bool, typer.Option(help='Exit code 1 when any scenario fails')] = True)
validate_run(results_csv: Annotated[Path, typer.Option(help='Path to simulation results CSV')], profile: Annotated[str, typer.Option(help='Validation profile id')] = 'research_default', safety_report_path: Annotated[Optional[Path], typer.Option(help='Optional safety report JSON')] = None, duration_minutes: Annotated[Optional[int], typer.Option(help='Override run duration (minutes)')] = None, profiles_path: Annotated[Optional[Path], typer.Option(help='Optional custom profiles YAML')] = None, output_json: Annotated[Optional[Path], typer.Option(help='Write validation report JSON')] = None, fail_on_check: Annotated[bool, typer.Option(help='Exit with code 1 when required checks fail')] = True)
analyze(study_dir: Annotated[Path, typer.Argument(help='Directory containing one or more run folders.')], output_json: Annotated[Path, typer.Option(help='Write aggregated study summary JSON')] = Path('results/study_summary.json'), output_markdown: Annotated[Optional[Path], typer.Option(help='Optional markdown summary path')] = None, output_csv: Annotated[Optional[Path], typer.Option(help='Optional evidence-table CSV path')] = None, output_evidence_markdown: Annotated[Optional[Path], typer.Option(help='Optional evidence-table markdown path')] = None, carelink_metrics: Annotated[Optional[Path], typer.Option(help='Optional CareLink metrics JSON or workbench directory for external plausibility comparison')] = None) -> None
compare_study(left: Annotated[Path, typer.Argument(help='Left study directory or study summary JSON')], right: Annotated[Path, typer.Argument(help='Right study directory or study summary JSON')], output_json: Annotated[Path, typer.Option(help='Write comparison JSON')] = Path('results/study_comparison.json'), output_markdown: Annotated[Optional[Path], typer.Option(help='Optional markdown comparison path')] = None, left_label: Annotated[Optional[str], typer.Option(help='Optional display label for the left study')] = None, right_label: Annotated[Optional[str], typer.Option(help='Optional display label for the right study')] = None) -> None
poster_study(study_input: Annotated[Path, typer.Argument(help='Study directory or study summary JSON')], output_path: Annotated[Path, typer.Option(help='Output PNG path')] = Path('results/study_poster.png'), title: Annotated[str, typer.Option(help='Poster title')] = 'IINTS Study Results', subtitle: Annotated[str, typer.Option(help='Poster subtitle')] = 'Simulation evidence across runs, safety behavior, and certification quality.') -> None
demo_expo(output_dir: Annotated[Path, typer.Option(help='Directory for the expo demo bundle')] = Path('results/expo_demo'), patient_config: Annotated[str, typer.Option(help='Patient profile name or path-like identifier')] = 'default_patient', duration_minutes: Annotated[int, typer.Option(help='Scenario duration in minutes')] = 360, seed: Annotated[int, typer.Option(help='Random seed for reproducible expo runs')] = 42) -> None
run_study(ctx: typer.Context, algo: Annotated[Optional[Path], typer.Option(help='Path to the algorithm Python file')] = None, experiment: Annotated[Optional[Path], typer.Option(help='Optional study experiment YAML file')] = None, output_dir: Annotated[Path, typer.Option(help='Root directory for the study bundle')] = Path('results/study_bundle'), preset: Annotated[str, typer.Option(help='Study preset: default or eucys')] = 'default', profile_set: Annotated[str, typer.Option(help='Patient profile set to evaluate')] = DEFAULT_PROFILE_SET, scenarios: Annotated[str, typer.Option(help='Optional comma-separated scenario slugs to run')] = '', seeds: Annotated[str, typer.Option(help='Comma-separated seed list')] = '1,2,3,4,5', duration: Annotated[Optional[int], typer.Option(help='Override scenario duration in minutes')] = None, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, carelink_metrics: Annotated[Optional[Path], typer.Option(help='Optional CareLink metrics JSON or workbench directory for plausibility comparison')] = None, prepare_ai: Annotated[bool, typer.Option(help='Generate AI-ready artifacts for non-corrupted study arms')] = True, reference_csv: Annotated[Optional[Path], typer.Option(help='Optional source CSV to corrupt and archive alongside the study protocol')] = None, include_default_baselines: Annotated[bool, typer.Option('--include-default-baselines/--no-include-default-baselines', help='Include the default baseline registry in the study matrix')] = True, extra_algorithms: Annotated[str, typer.Option(help='Comma-separated additional comparison algorithm labels')] = '', external_reference_label: Annotated[str, typer.Option(help='Label for the plausibility reference lane')] = 'CareLink personal workbench metrics', gate_profile: Annotated[Optional[str], typer.Option(help='Optional calibration gate profile id')] = None, gate_profiles_path: Annotated[Optional[Path], typer.Option(help='Optional calibration gate profiles YAML path')] = None, fail_on_gate: Annotated[bool, typer.Option(help='Exit with code 1 when any run fails the calibration gate')] = False) -> None
run_eucys_study(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], patient_config_name: Annotated[str, typer.Option(help='Legacy option kept for compatibility; the EUCYS preset now uses the fixed clinic_safe_core profile set')] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Legacy option kept for compatibility; the EUCYS preset now uses the fixed clinic_safe_core profile set')] = None, output_dir: Annotated[Path, typer.Option(help='Root directory for the EUCYS study bundle')] = Path('results/eucys_study'), seeds: Annotated[str, typer.Option(help='Comma-separated seed list')] = '1,2,3,4,5,6,7,8,9,10', duration: Annotated[Optional[int], typer.Option(help='Override scenario duration in minutes')] = None, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, carelink_metrics: Annotated[Optional[Path], typer.Option(help='Optional CareLink metrics JSON or workbench directory for plausibility comparison')] = None, prepare_ai: Annotated[bool, typer.Option(help='Generate AI-ready artifacts for certified study arms')] = True, reference_csv: Annotated[Optional[Path], typer.Option(help='Optional source CSV to corrupt and archive alongside the study protocol')] = None, include_default_baselines: Annotated[bool, typer.Option('--include-default-baselines/--no-include-default-baselines', help='Include the default baseline registry in the EUCYS matrix')] = True, gate_profile: Annotated[Optional[str], typer.Option(help='Optional calibration gate profile id')] = None, gate_profiles_path: Annotated[Optional[Path], typer.Option(help='Optional calibration gate profiles YAML path')] = None, fail_on_gate: Annotated[bool, typer.Option(help='Exit with code 1 when any run fails the calibration gate')] = False) -> None
eucys_results(study_dir: Annotated[Path, typer.Argument(help='Root directory of a completed EUCYS or run-study bundle.')], output_dir: Annotated[Optional[Path], typer.Option(help='Optional output directory for the packaged EUCYS results bundle. Defaults to <study_dir>/EUCYS_RESULTS.')] = None) -> None
study_protocol(ctx: typer.Context, output_dir: Annotated[Path, typer.Option(help='Directory where the protocol bundle should be written')] = Path('results/study_protocol'), experiment: Annotated[Optional[Path], typer.Option(help='Optional study experiment YAML file to seed the protocol bundle')] = None, preset: Annotated[str, typer.Option(help='Protocol preset: default or eucys')] = 'default', title: Annotated[str, typer.Option(help='Protocol title')] = 'IINTS Scientific Validation Protocol', primary_hypothesis: Annotated[Optional[str], typer.Option(help='Optional override for the primary H1 hypothesis')] = None, seeds: Annotated[str, typer.Option(help='Comma-separated seed list')] = '1,2,3,4,5', algorithms: Annotated[str, typer.Option(help='Comma-separated candidate+comparison algorithms (legacy; first entry becomes the candidate)')] = 'your_algorithm', scenarios: Annotated[str, typer.Option(help='Comma-separated scenario names')] = 'baseline_day,meal_challenge,exercise_challenge,supervisor_override', profile_set: Annotated[str, typer.Option(help='Patient profile set to encode in the study protocol')] = DEFAULT_PROFILE_SET, include_default_baselines: Annotated[bool, typer.Option('--include-default-baselines/--no-include-default-baselines', help='Include the default baseline registry in the protocol bundle')] = True, extra_algorithms: Annotated[str, typer.Option(help='Comma-separated additional algorithm labels for the protocol bundle')] = '', corruption_modes: Annotated[str, typer.Option(help='Comma-separated corruption modes for the protocol plan')] = ','.join(AVAILABLE_STUDY_CORRUPTIONS), external_reference_label: Annotated[str, typer.Option(help='Label for the real-world plausibility reference')] = 'CareLink personal workbench metrics') -> None
contract_verify(contract_path: Annotated[Optional[Path], typer.Option(help='Optional YAML safety-contract file')] = None, glucose_min: Annotated[float, typer.Option(help='Minimum glucose to test (mg/dL)')] = 50.0, glucose_max: Annotated[float, typer.Option(help='Maximum glucose to test (mg/dL)')] = 160.0, glucose_step: Annotated[float, typer.Option(help='Glucose grid step (mg/dL)')] = 5.0, trend_min: Annotated[float, typer.Option(help='Minimum trend to test (mg/dL/min)')] = -5.0, trend_max: Annotated[float, typer.Option(help='Maximum trend to test (mg/dL/min)')] = 3.0, trend_step: Annotated[float, typer.Option(help='Trend grid step (mg/dL/min)')] = 0.5, proposed_doses: Annotated[str, typer.Option(help='Comma-separated proposed insulin doses (U)')] = '0.0,0.5,1.0,2.0,4.0', iob_values: Annotated[Optional[str], typer.Option(help='Optional comma-separated current IOB values (U)')] = None, output_json: Annotated[Optional[Path], typer.Option(help='Write contract verification report JSON')] = None, fail_on_violation: Annotated[bool, typer.Option(help='Exit with code 1 when any contract violation is found')] = True)
certify_run(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], profile: Annotated[str, typer.Option(help='Validation profile id')] = 'research_default', predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt) for dual-guard forecasting')] = None, patient_config_name: Annotated[str, typer.Option(help='Name of the patient configuration')] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Path to a patient config YAML')] = None, scenario_path: Annotated[Optional[Path], typer.Option(help='Path to scenario JSON')] = None, duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 720, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, output_dir: Annotated[Path, typer.Option(help='Directory to save outputs')] = Path('results/certified_run'), seed: Annotated[Optional[int], typer.Option(help='Random seed')] = None, export_sources: Annotated[bool, typer.Option(help='Write sources_manifest.json with peer-reviewed references.')] = True, source_category: Annotated[Optional[str], typer.Option(help='Optional evidence source category filter (guideline, trial, model, ...).')] = None, write_summary: Annotated[bool, typer.Option(help='Write SUMMARY.md with key artifacts and next steps.')] = True, fail_on_check: Annotated[bool, typer.Option(help='Exit code 1 when validation profile fails')] = True)
study_ready(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], scenario_path: Annotated[Optional[Path], typer.Option(help='Path to scenario JSON')] = None, output_dir: Annotated[Path, typer.Option(help='Directory to save outputs')] = Path('results/study_ready'), duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 720, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, seed: Annotated[Optional[int], typer.Option(help='Random seed')] = None, profile: Annotated[str, typer.Option(help='Validation profile id')] = 'research_default', predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt)')] = None, patient_config_name: Annotated[str, typer.Option(help='Patient configuration name')] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Optional patient config YAML path')] = None, fail_on_check: Annotated[bool, typer.Option(help='Exit code 1 when validation profile fails')] = True)
init(project_name: Annotated[str, typer.Option(help='Name of the project directory')] = 'my_iints_project', template: Annotated[str, typer.Option(help='Project template: research or clinical-trial')] = 'research')
quickstart(project_name: Annotated[str, typer.Option(help='Name of the project directory')] = 'iints_quickstart')
demo(demo_kind: Annotated[Optional[str], typer.Argument(help='Optional story preset: doctor, eucys, booth, live, quick, or full. Example:iints demo eucys.')] = None, output_dir: Annotated[Path, typer.Option(help='Directory where demo outputs should be written')] = Path('results/demo'), mode: Annotated[str, typer.Option('--mode', help='Demo mode: live, quick, or full')] = 'live', quick_mode: Annotated[bool, typer.Option('--quick', help='Shortcut for --mode quick')] = False, full_mode: Annotated[bool, typer.Option('--full', help='Shortcut for --mode full')] = False, presentation_mode: Annotated[bool, typer.Option('--presentation/--simulation-only', help='Default starts the full presentation demo; use --simulation-only for the old one-run starter simulation.')] = True, preset: Annotated[Optional[str], typer.Option(help='Optional preset override. Defaults to quickstart_meal for quick and realistic_reference_day for full.')] = None, seed: Annotated[int, typer.Option(help='Deterministic seed for the bundled demo')] = 42, compare_baselines: Annotated[bool, typer.Option(help='Include built-in baselines in the demo output')] = True, audience: Annotated[str, typer.Option(help='Presenter framing for the live demo: mixed, clinical, engineering, or jury.')] = 'jury', prepare_ai: Annotated[bool, typer.Option('--prepare-ai/--skip-ai', help='Prepare optional local-AI artifacts during the live demo.')] = False, build_evidence: Annotated[bool, typer.Option('--evidence/--no-evidence', help='Build a public research evidence bundle after the demo.')] = True, full_code: Annotated[bool, typer.Option('--full-code/--preview-code', help='Print the whole exported live demo script instead of the curated preview.')] = False, overwrite: Annotated[bool, typer.Option('--overwrite/--no-overwrite', help='Allow replacing previously exported live demo files.')] = True, stage_mode: Annotated[bool, typer.Option('--stage/--technical', help='Default keeps the live demo audience-safe; --technical shows more raw execution detail.')] = True, dry_run: Annotated[bool, typer.Option('--dry-run', help='Show the plan without running the demo')] = False)
start(goal: Annotated[str, typer.Option('--goal', help='What you want to do: demo, project, study, edge, or data. Aliases like pi, research, and quickstart also work.')] = 'demo', run_now: Annotated[bool, typer.Option('--run', help='Run the safe starter action for demo, project, or edge instead of only printing the plan.')] = False, output_dir: Annotated[Path, typer.Option(help='Output directory for --goal demo.')] = Path('results/demo'), project_name: Annotated[str, typer.Option(help='Project folder name for --goal project.')] = 'iints_quickstart', edge_output_dir: Annotated[Path, typer.Option(help='Edge project folder for --goal edge.')] = Path('iints_pi_demo'), board: Annotated[str, typer.Option(help='Edge board for --goal edge: raspberry_pi or uno_q.')] = 'raspberry_pi') -> None
onboard(output_dir: Annotated[Path, typer.Option(help='Root directory for the canonical onboarding outputs.')] = Path('results/onboarding'), run_safe_steps: Annotated[bool, typer.Option('--run-safe-steps', help='Run doctor, demo, import-demo, and realism-check.')] = False) -> None
cli_map()
cli_overview()
cli_menu()
cli_hub()
guide()
new_algo(name: Annotated[str, typer.Option(help='Name of the new algorithm')], author: Annotated[str, typer.Option(help='Author of the algorithm')], output_dir: Annotated[Path, typer.Option(help='Directory to save the new algorithm file')] = Path('.'))
presets_list()
presets_show(name: Annotated[str, typer.Option(help='Preset name (e.g., baseline_t1d)')])
presets_run(name: Annotated[str, typer.Option(help='Preset name (e.g., baseline_t1d)')], algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt) for dual-guard forecasting')] = None, output_dir: Annotated[Optional[Path], typer.Option(help='Directory to save outputs')] = None, compare_baselines: Annotated[bool, typer.Option(help='Run PID and standard pump baselines in the background')] = True, seed: Annotated[Optional[int], typer.Option(help='Random seed for deterministic runs')] = None, patient_model_type: Annotated[str, typer.Option('--patient-model', help='Patient model: auto, bergman, custom, simglucose')] = 'auto', sensor_profile: Annotated[Optional[str], typer.Option(help=f"Sensor artifact profile: {', '.join(sorted(SENSOR_PROFILES))}")] = None, sensor_noise_std: Annotated[Optional[float], typer.Option('--sensor-noise-std', help='CGM noise std (mg/dL)')] = None, sensor_lag_minutes: Annotated[Optional[int], typer.Option('--sensor-lag-minutes', help='CGM lag (minutes)')] = None, sensor_dropout_prob: Annotated[Optional[float], typer.Option('--sensor-dropout-prob', help='CGM dropout probability (0-1)')] = None, sensor_bias: Annotated[Optional[float], typer.Option('--sensor-bias', help='CGM bias (mg/dL)')] = None, safety_min_glucose: Annotated[Optional[float], typer.Option('--safety-min-glucose', help='Min plausible glucose (mg/dL)')] = None, safety_max_glucose: Annotated[Optional[float], typer.Option('--safety-max-glucose', help='Max plausible glucose (mg/dL)')] = None, safety_max_glucose_delta_per_5_min: Annotated[Optional[float], typer.Option('--safety-max-glucose-delta-per-5-min', help='Max glucose delta per 5 min (mg/dL)')] = None, safety_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hypo-threshold', help='Hypoglycemia threshold (mg/dL)')] = None, safety_severe_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-severe-hypo-threshold', help='Severe hypoglycemia threshold (mg/dL)')] = None, safety_hyperglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hyper-threshold', help='Hyperglycemia threshold (mg/dL)')] = None, safety_max_insulin_per_bolus: Annotated[Optional[float], typer.Option('--safety-max-bolus', help='Max insulin per bolus (U)')] = None, safety_glucose_rate_alarm: Annotated[Optional[float], typer.Option('--safety-glucose-rate-alarm', help='Glucose rate alarm (mg/dL/min)')] = None, safety_max_insulin_per_hour: Annotated[Optional[float], typer.Option('--safety-max-insulin-per-hour', help='Max insulin per 60 min (U)')] = None, safety_max_iob: Annotated[Optional[float], typer.Option('--safety-max-iob', help='Max insulin on board (U)')] = None, safety_trend_stop: Annotated[Optional[float], typer.Option('--safety-trend-stop', help='Negative trend cutoff (mg/dL/min)')] = None, safety_hypo_cutoff: Annotated[Optional[float], typer.Option('--safety-hypo-cutoff', help='Hard hypo cutoff (mg/dL)')] = None, safety_critical_glucose_threshold: Annotated[Optional[float], typer.Option('--safety-critical-glucose', help='Critical glucose threshold (mg/dL)')] = None, safety_critical_glucose_duration_minutes: Annotated[Optional[int], typer.Option('--safety-critical-duration', help='Critical glucose duration (minutes)')] = None, safety_predictor_uncertainty_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-uncertainty-gate', help='Enable predictor uncertainty gate')] = None, safety_predictor_uncertainty_max_std_mgdl: Annotated[Optional[float], typer.Option('--safety-predictor-max-std', help='Max allowed predictor std (mg/dL) before fallback')] = None, safety_predictor_ood_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-ood-gate', help='Enable predictor OOD gate')] = None, safety_predictor_ood_zscore_threshold: Annotated[Optional[float], typer.Option('--safety-predictor-ood-z', help='Predictor OOD z-score threshold')] = None, safety_predictor_ood_max_feature_fraction: Annotated[Optional[float], typer.Option('--safety-predictor-ood-feature-fraction', help='Max fraction of features allowed OOD')] = None)
presets_create(name: Annotated[str, typer.Option(help='Preset name (snake_case)')], output_dir: Annotated[Path, typer.Option(help='Output directory for preset files')] = Path('./presets'), initial_glucose: Annotated[float, typer.Option(help='Initial glucose (mg/dL)')] = 140.0, basal_insulin_rate: Annotated[float, typer.Option(help='Basal insulin rate (U/hr)')] = 0.5, insulin_sensitivity: Annotated[float, typer.Option(help='Insulin sensitivity (mg/dL per U)')] = 50.0, carb_factor: Annotated[float, typer.Option(help='Carb factor (g per U)')] = 10.0)
run_wizard()
profiles_presets()
profiles_create(name: Annotated[str, typer.Option(help='Profile name (file stem)')], output_dir: Annotated[Path, typer.Option(help='Output directory for the profile YAML')] = Path('./patient_profiles'), preset: Annotated[Optional[str], typer.Option(help='Optional starter preset: stable-demo, stress-test, or endurance.')] = None, isf: Annotated[float, typer.Option(help='Insulin Sensitivity Factor (mg/dL per unit)')] = 50.0, icr: Annotated[float, typer.Option(help='Insulin-to-carb ratio (grams per unit)')] = 10.0, basal_rate: Annotated[float, typer.Option(help='Basal insulin rate (U/hr)')] = 0.8, initial_glucose: Annotated[float, typer.Option(help='Initial glucose (mg/dL)')] = 120.0, dawn_strength: Annotated[float, typer.Option(help='Dawn phenomenon strength (mg/dL per hour)')] = 0.0, dawn_resistance: Annotated[float, typer.Option(help='Dawn insulin resistance: peak fraction of insulin sensitivity lost, 0 to <1')] = 0.0, dawn_start: Annotated[float, typer.Option(help='Dawn phenomenon start hour (0-23)')] = 4.0, dawn_end: Annotated[float, typer.Option(help='Dawn phenomenon end hour (0-24)')] = 8.0)
scenarios_generate(name: Annotated[str, typer.Option(help='Scenario name')] = 'Generated Scenario', output_path: Annotated[Path, typer.Option(help='Output JSON path')] = Path('./scenarios/generated_scenario.json'), duration_minutes: Annotated[int, typer.Option(help='Scenario duration in minutes')] = 1440, seed: Annotated[Optional[int], typer.Option(help='Random seed')] = None, meal_count: Annotated[int, typer.Option(help='Number of meal events')] = 3, meal_min_grams: Annotated[float, typer.Option(help='Min meal size (g carbs)')] = 30.0, meal_max_grams: Annotated[float, typer.Option(help='Max meal size (g carbs)')] = 80.0, exercise_count: Annotated[int, typer.Option(help='Number of exercise events')] = 0, sensor_error_count: Annotated[int, typer.Option(help='Number of sensor error events')] = 0)
scenarios_wizard()
scenarios_migrate(input_path: Annotated[Path, typer.Argument(help='Scenario JSON to migrate')], output_path: Annotated[Optional[Path], typer.Option(help='Output path (default: overwrite input)')] = None)
scenarios_export_study_pack(output_dir: Annotated[Path, typer.Option(help='Directory to write the official study pack')] = Path('scenarios/study_pack'), seeds: Annotated[str, typer.Option(help='Comma-separated seed list to include in the pack manifest')] = '1,2,3,4,5,6,7,8,9,10', preset: Annotated[str, typer.Option(help='Study-pack preset: official or eucys')] = 'official')
run(algo: Annotated[Optional[Path], typer.Option(help='Path to the algorithm Python file. Leave blank to use the built-in Clinical Baseline.')] = None, preset: Annotated[Optional[str], typer.Option(help='Optional built-in preset such as baseline_t1d. This fills the patient profile and scenario unless you override them.')] = None, predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt) for dual-guard forecasting')] = None, patient_config_name: Annotated[str, typer.Option(help="Name of the patient configuration (for example 'default_patient' or 'clinic_safe_baseline')")] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Path to a patient config YAML (overrides --patient-config-name)')] = None, scenario_path: Annotated[Optional[Path], typer.Option('--scenario', '--scenario-path', help='Path to the scenario JSON file (for example scenarios/example_scenario.json)')] = None, duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 720, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, output_dir: Annotated[Optional[Path], typer.Option(help='Directory to save simulation results')] = None, compare_baselines: Annotated[bool, typer.Option(help='Run built-in baselines in the background for comparison')] = True, seed: Annotated[Optional[int], typer.Option(help='Random seed for deterministic runs')] = None, patient_model_type: Annotated[str, typer.Option('--patient-model', help='Patient model: auto, bergman, custom, simglucose')] = 'auto', sensor_profile: Annotated[Optional[str], typer.Option(help=f"Sensor artifact profile: {', '.join(sorted(SENSOR_PROFILES))}")] = None, sensor_noise_std: Annotated[Optional[float], typer.Option('--sensor-noise-std', help='CGM noise std (mg/dL)')] = None, sensor_lag_minutes: Annotated[Optional[int], typer.Option('--sensor-lag-minutes', help='CGM lag (minutes)')] = None, sensor_dropout_prob: Annotated[Optional[float], typer.Option('--sensor-dropout-prob', help='CGM dropout probability (0-1)')] = None, sensor_bias: Annotated[Optional[float], typer.Option('--sensor-bias', help='CGM bias (mg/dL)')] = None, safety_min_glucose: Annotated[Optional[float], typer.Option('--safety-min-glucose', help='Min plausible glucose (mg/dL)')] = None, safety_max_glucose: Annotated[Optional[float], typer.Option('--safety-max-glucose', help='Max plausible glucose (mg/dL)')] = None, safety_max_glucose_delta_per_5_min: Annotated[Optional[float], typer.Option('--safety-max-glucose-delta-per-5-min', help='Max glucose delta per 5 min (mg/dL)')] = None, safety_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hypo-threshold', help='Hypoglycemia threshold (mg/dL)')] = None, safety_severe_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-severe-hypo-threshold', help='Severe hypoglycemia threshold (mg/dL)')] = None, safety_hyperglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hyper-threshold', help='Hyperglycemia threshold (mg/dL)')] = None, safety_max_insulin_per_bolus: Annotated[Optional[float], typer.Option('--safety-max-bolus', help='Max insulin per bolus (U)')] = None, safety_glucose_rate_alarm: Annotated[Optional[float], typer.Option('--safety-glucose-rate-alarm', help='Glucose rate alarm (mg/dL/min)')] = None, safety_max_insulin_per_hour: Annotated[Optional[float], typer.Option('--safety-max-insulin-per-hour', help='Max insulin per 60 min (U)')] = None, safety_max_iob: Annotated[Optional[float], typer.Option('--safety-max-iob', help='Max insulin on board (U)')] = None, safety_trend_stop: Annotated[Optional[float], typer.Option('--safety-trend-stop', help='Negative trend cutoff (mg/dL/min)')] = None, safety_hypo_cutoff: Annotated[Optional[float], typer.Option('--safety-hypo-cutoff', help='Hard hypo cutoff (mg/dL)')] = None, safety_critical_glucose_threshold: Annotated[Optional[float], typer.Option('--safety-critical-glucose', help='Critical glucose threshold (mg/dL)')] = None, safety_critical_glucose_duration_minutes: Annotated[Optional[int], typer.Option('--safety-critical-duration', help='Critical glucose duration (minutes)')] = None, safety_predictor_uncertainty_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-uncertainty-gate', help='Enable predictor uncertainty gate')] = None, safety_predictor_uncertainty_max_std_mgdl: Annotated[Optional[float], typer.Option('--safety-predictor-max-std', help='Max allowed predictor std (mg/dL) before fallback')] = None, safety_predictor_ood_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-ood-gate', help='Enable predictor OOD gate')] = None, safety_predictor_ood_zscore_threshold: Annotated[Optional[float], typer.Option('--safety-predictor-ood-z', help='Predictor OOD z-score threshold')] = None, safety_predictor_ood_max_feature_fraction: Annotated[Optional[float], typer.Option('--safety-predictor-ood-feature-fraction', help='Max fraction of features allowed OOD')] = None, wizard: Annotated[bool, typer.Option('--wizard', help='Ask a few questions and build the run interactively')] = False, dry_run: Annotated[bool, typer.Option('--dry-run', help='Validate the setup and print the run plan without executing the simulation')] = False)
run_full(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt) for dual-guard forecasting')] = None, patient_config_name: Annotated[str, typer.Option(help="Name of the patient configuration (e.g., 'default_patient')")] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Path to a patient config YAML (overrides --patient-config-name)')] = None, scenario_path: Annotated[Optional[Path], typer.Option(help='Path to the scenario JSON file')] = None, duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 720, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, output_dir: Annotated[Optional[Path], typer.Option(help='Directory to save results + audit + report')] = None, seed: Annotated[Optional[int], typer.Option(help='Random seed for deterministic runs')] = None, safety_min_glucose: Annotated[Optional[float], typer.Option('--safety-min-glucose', help='Min plausible glucose (mg/dL)')] = None, safety_max_glucose: Annotated[Optional[float], typer.Option('--safety-max-glucose', help='Max plausible glucose (mg/dL)')] = None, safety_max_glucose_delta_per_5_min: Annotated[Optional[float], typer.Option('--safety-max-glucose-delta-per-5-min', help='Max glucose delta per 5 min (mg/dL)')] = None, safety_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hypo-threshold', help='Hypoglycemia threshold (mg/dL)')] = None, safety_severe_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-severe-hypo-threshold', help='Severe hypoglycemia threshold (mg/dL)')] = None, safety_hyperglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hyper-threshold', help='Hyperglycemia threshold (mg/dL)')] = None, safety_max_insulin_per_bolus: Annotated[Optional[float], typer.Option('--safety-max-bolus', help='Max insulin per bolus (U)')] = None, safety_glucose_rate_alarm: Annotated[Optional[float], typer.Option('--safety-glucose-rate-alarm', help='Glucose rate alarm (mg/dL/min)')] = None, safety_max_insulin_per_hour: Annotated[Optional[float], typer.Option('--safety-max-insulin-per-hour', help='Max insulin per 60 min (U)')] = None, safety_max_iob: Annotated[Optional[float], typer.Option('--safety-max-iob', help='Max insulin on board (U)')] = None, safety_trend_stop: Annotated[Optional[float], typer.Option('--safety-trend-stop', help='Negative trend cutoff (mg/dL/min)')] = None, safety_hypo_cutoff: Annotated[Optional[float], typer.Option('--safety-hypo-cutoff', help='Hard hypo cutoff (mg/dL)')] = None, safety_critical_glucose_threshold: Annotated[Optional[float], typer.Option('--safety-critical-glucose', help='Critical glucose threshold (mg/dL)')] = None, safety_critical_glucose_duration_minutes: Annotated[Optional[int], typer.Option('--safety-critical-duration', help='Critical glucose duration (minutes)')] = None, safety_predictor_uncertainty_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-uncertainty-gate', help='Enable predictor uncertainty gate')] = None, safety_predictor_uncertainty_max_std_mgdl: Annotated[Optional[float], typer.Option('--safety-predictor-max-std', help='Max allowed predictor std (mg/dL) before fallback')] = None, safety_predictor_ood_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-ood-gate', help='Enable predictor OOD gate')] = None, safety_predictor_ood_zscore_threshold: Annotated[Optional[float], typer.Option('--safety-predictor-ood-z', help='Predictor OOD z-score threshold')] = None, safety_predictor_ood_max_feature_fraction: Annotated[Optional[float], typer.Option('--safety-predictor-ood-feature-fraction', help='Max fraction of features allowed OOD')] = None)
run_parallel(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt) for dual-guard forecasting')] = None, scenarios_dir: Annotated[Optional[Path], typer.Option(help='Directory with scenario JSON files')] = None, scenario_paths: Annotated[List[Path], typer.Option('--scenario-path', help='Scenario JSON path (repeatable)')] = [], patient_config_name: Annotated[str, typer.Option(help='Patient config name')] = 'default_patient', patient_config_path: Annotated[Optional[Path], typer.Option(help='Patient config YAML path')] = None, patient_configs_dir: Annotated[Optional[Path], typer.Option(help='Directory of patient YAML configs')] = None, duration: Annotated[int, typer.Option(help='Simulation duration in minutes')] = 720, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, output_dir: Annotated[Path, typer.Option(help='Root directory for batch outputs')] = Path('./results/batch'), max_workers: Annotated[Optional[int], typer.Option(help='Max parallel workers')] = None, seed: Annotated[Optional[int], typer.Option(help='Base seed for deterministic runs')] = None, compare_baselines: Annotated[bool, typer.Option(help='Run PID + standard pump baselines')] = False, export_audit: Annotated[bool, typer.Option(help='Export audit trails')] = False, generate_report: Annotated[bool, typer.Option(help='Generate PDF reports')] = False, safety_min_glucose: Annotated[Optional[float], typer.Option('--safety-min-glucose')] = None, safety_max_glucose: Annotated[Optional[float], typer.Option('--safety-max-glucose')] = None, safety_max_glucose_delta_per_5_min: Annotated[Optional[float], typer.Option('--safety-max-glucose-delta-per-5-min')] = None, safety_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hypo-threshold')] = None, safety_severe_hypoglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-severe-hypo-threshold')] = None, safety_hyperglycemia_threshold: Annotated[Optional[float], typer.Option('--safety-hyper-threshold')] = None, safety_max_insulin_per_bolus: Annotated[Optional[float], typer.Option('--safety-max-bolus')] = None, safety_glucose_rate_alarm: Annotated[Optional[float], typer.Option('--safety-glucose-rate-alarm')] = None, safety_max_insulin_per_hour: Annotated[Optional[float], typer.Option('--safety-max-insulin-per-hour')] = None, safety_max_iob: Annotated[Optional[float], typer.Option('--safety-max-iob')] = None, safety_trend_stop: Annotated[Optional[float], typer.Option('--safety-trend-stop')] = None, safety_hypo_cutoff: Annotated[Optional[float], typer.Option('--safety-hypo-cutoff')] = None, safety_critical_glucose_threshold: Annotated[Optional[float], typer.Option('--safety-critical-glucose')] = None, safety_critical_glucose_duration_minutes: Annotated[Optional[int], typer.Option('--safety-critical-duration')] = None, safety_predictor_uncertainty_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-uncertainty-gate')] = None, safety_predictor_uncertainty_max_std_mgdl: Annotated[Optional[float], typer.Option('--safety-predictor-max-std')] = None, safety_predictor_ood_gate_enabled: Annotated[Optional[bool], typer.Option('--safety-predictor-ood-gate')] = None, safety_predictor_ood_zscore_threshold: Annotated[Optional[float], typer.Option('--safety-predictor-ood-z')] = None, safety_predictor_ood_max_feature_fraction: Annotated[Optional[float], typer.Option('--safety-predictor-ood-feature-fraction')] = None)
scorecard(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file')], profile: Annotated[str, typer.Option(help='Validation profile id')] = 'research_default', predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional predictor checkpoint (.pt)')] = None, presets_csv: Annotated[Optional[str], typer.Option(help='Comma-separated preset names (default: all bundled presets)')] = None, output_dir: Annotated[Path, typer.Option(help='Output directory for scorecard artifacts')] = Path('results/scorecard'), seed: Annotated[Optional[int], typer.Option(help='Base random seed')] = 42)
poster(run_dir: Annotated[List[Path], typer.Option('--run-dir', help='Run bundle directory containing results.csv. Repeat up to three times.')] = [], label: Annotated[List[str], typer.Option('--label', help='Optional poster label aligned to each --run-dir (for example: Normal Run, Meal Stress Test, Supervisor Override).')] = [], output_path: Annotated[Path, typer.Option(help='PNG output path for the poster graphic.')] = Path('./results/posters/iints_results_poster.png'), summary_output_path: Annotated[Optional[Path], typer.Option(help='Optional JSON sidecar summary path.')] = None, title: Annotated[str, typer.Option(help='Main poster headline.')] = '288 Decisions. Every Day. We Test Them All.', subtitle: Annotated[str, typer.Option(help='Supporting poster subtitle.')] = 'Three IINTS-AF scenarios showing control, stress handling, and supervisor protection.', results_root: Annotated[Path, typer.Option(help='Root folder used when no --run-dir values are supplied.')] = Path('./results'))
demo_booth(output_dir: Annotated[Path, typer.Option(help='Directory where the fair-ready demo bundle should be written.')] = Path('./results/booth_demo'), duration: Annotated[int, typer.Option(help='Simulation duration in minutes for each booth scenario.')] = 360, time_step: Annotated[int, typer.Option(help='Simulation step size in minutes.')] = 5, seed: Annotated[int, typer.Option(help='Deterministic random seed.')] = 42, prepare_ai: Annotated[bool, typer.Option('--prepare-ai/--no-prepare-ai', help='Prepare AI-ready artifacts for the Supervisor Override run.')] = True) -> None
demo_export(output_dir: Annotated[Path, typer.Option(help='Directory where the bundled live stage demo files should be written.')] = Path('./iints_demo'), overwrite: Annotated[bool, typer.Option('--overwrite/--no-overwrite', help='Allow overwriting exported demo files.')] = False) -> None
demo_live(output_dir: Annotated[Path, typer.Option(help='Root directory for the exported code and generated live-demo results.')] = Path('./results/live_demo'), run_demo: Annotated[bool, typer.Option('--run/--no-run', help='Run the exported demo after showing the code preview.')] = True, prepare_ai: Annotated[bool, typer.Option('--prepare-ai/--skip-ai', help='Prepare optional local-AI artifacts during the demo run.')] = False, full_code: Annotated[bool, typer.Option('--full-code/--preview-code', help='Print the whole exported script instead of the curated preview.')] = False, overwrite: Annotated[bool, typer.Option('--overwrite/--no-overwrite', help='Allow replacing previously exported demo code files.')] = True, audience: Annotated[str, typer.Option('--audience', help='Presenter framing: mixed, clinical, engineering, or jury. Aliases like doctor and engineer also work.')] = 'mixed', stage_mode: Annotated[bool, typer.Option('--stage/--technical', help='Stage mode hides noisy subprocess logs and prints a clean audience-facing flow.')] = True, build_evidence: Annotated[bool, typer.Option('--evidence/--no-evidence', help='Build a public research evidence bundle after the live run.')] = True, story_mode: Annotated[str, typer.Option('--story', help='Demo story layer: sdk, doctor, eucys, or booth. Positional shortcuts also work viaiints demo doctor.')] = 'sdk') -> None
report(results_csv: Annotated[Path, typer.Option(help='Path to a simulation results CSV')], output_path: Annotated[Path, typer.Option(help='Output PDF path')] = Path('./results/clinical_report.pdf'), safety_report_path: Annotated[Optional[Path], typer.Option(help='Optional safety report JSON path')] = None, audit_output_dir: Annotated[Optional[Path], typer.Option(help='Optional audit output directory')] = None, bundle_dir: Annotated[Optional[Path], typer.Option(help='If set, write PDF + plots + audit into this folder')] = None, style: Annotated[str, typer.Option(help='Report style: standard or agp')] = 'standard', subject_name: Annotated[str, typer.Option(help='Subject/run label shown on AGP-style reports')] = 'Research simulation', summary_json_path: Annotated[Optional[Path], typer.Option(help='Optional AGP summary JSON output path')] = None, agp_png: Annotated[bool, typer.Option('--png/--no-png', help='For AGP reports, export agp_profile.png and daily_profiles.png.')] = False, agp_svg: Annotated[bool, typer.Option('--svg/--no-svg', help='For AGP reports, export vector SVG assets alongside PNG assets.')] = True)
safety_visualize(results_csv: Annotated[Path, typer.Option(help='Path to a simulation results CSV')], output_html: Annotated[Path, typer.Option(help='Output standalone HTML visualizer path')] = Path('./results/safety_visualizer.html'), output_json: Annotated[Optional[Path], typer.Option(help='Optional machine-readable JSON summary path')] = None, safety_report_path: Annotated[Optional[Path], typer.Option(help='Optional safety report JSON path')] = None, title: Annotated[str, typer.Option(help='HTML page title')] = 'IINTS Safety Contract Visualizer') -> None
validate(scenario_path: Annotated[Path, typer.Option(help='Path to a scenario JSON file')], patient_config_path: Annotated[Optional[Path], typer.Option(help='Optional patient config YAML to validate')] = None)
data_list()
data_info(dataset_id: Annotated[str, typer.Argument(help='Dataset id (seeiints data list)')])
data_cite(dataset_id: Annotated[str, typer.Argument(help='Dataset id (seeiints data list)')])
data_fetch(dataset_id: Annotated[str, typer.Argument(help='Dataset id (seeiints data list)')], output_dir: Annotated[Optional[Path], typer.Option(help='Output directory (default: data_packs/official/<id>)')] = None, extract: Annotated[bool, typer.Option(help='Extract zip files if present')] = True, verify: Annotated[bool, typer.Option(help='Verify pinned SHA-256 hashes and emit SHA256SUMS.txt. Public sources without published hashes now require --no-verify.')] = True)
data_research_plan(output_dir: Annotated[Path, typer.Option(help='Output folder for the dataset acquisition plan and source matrix.')] = Path('data_packs/research_dataset_plan'), dataset: Annotated[List[str], typer.Option('--dataset', help='Optional dataset id to include. Repeat for a custom subset; default includes the full curated IINTS research list.')] = []) -> None
data_contract_template(output_path: Annotated[Path, typer.Option(help='Where to write the starter contract YAML')] = Path('data_contract.yaml'))
data_certify_template(output_path: Annotated[Path, typer.Option(help='Where to write the starter certification contract YAML')] = Path('data_contract.yaml'), profile: Annotated[str, typer.Option(help='Template profile: diabetes (default) or basic')] = 'diabetes')
data_contract_run(contract_path: Annotated[Path, typer.Argument(help='Path to contract YAML')], input_csv: Annotated[Path, typer.Argument(help='Path to input CSV')], output_json: Annotated[Optional[Path], typer.Option(help='Optional output report JSON path')] = None, apply_builtin_transforms: Annotated[bool, typer.Option(help='Apply built-in unit conversion transforms from the contract')] = True, fail_on_noncompliant: Annotated[bool, typer.Option(help='Exit code 1 when compliance checks fail')] = False, quick: Annotated[bool, typer.Option('--quick', help='Quick scan: only load the first --quick-rows rows for large datasets')] = False, quick_rows: Annotated[int, typer.Option(help='Rows loaded when --quick is enabled')] = 5000, certificate_output: Annotated[Optional[Path], typer.Option(help='Optional MDMP certificate JSON output path')] = None, signing_key: Annotated[Optional[Path], typer.Option(help='Optional Ed25519 private key PEM for externally verifiable certificates')] = None, signing_key_id: Annotated[str, typer.Option(help='Key id written into a signed certificate')] = 'iints_local_mdmp_v1', signed_by: Annotated[str, typer.Option(help='Signer label for generated MDMP certificates')] = 'IINTS-AF Local MDMP', signing_key_passphrase_env: Annotated[Optional[str], typer.Option(help='Environment variable containing the private-key passphrase, if encrypted')] = None, min_mdmp_grade: Annotated[Optional[str], typer.Option(help='Optional MDMP grade gate (draft, research_grade, clinical_grade)')] = None)
data_certify(contract_path: Annotated[Path, typer.Argument(help='Path to certification contract YAML')], input_csv: Annotated[Path, typer.Argument(help='Path to input CSV')], output_json: Annotated[Optional[Path], typer.Option(help='Optional output report JSON path')] = None, apply_builtin_transforms: Annotated[bool, typer.Option(help='Apply built-in unit conversion transforms from the contract')] = True, fail_on_noncompliant: Annotated[bool, typer.Option(help='Exit code 1 when compliance checks fail')] = False, quick: Annotated[bool, typer.Option('--quick', help='Quick scan: only load the first --quick-rows rows for large datasets')] = False, quick_rows: Annotated[int, typer.Option(help='Rows loaded when --quick is enabled')] = 5000, certificate_output: Annotated[Optional[Path], typer.Option(help='Optional MDMP certificate JSON output path')] = None, signing_key: Annotated[Optional[Path], typer.Option(help='Optional Ed25519 private key PEM for externally verifiable certificates')] = None, signing_key_id: Annotated[str, typer.Option(help='Key id written into a signed certificate')] = 'iints_local_mdmp_v1', signed_by: Annotated[str, typer.Option(help='Signer label for generated MDMP certificates')] = 'IINTS-AF Local MDMP', signing_key_passphrase_env: Annotated[Optional[str], typer.Option(help='Environment variable containing the private-key passphrase, if encrypted')] = None, min_mdmp_grade: Annotated[Optional[str], typer.Option(help='Optional certification grade gate (draft, research_grade, clinical_grade, ai_ready)')] = None)
data_mdmp_keygen(output_dir: Annotated[Path, typer.Option(help='Directory for the MDMP Ed25519 keypair')] = Path('certs/mdmp'), private_name: Annotated[str, typer.Option(help='Private key filename')] = 'iints_mdmp_private.pem', public_name: Annotated[str, typer.Option(help='Public key filename')] = 'iints_mdmp_public.pem', passphrase: Annotated[Optional[str], typer.Option(help='Optional private-key passphrase (prefer env/file)')] = None, passphrase_env: Annotated[Optional[str], typer.Option(help='Environment variable containing private-key passphrase')] = None, passphrase_file: Annotated[Optional[Path], typer.Option(help='File containing private-key passphrase')] = None) -> None
data_eu_ai_pact_review(report_json: Annotated[Path, typer.Argument(help='Path to an MDMP/data certification JSON report')], output_json: Annotated[Optional[Path], typer.Option(help='Optional output governance review JSON path')] = None, strict: Annotated[bool, typer.Option('--strict/--core-only', help='Strict checks include high-risk readiness controls; core-only checks the three AI Pact core themes.')] = True, fail_on_blocked: Annotated[bool, typer.Option(help='Exit code 1 when the governance review is blocked')] = False)
data_realism_check(input_csv: Annotated[Path, typer.Argument(help='Path to CSV in generic/dexcom/libre/carelink format')], output_json: Annotated[Optional[Path], typer.Option(help='Optional output report JSON path')] = None, output_html: Annotated[Optional[Path], typer.Option(help='Optional output dashboard HTML path')] = None, data_format: Annotated[str, typer.Option(help='Data format preset: generic, dexcom, libre, carelink')] = 'generic', time_unit: Annotated[str, typer.Option(help='Timestamp unit for numeric timestamps: minutes or seconds')] = 'minutes', expected_interval_minutes: Annotated[int, typer.Option(help='Expected reading interval in minutes')] = 5, min_meal_grams: Annotated[float, typer.Option(help='Minimum carbs (g) that count as a meal event')] = 10.0, reference: Annotated[Optional[str], typer.Option(help='Optional realism reference profile or dataset id (for example free_living_t1d, azt1d, hupa_ucm).')] = None, min_realism_verdict: Annotated[Optional[str], typer.Option(help='Optional gate: likely_realistic or needs_review. Exit code 1 if the report is worse.')] = None, strict_real_data_gate: Annotated[bool, typer.Option('--strict-real-data-gate/--no-strict-real-data-gate', help='Apply the stricter evidence-readiness gate for real-data/local-AI use.')] = False, mapping: Annotated[List[str], typer.Option('--map', help='Column mapping key=value (e.g., timestamp=Time, glucose=SGV)')] = [])
data_mdmp_visualizer(report_json: Annotated[Path, typer.Argument(help='Path to contract-run JSON report')], output_html: Annotated[Path, typer.Option(help='Output HTML path')] = Path('results/mdmp_dashboard.html'), title: Annotated[str, typer.Option(help='Dashboard title')] = 'IINTS MDMP Certification Dashboard')
data_certify_visualizer(report_json: Annotated[Path, typer.Argument(help='Path to certification report JSON')], output_html: Annotated[Path, typer.Option(help='Output HTML path')] = Path('results/mdmp_dashboard.html'), title: Annotated[str, typer.Option(help='Dashboard title')] = 'IINTS Data Certification Dashboard')
data_corrupt_for_study(input_csv: Annotated[Path, typer.Argument(help='Source CSV that will be deliberately corrupted for ablation studies')], output_csv: Annotated[Path, typer.Option(help='Output CSV path for the corrupted dataset')] = Path('results/corrupted_study.csv'), mode: Annotated[List[str], typer.Option('--mode', help='Corruption mode to apply. Repeat --mode for multiple operators.')] = ['timestamp_shift'], manifest_output: Annotated[Optional[Path], typer.Option(help='Optional corruption manifest JSON path')] = None, seed: Annotated[int, typer.Option(help='Random seed for deterministic corruption')] = 42, timestamp_shift_minutes: Annotated[int, typer.Option(help='Minutes to shift timestamps for the timestamp_shift mode')] = 60, missing_fraction: Annotated[float, typer.Option(help='Fraction of rows to remove for missing_block')] = 0.1, duplicate_fraction: Annotated[float, typer.Option(help='Fraction of rows to duplicate for duplicate_rows')] = 0.05, spike_fraction: Annotated[float, typer.Option(help='Fraction of glucose rows to spike for glucose_spikes')] = 0.03, spike_magnitude_mgdl: Annotated[float, typer.Option(help='Spike magnitude in mg/dL for glucose_spikes')] = 60.0) -> None
data_synthetic_mirror(input_csv: Annotated[Path, typer.Argument(help='Source CSV (validated real dataset)')], contract_path: Annotated[Path, typer.Argument(help='Contract YAML path used as schema/range guard')], output_csv: Annotated[Path, typer.Option(help='Output synthetic CSV path')] = Path('data/synthetic_mirror.csv'), output_json: Annotated[Optional[Path], typer.Option(help='Optional synthetic mirror report JSON')] = Path('results/synthetic_mirror_report.json'), rows: Annotated[Optional[int], typer.Option(help='Optional number of rows to generate')] = None, seed: Annotated[int, typer.Option(help='Random seed for deterministic synthesis')] = 42, noise_scale: Annotated[float, typer.Option(help='Numeric perturbation scale as fraction of source std-dev')] = 0.05, min_mdmp_grade: Annotated[Optional[str], typer.Option(help='Optional MDMP grade gate for generated synthetic dataset')] = 'research_grade', fail_on_noncompliant: Annotated[bool, typer.Option(help='Exit code 1 when generated dataset fails compliance')] = True)
data_pull_hf(repo: Annotated[str, typer.Option('--repo', help='Hugging Face dataset repository (e.g. MaxPrestige/Synthetic-Diabetes-Dataset)')], output: Annotated[Path, typer.Option('--output', help='Output directory for the pulled dataset')] = Path('data/raw/'), split: Annotated[str, typer.Option('--split', help='Dataset split to download (default: train)')] = 'train')
data_import_cgmacros(input_dir: Annotated[Path, typer.Option('--input-dir', help='Directory containing CGMacros-#.csv files and bio.csv')], output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for standardized tables')] = Path('data/standardized/cgmacros'), bio_filename: Annotated[str, typer.Option('--bio-filename', help='Filename of subject bio screening CSV')] = 'bio.csv')
data_download_cgmacros(output_dir: Annotated[Path, typer.Option('--output-dir', help='Directory to save downloaded / standardized CGMacros files')] = Path('data/cgmacros_cohort'), participants: Annotated[int, typer.Option('--participants', help='Number of cohort participants to fetch/generate (up to 45)')] = 45, force_download: Annotated[bool, typer.Option('--force-download', help='Attempt live network download from GitHub / Figshare')] = False)
mdmp_template(output_path: Annotated[Path, typer.Option(help='Where to write the MDMP contract YAML')] = Path('mdmp_contract.yaml'))
mdmp_validate(contract_path: Annotated[Path, typer.Argument(help='Path to MDMP contract YAML')], input_csv: Annotated[Path, typer.Argument(help='Path to input CSV')], output_json: Annotated[Optional[Path], typer.Option(help='Optional output report JSON path')] = None, apply_builtin_transforms: Annotated[bool, typer.Option(help='Apply built-in unit conversion transforms (default: off for explicit MDMP operation)')] = False, fail_on_noncompliant: Annotated[bool, typer.Option(help='Exit code 1 when compliance checks fail')] = False, min_mdmp_grade: Annotated[Optional[str], typer.Option(help='Optional MDMP grade gate (draft, research_grade, clinical_grade)')] = None)
mdmp_visualizer(report_json: Annotated[Path, typer.Argument(help='Path to MDMP validation report JSON')], output_html: Annotated[Path, typer.Option(help='Output HTML path')] = Path('results/mdmp_dashboard.html'), title: Annotated[str, typer.Option(help='Dashboard title')] = 'IINTS MDMP Certification Dashboard')
mdmp_synthetic_mirror(input_csv: Annotated[Path, typer.Argument(help='Source CSV')], contract_path: Annotated[Path, typer.Argument(help='MDMP contract YAML')], output_csv: Annotated[Path, typer.Option(help='Output synthetic CSV path')] = Path('data/synthetic_mirror.csv'), output_json: Annotated[Optional[Path], typer.Option(help='Optional synthetic mirror report JSON')] = Path('results/synthetic_mirror_report.json'), rows: Annotated[Optional[int], typer.Option(help='Optional number of rows to generate')] = None, seed: Annotated[int, typer.Option(help='Random seed')] = 42, noise_scale: Annotated[float, typer.Option(help='Numeric perturbation scale')] = 0.05, min_mdmp_grade: Annotated[Optional[str], typer.Option(help='Optional MDMP grade gate')] = 'research_grade', fail_on_noncompliant: Annotated[bool, typer.Option(help='Exit code 1 when generated dataset fails compliance')] = True)
mdmp_encrypt_data(input_file: Annotated[Path, typer.Option('--input', '-i', help='Path to input dataset file (CSV/JSON/Parquet)')], output_file: Annotated[Optional[Path], typer.Option('--output', '-o', help='Path to encrypted output file (.enc)')] = None, key: Annotated[Optional[str], typer.Option('--key', '-k', help='Passphrase value (discouraged: visible in shell history; prompt or --key-file is safer)')] = None, key_file: Annotated[Optional[Path], typer.Option('--key-file', help='File containing a passphrase or exactly 32 raw key bytes')] = None, aad: Annotated[Optional[str], typer.Option('--aad', help='Optional Associated Authenticated Data (e.g. study-ID)')] = None, force: Annotated[bool, typer.Option('--force', help='Allow replacing an existing encrypted output file')] = False)
mdmp_decrypt_data(input_file: Annotated[Path, typer.Option('--input', '-i', help='Path to encrypted .enc file')], output_file: Annotated[Path, typer.Option('--output', '-o', help='Path to restored output file')], key: Annotated[Optional[str], typer.Option('--key', '-k', help='Passphrase value (discouraged: visible in shell history; prompt or --key-file is safer)')] = None, key_file: Annotated[Optional[Path], typer.Option('--key-file', help='File containing a passphrase or exactly 32 raw key bytes')] = None, aad: Annotated[Optional[str], typer.Option('--aad', help='Associated Authenticated Data used during encryption')] = None, force: Annotated[bool, typer.Option('--force', help='Allow replacing an existing decrypted output file')] = False)
mdmp_sign_card(card_file: Annotated[Path, typer.Option('--card', '-c', help='Path to JSON data card / passport')], private_key: Annotated[Path, typer.Option('--key', '-k', help='Path to Ed25519 private key PEM')], output_file: Annotated[Optional[Path], typer.Option('--output', '-o', help='Path to signed output JSON')] = None, signer_name: Annotated[str, typer.Option('--signer', help='Authority name / signer identity')] = 'MDMP-Authority-v1', key_id: Annotated[str, typer.Option('--key-id', help='Key identifier')] = 'mdmp_pub_v1', post_quantum: Annotated[bool, typer.Option('--pqc', '--hybrid', help='Reserved compatibility flag; real ML-DSA signing is not implemented')] = False)
mdmp_verify_card(card_file: Annotated[Path, typer.Argument(help='Path to signed JSON data card / passport')], public_key: Annotated[Optional[Path], typer.Option('--key', '-k', help='Optional explicit public key PEM')] = None, dataset_path: Annotated[Optional[Path], typer.Option('--dataset', '-d', help='Optional dataset file to verify fingerprint match')] = None)
sources(category: Annotated[Optional[str], typer.Option(help='Filter by source category (guideline, trial, model, dataset, ...).')] = None, output_json: Annotated[Optional[Path], typer.Option(help='Optional JSON output path.')] = None)
research_prepare_azt1d(input_dir: Annotated[Path, typer.Option(help='Root directory containing AZT1D Subject folders')] = Path('data_packs/public/azt1d/AZT1D 2025/CGM Records'), output: Annotated[Path, typer.Option(help='Output dataset path (CSV or Parquet)')] = Path('data_packs/public/azt1d/processed/azt1d_merged.csv'), report: Annotated[Path, typer.Option(help='Quality report output path')] = Path('data_packs/public/azt1d/quality_report.json'), time_step: Annotated[int, typer.Option(help='Expected CGM sample interval (minutes)')] = 5, max_gap_multiplier: Annotated[float, typer.Option(help='Segment-break gap multiplier')] = 2.5, dia_minutes: Annotated[float, typer.Option(help='Insulin action duration (minutes)')] = 240.0, peak_minutes: Annotated[float, typer.Option(help='IOB peak time (minutes, OpenAPS bilinear)')] = 75.0, carb_absorb_minutes: Annotated[float, typer.Option(help='Carb absorption duration (minutes)')] = 120.0, max_basal: Annotated[float, typer.Option(help='Clip basal values above this (U/hr)')] = 20.0, max_bolus: Annotated[float, typer.Option(help='Clip bolus values above this (U)')] = 30.0, max_carbs: Annotated[float, typer.Option(help='Clip carb grams above this')] = 200.0, basal_is_rate: Annotated[bool, typer.Option(help='Treat Basal column as U/hr (convert to U/step)')] = True)
research_prepare_ohio(input_dir: Annotated[Path, typer.Option(help='Local OhioT1DM root containing 2018/2020 train/test XML folders. Do not commit this folder.')] = Path('OhioT1DM-volledig'), output: Annotated[Path, typer.Option(help='Output dataset path (CSV or Parquet)')] = Path('data_packs/public/ohio_t1dm_full/processed/ohio_train.csv'), report: Annotated[Path, typer.Option(help='Quality report output path')] = Path('data_packs/public/ohio_t1dm_full/processed/ohio_train_quality_report.json'), years: Annotated[str, typer.Option(help='Comma-separated years to include, e.g. 2018,2020')] = '2018,2020', splits: Annotated[str, typer.Option(help='Comma-separated Ohio splits to include: train,test')] = 'train', time_step: Annotated[int, typer.Option(help='Expected CGM sample interval (minutes)')] = 5, max_gap_multiplier: Annotated[float, typer.Option(help='Segment-break gap multiplier')] = 2.5, dia_minutes: Annotated[float, typer.Option(help='Insulin action duration (minutes)')] = 240.0, peak_minutes: Annotated[float, typer.Option(help='IOB peak time (minutes, OpenAPS bilinear)')] = 75.0, carb_absorb_minutes: Annotated[float, typer.Option(help='Carb absorption duration (minutes)')] = 120.0, max_basal: Annotated[float, typer.Option(help='Clip basal values above this (U/hr)')] = 20.0, max_bolus: Annotated[float, typer.Option(help='Clip bolus insulin units above this')] = 30.0, max_carbs: Annotated[float, typer.Option(help='Clip carb grams above this')] = 200.0, icr_default: Annotated[float, typer.Option(help='Fallback ICR (g/U)')] = 10.0, isf_default: Annotated[float, typer.Option(help='Fallback ISF (mg/dL per U)')] = 50.0, filter_meals_without_rise: Annotated[bool, typer.Option('--filter-meals-without-rise/--keep-all-meals', help='Filter meal events that do not show a post-meal glucose rise.')] = True, meal_rise_threshold: Annotated[float, typer.Option(help='Minimum post-meal glucose rise to keep a meal event.')] = 10.0, meal_pre_window: Annotated[float, typer.Option(help='Minutes before meal used for baseline glucose.')] = 10.0, meal_post_window: Annotated[float, typer.Option(help='Minutes after meal used for rise detection.')] = 90.0)
research_physiology_calibrate(real_data: Annotated[Path, typer.Option(help='Real/prepared CGM dataset CSV or Parquet, e.g. processed OhioT1DM.')], output_json: Annotated[Path, typer.Option(help='Calibration audit JSON output path')] = Path('results/physiology_calibration/physiology_calibration_report.json'), output_profile: Annotated[Optional[Path], typer.Option(help='Optional YAML file containing conservative patient profile parameter hints.')] = None, simulation_data: Annotated[Optional[Path], typer.Option(help='Optional simulator result CSV/Parquet to compare against the real dataset.')] = None, time_column: Annotated[Optional[str], typer.Option(help='Override time column name.')] = None, glucose_column: Annotated[Optional[str], typer.Option(help='Override glucose column name.')] = None, carb_column: Annotated[Optional[str], typer.Option(help='Override carb column name.')] = None, insulin_column: Annotated[Optional[str], typer.Option(help='Override insulin column name.')] = None, exercise_column: Annotated[Optional[str], typer.Option(help='Override exercise/activity column name.')] = None, subject_column: Annotated[Optional[str], typer.Option(help='Override subject id column name.')] = None) -> None
research_prepare_hupa(input_dir: Annotated[Path, typer.Option(help='Root directory containing HUPA-UCM CSV files')] = Path('data_packs/public/hupa_ucm'), output: Annotated[Path, typer.Option(help='Output dataset path (CSV or Parquet)')] = Path('data_packs/public/hupa_ucm/processed/hupa_ucm_merged.csv'), report: Annotated[Path, typer.Option(help='Quality report output path')] = Path('data_packs/public/hupa_ucm/quality_report.json'), time_step: Annotated[int, typer.Option(help='Expected CGM sample interval (minutes)')] = 5, max_gap_multiplier: Annotated[float, typer.Option(help='Segment-break gap multiplier')] = 2.5, dia_minutes: Annotated[float, typer.Option(help='Insulin action duration (minutes)')] = 240.0, peak_minutes: Annotated[float, typer.Option(help='IOB peak time (minutes, OpenAPS bilinear)')] = 75.0, carb_absorb_minutes: Annotated[float, typer.Option(help='Carb absorption duration (minutes)')] = 120.0, max_insulin: Annotated[float, typer.Option(help='Clip insulin units above this')] = 30.0, max_carbs: Annotated[float, typer.Option(help='Clip carb grams above this')] = 200.0, carb_serving_grams: Annotated[float, typer.Option(help='Carb serving size (g) for carb_input')] = 10.0, basal_is_rate: Annotated[bool, typer.Option(help='Treat basal_rate as U/hr (convert to U/step)')] = False, icr_default: Annotated[float, typer.Option(help='Fallback ICR (g/U)')] = 10.0, isf_default: Annotated[float, typer.Option(help='Fallback ISF (mg/dL per U)')] = 50.0, basal_default: Annotated[float, typer.Option(help='Fallback basal rate (U/hr)')] = 0.0, meal_window_min: Annotated[float, typer.Option(help='Meal→insulin matching window (minutes)')] = 30.0, isf_window_min: Annotated[float, typer.Option(help='ISF estimation window (minutes)')] = 60.0, min_meal_carbs: Annotated[float, typer.Option(help='Minimum carbs to consider a meal (g)')] = 5.0, min_bolus: Annotated[float, typer.Option(help='Minimum insulin to consider a bolus (U)')] = 0.1)
research_quality(report: Annotated[Path, typer.Option(help='Path to quality_report.json produced by prepare-azt1d')] = Path('data_packs/public/azt1d/quality_report.json'))
research_blend_datasets(source: Annotated[List[str], typer.Option('--source', help='Repeatable dataset source in label=path form, for example azt1d=data/azt1d.csv.')], output: Annotated[Path, typer.Option(help='Output blended predictor dataset path')] = Path('data_packs/processed/predictor_blend.csv'), manifest: Annotated[Path, typer.Option(help='Output blend manifest JSON path')] = Path('data_packs/processed/predictor_blend_manifest.json')) -> None
research_build_control_dataset(run: Annotated[List[str], typer.Option('--run', help='Repeatable run input in label=path form; path may contain raw/steps.csv or results.csv.')], output: Annotated[Path, typer.Option(help='Output controller teacher dataset CSV')] = Path('data_packs/processed/controller_teacher_dataset.csv'), manifest: Annotated[Path, typer.Option(help='Output controller dataset manifest JSON')] = Path('data_packs/processed/controller_teacher_manifest.json')) -> None
research_train_controller(data: Annotated[Path, typer.Option(help='Controller teacher dataset CSV')], output: Annotated[Path, typer.Option(help='Output local controller JSON')] = Path('models/controller_imitation.json'), metrics_output: Annotated[Path, typer.Option(help='Output training metrics JSON')] = Path('models/controller_imitation_metrics.json'), ridge_lambda: Annotated[float, typer.Option(help='Ridge regularization strength')] = 0.001) -> None
research_train_neural_controller(data: Annotated[Path, typer.Option(help='Controller teacher dataset CSV')], output: Annotated[Path, typer.Option(help='Output neural controller checkpoint')] = Path('models/controller_neural.pt'), metrics_output: Annotated[Path, typer.Option(help='Output neural controller metrics JSON')] = Path('models/controller_neural_metrics.json'), epochs: Annotated[int, typer.Option(help='Training epochs')] = 120, hidden_size: Annotated[List[int], typer.Option('--hidden-size', help='Repeatable hidden layer size, for example --hidden-size 64.')] = []) -> None
research_evaluate_controller(model: Annotated[Path, typer.Option(help='Controller model path')], model_kind: Annotated[str, typer.Option(help='Controller type: linear or neural')] = 'linear', output_dir: Annotated[Path, typer.Option(help='Output evaluation directory')] = Path('results/controller_evaluation'), preset: Annotated[List[str], typer.Option('--preset', help='Repeatable held-out preset name.')] = [], seed: Annotated[List[int], typer.Option('--seed', help='Repeatable evaluation seed.')] = [], duration_minutes: Annotated[int, typer.Option(help='Duration per closed-loop run in minutes')] = 1440) -> None
research_local_ai_lab(run: Annotated[List[str], typer.Option('--run', help='Repeatable run input in label=path form; path may contain a Jetson endurance bundle.')], output_dir: Annotated[Path, typer.Option(help='Output directory for datasets, models, and reports')] = Path('results/local_ai_lab'), train_predictor: Annotated[bool, typer.Option('--train-predictor/--skip-predictor', help='Train the local glucose predictor from the generated predictor dataset.')] = True, train_neural: Annotated[bool, typer.Option('--train-neural/--skip-neural', help='Train the PyTorch controller in addition to the auditable linear controller.')] = True, evaluate: Annotated[bool, typer.Option('--evaluate/--skip-evaluation', help='Run held-out closed-loop evaluation after training.')] = True, predictor_config: Annotated[Optional[Path], typer.Option(help='Optional predictor config YAML. Defaults to research/configs/predictor.yaml.')] = None, duration_minutes: Annotated[int, typer.Option(help='Duration per held-out controller-evaluation run.')] = 1440)
manage_results(root: Annotated[Path, typer.Option('--root', help='Results root to index. Use this when your results folder starts getting too large.')] = Path('results'), output_dir: Annotated[Optional[Path], typer.Option('--output-dir', help='Index output directory. Defaults to <root>/_iints_results_index.')] = None, include_raw: Annotated[bool, typer.Option('--include-raw/--metadata-only', help='Also concatenate every results.csv into all_results_long.csv. This can become large.')] = False) -> None
research_xai_report(results_csv: Annotated[Path, typer.Argument(help='Path to the simulation results.csv')], hf_model: Annotated[Optional[str], typer.Option('--hf-model', help='Hugging Face medical LLM to use for generation (e.g. devanshamin/PubMedDiabetes-LLM-Predictions)')] = None, output_json: Annotated[Path, typer.Option('--output', help='Path to write the xai_events.json')] = Path('xai_events.json'))
research_results_index(root: Annotated[Path, typer.Option('--root', help='Results root to index. Defaults to the normal ./results folder.')] = Path('results'), output_dir: Annotated[Optional[Path], typer.Option('--output-dir', help='Index output directory. Defaults to <root>/_iints_results_index.')] = None, include_raw: Annotated[bool, typer.Option('--include-raw/--metadata-only', help='Also concatenate every results.csv into all_results_long.csv. This can become large.')] = False) -> None
research_academic_bundle(run_dir: Annotated[Path, typer.Argument(help='Completed IINTS run directory to describe as an RO-Crate.')], title: Annotated[Optional[str], typer.Option(help='Human-readable experiment title.')] = None, description: Annotated[Optional[str], typer.Option(help='Short research question or experiment description.')] = None, creator: Annotated[Optional[str], typer.Option(help='Researcher name recorded in the crate.')] = None, orcid: Annotated[Optional[str], typer.Option(help='Canonical ORCID URL, for example https://orcid.org/0000-0002-1825-0097.')] = None, license_id: Annotated[str, typer.Option('--license', help='SPDX license for run artifacts; defaults to NOASSERTION until the researcher chooses one.')] = 'NOASSERTION', source_id: Annotated[List[str], typer.Option('--source-id', help='Repeatable evidence source ID fromiints sources.')] = []) -> None
research_mechanistic_inspect(model: Annotated[Path, typer.Argument(help='Local SBML .xml or .sbml model file.')], output_json: Annotated[Optional[Path], typer.Option(help='Optional path for the machine-readable structural inspection.')] = None) -> None
research_mechanistic_run(model: Annotated[Path, typer.Argument(help='Local SBML .xml or .sbml model file.')], output_dir: Annotated[Path, typer.Option(help='Root directory for the isolated reference-model run.')] = Path('results/mechanistic_reference'), start: Annotated[float, typer.Option(help="Start in the model's declared time units.")] = 0.0, end: Annotated[float, typer.Option(help="End in the model's declared time units.")] = 1440.0, points: Annotated[int, typer.Option(help='Number of sampled points including endpoints.')] = 289, variable: Annotated[List[str], typer.Option('--variable', help='Repeatable species/global parameter ID. Use [X] or concentration:X for concentration and amount:X for amount; defaults follow hasOnlySubstanceUnits.')] = [], source_url: Annotated[Optional[str], typer.Option(help='Optional HTTPS provenance URL for the exact model source.')] = None, model_license: Annotated[str, typer.Option(help='Model-artifact license; use NOASSERTION when it has not been verified.')] = 'NOASSERTION') -> None
research_copasi_status() -> None
research_copasi_inspect(model: Annotated[Path, typer.Argument(help='Local COPASI .cps model file.')], output_json: Annotated[Optional[Path], typer.Option(help='Optional structural inspection JSON.')] = None) -> None
research_copasi_run(model: Annotated[Path, typer.Argument(help='Reviewed local COPASI .cps model file.')], output_dir: Annotated[Path, typer.Option(help='Evidence output root.')] = Path('results/copasi'), task: Annotated[Optional[str], typer.Option(help='Optional exact COPASI task-name override.')] = None, timeout_seconds: Annotated[int, typer.Option(help='CopasiSE wall-time limit in seconds.')] = 900, allow_external_execution: Annotated[bool, typer.Option('--allow-external-execution', help='Confirm that the configured COPASI tasks and external file references were reviewed.')] = False) -> None
research_cellml_status() -> None
research_cellml_inspect(model: Annotated[Path, typer.Argument(help='Local .cellml or CellML .xml file.')], output_json: Annotated[Optional[Path], typer.Option(help='Optional structural inspection JSON.')] = None) -> None
research_cellml_validate(model: Annotated[Path, typer.Argument(help='Local CellML model to validate with OpenCOR.')], output_dir: Annotated[Path, typer.Option(help='Evidence output root.')] = Path('results/cellml'), timeout_seconds: Annotated[int, typer.Option(help='OpenCOR validation timeout.')] = 120) -> None
research_fmi_status() -> None
research_fmi_inspect(model: Annotated[Path, typer.Argument(help='Local .fmu archive.')], output_json: Annotated[Optional[Path], typer.Option(help='Optional structural inspection JSON.')] = None) -> None
research_fmi_run(model: Annotated[Path, typer.Argument(help='Reviewed local .fmu archive.')], output_dir: Annotated[Path, typer.Option(help='Evidence output root.')] = Path('results/fmi'), start: Annotated[float, typer.Option(help='Start in FMU model-time units.')] = 0.0, end: Annotated[float, typer.Option(help='End in FMU model-time units.')] = 60.0, output_interval: Annotated[float, typer.Option(help='Output sampling interval.')] = 0.1, variable: Annotated[List[str], typer.Option('--variable', help='Repeatable declared FMU variable.')] = [], timeout_seconds: Annotated[int, typer.Option(help='Execution timeout in seconds.')] = 300, trust_native_code: Annotated[bool, typer.Option('--trust-native-code', help='Confirm that the FMU publisher, hash, binaries, and license were reviewed.')] = False) -> None
research_binding_query(uniprot: Annotated[str, typer.Option(help='One reviewed UniProt accession.')] = 'P06213', output_dir: Annotated[Path, typer.Option(help='Evidence output root.')] = Path('results/bindingdb'), cutoff_nm: Annotated[int, typer.Option(help='BindingDB affinity cutoff in nM.')] = 10000, max_records: Annotated[int, typer.Option(help='Maximum records exported locally.')] = 5000, timeout_seconds: Annotated[int, typer.Option(help='Verified-TLS request timeout.')] = 30) -> None
research_regenerative_panels(panel: Annotated[List[str], typer.Option('--panel', help='Repeatable panel key. Omit to list every bundled panel.')] = [], output_json: Annotated[Optional[Path], typer.Option(help='Optional machine-readable panel and evidence-plan output.')] = None) -> None
research_regenerative_compare(dataset: Annotated[Path, typer.Option(help='Protein-level CSV/Parquet with gene_symbol, group, sample_id, value, unit, scale, and source_id.')], output_dir: Annotated[Path, typer.Option(help='Comparison evidence output directory.')] = Path('results/regenerative/protein_comparison'), test_group: Annotated[str, typer.Option(help='Group label for the stem-cell-derived islet observations.')] = 'sc_islet', reference_group: Annotated[str, typer.Option(help='Group label for the primary-islet reference observations.')] = 'primary_islet', panel: Annotated[List[str], typer.Option('--panel', help='Repeatable panel key. Omit to compare all panels.')] = [], normalization_note: Annotated[str, typer.Option(help='Describe shared normalization, batch correction, and comparability assumptions.')] = 'not supplied', descriptive_margin_log2: Annotated[float, typer.Option(help='Descriptive absolute log2 margin; this does not perform an equivalence test.')] = 0.5, bootstrap_samples: Annotated[int, typer.Option(help='Bootstrap draws for descriptive median-difference intervals.')] = 2000, seed: Annotated[int, typer.Option(help='Bootstrap seed for reproducibility.')] = 42) -> None
research_regenerative_import_proteomics(data_path: Annotated[Path, typer.Option('--input-file', '-i', help='Path to proteomics matrix file (MaxQuant proteinGroups.txt, DIA-NN report.tsv, or wide TSV/CSV).', exists=True, dir_okay=False)], sample_metadata: Annotated[Path, typer.Option('--sample-metadata', '-m', help='Path to sample annotations CSV/TSV/JSON mapping sample IDs to group, batch_id, source_id.', exists=True, dir_okay=False)], output_path: Annotated[Path, typer.Option('--output-csv', '-o', help='Standardized output dataset path (.csv or .parquet) conforming to the comparator contract.')] = Path('data/standardized_islet_proteomics.csv'), input_format: Annotated[str, typer.Option('--format', '-f', help="Input proteomics format: 'auto', 'maxquant', 'diann', or 'wide_matrix'.")] = 'auto', source_id: Annotated[str, typer.Option('--source-id', '-s', help="Default repository/study identifier (e.g. 'PXD001539').")] = 'PRIDE', unit: Annotated[str, typer.Option('--unit', '-u', help="Measurement unit (e.g. 'LFQ intensity', 'normalized_abundance', 'MaxLFQ').")] = 'normalized_intensity', scale: Annotated[str, typer.Option('--scale', help="Measurement scale: 'linear' or 'log2'.")] = 'linear', intensity_prefix: Annotated[str, typer.Option('--intensity-prefix', help='Prefix for sample intensity columns in MaxQuant tables.')] = 'LFQ intensity ') -> None
research_export_onnx(model: Annotated[Path, typer.Option(help='Predictor checkpoint (.pt)')] = Path('models/hupa_finetuned_v2/predictor.pt'), out: Annotated[Path, typer.Option(help='Output ONNX file path')] = Path('models/predictor.onnx'))
research_audit_split(data: Annotated[Path, typer.Option(help='Prepared dataset path (CSV/Parquet)')], history_steps: Annotated[int, typer.Option(help='History window length')] = 48, horizon_steps: Annotated[int, typer.Option(help='Forecast horizon length')] = 6, feature_columns_csv: Annotated[str, typer.Option(help='Comma-separated feature columns')] = 'glucose_actual_mgdl,patient_iob_units,patient_cob_grams,effective_isf,effective_icr,effective_basal_rate_u_per_hr,glucose_trend_mgdl_min', target_column: Annotated[str, typer.Option(help='Target column')] = 'glucose_actual_mgdl', subject_column: Annotated[str, typer.Option(help='Subject ID column')] = 'subject_id', segment_column: Annotated[Optional[str], typer.Option(help='Segment column (optional)')] = 'segment_id', output_json: Annotated[Optional[Path], typer.Option(help='Write audit report JSON')] = None)
research_evaluate_forecast(input_csv: Annotated[Path, typer.Option(help='CSV with observed/predicted columns')], observed_column: Annotated[str, typer.Option(help='Observed glucose column')] = 'glucose_actual_mgdl', predicted_column: Annotated[str, typer.Option(help='Predicted glucose column')] = 'predicted_glucose_ai_30min', predicted_std_column: Annotated[Optional[str], typer.Option(help='Optional prediction std column')] = 'predictor_uncertainty_std_mgdl', gate_profile: Annotated[Optional[str], typer.Option(help='Optional calibration gate profile id')] = None, gate_profiles_path: Annotated[Optional[Path], typer.Option(help='Optional calibration gate profiles YAML path')] = None, fail_on_gate: Annotated[bool, typer.Option(help='Exit code 1 when calibration gate fails')] = False, output_json: Annotated[Optional[Path], typer.Option(help='Write metrics JSON')] = None)
research_ppgr_benchmark(meals_file: Annotated[Path, typer.Option('--meals-file', help='Path to cgmacros_meals.csv or standardized meal table')], output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for benchmark reports')] = Path('results/ppgr_benchmark'), sensor: Annotated[str, typer.Option('--sensor', help="Sensor type to evaluate ('dexcom' or 'libre')")] = 'dexcom', subjects_file: Annotated[Optional[Path], typer.Option('--subjects-file', help='Optional subjects bio metadata CSV')] = None, glucofm_checkpoint: Annotated[Optional[Path], typer.Option('--glucofm-checkpoint', help='Optional trained IINTS GlucoFM v2 reproduction checkpoint. Requires measured 24-hour pre-meal history JSON per meal.')] = None, test_split: Annotated[float, typer.Option('--test-split', help='Fraction of meals for test evaluation')] = 0.25, seed: Annotated[int, typer.Option('--seed', help='Random seed for reproducible split')] = 42)
research_cgm_jepa_embed(input_path: Annotated[Path, typer.Option('--input', help='Simulation run directory or CSV containing 24h CGM time-series')], output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for latent embeddings')] = Path('results/cgm_jepa_embedding'), checkpoint: Annotated[Optional[Path], typer.Option('--checkpoint', help='Optional pre-trained CGM-JEPA checkpoint (.pt)')] = None)
research_cgm_jepa_experiment(output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for scientific study artifacts')] = Path('results/cgm_jepa_study'), num_simulations: Annotated[int, typer.Option('--n-simulations', help='Number of virtual patient simulations')] = 100, sweep_param: Annotated[str, typer.Option('--sweep-param', help="Physiological parameter to vary ('insulin_sensitivity' or 'basal_egp')")] = 'insulin_sensitivity', min_val: Annotated[float, typer.Option('--min-val', help='Minimum parameter value multiplier')] = 0.4, max_val: Annotated[float, typer.Option('--max-val', help='Maximum parameter value multiplier')] = 2.0)
research_cgm_jepa_confounder(output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for confounder benchmark artifacts')] = Path('results/cgm_jepa_confounder'), num_pairs: Annotated[int, typer.Option('--num-pairs', help='Number of confounded paired cohorts (N=2*pairs)')] = 50)
research_glucofm_pretrain(source: Annotated[Path, typer.Option('--source', help='CGM CSV/TSV/Parquet used for self-supervised pretraining')], output_dir: Annotated[Path, typer.Option('--output-dir', help='Directory for checkpoint, state, manifest, and training report')] = Path('models/glucofm-reproduction'), glucose_column: Annotated[Optional[str], typer.Option('--glucose-column', help='Glucose column; inferred when omitted')] = None, timestamp_column: Annotated[Optional[str], typer.Option('--timestamp-column', help='Timestamp column; inferred when omitted')] = None, subject_column: Annotated[Optional[str], typer.Option('--subject-column', help='Subject/group column used for leakage-safe validation')] = 'subject_id', epochs: Annotated[int, typer.Option('--epochs', min=1, help='Pretraining epochs')] = 120, batch_size: Annotated[int, typer.Option('--batch-size', min=1, help='Windows per optimization step')] = 128, validation_fraction: Annotated[float, typer.Option('--validation-fraction', min=0.01, max=0.5, help='Fraction of subjects reserved for validation')] = 0.2, max_windows: Annotated[Optional[int], typer.Option('--max-windows', min=2, help='Optional deterministic window cap for smoke tests')] = None, device: Annotated[str, typer.Option('--device', help='auto, cpu, cuda, or mps')] = 'auto', seed: Annotated[int, typer.Option('--seed', help='Reproducible split/training seed')] = 42, resume_state: Annotated[Optional[Path], typer.Option('--resume-state', help='Resume from glucofm_pretraining_state.pt with matching dataset hash')] = None, allow_single_subject: Annotated[bool, typer.Option('--allow-single-subject', help='Software smoke tests only; disables subject-disjoint validation')] = False)
research_glucofm_embed(input_file: Annotated[Path, typer.Option('--input-file', help='CSV containing one 24-hour CGM window')], checkpoint: Annotated[Path, typer.Option('--checkpoint', help='Trained IINTS GlucoFM reproduction checkpoint')], output_file: Annotated[Path, typer.Option('--output-file', help='Path to save the 128D embedding CSV')] = Path('results/glucofm/embedding.csv'), glucose_column: Annotated[Optional[str], typer.Option('--glucose-column', help='Glucose column; inferred when omitted')] = None, timestamp_column: Annotated[Optional[str], typer.Option('--timestamp-column', help='Timestamp column for irregular/missing observations')] = None)
research_foundation_arena(output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for Foundation Arena comparative benchmark artifacts')] = Path('results/foundation_arena'), result_files: Annotated[Optional[list[Path]], typer.Option('--result', help='Measured evaluation JSON. Repeat --result for every model in the same benchmark.')] = None)
research_visualize_suite(output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for scientific figures and interactive HTML dashboard')] = Path('results/scientific_visualizations'), arena_results: Annotated[Optional[list[Path]], typer.Option('--arena-result', help='Measured foundation evaluation JSON; repeat for each comparable model.')] = None, confounder_evidence: Annotated[Optional[Path], typer.Option('--confounder-evidence', help='CSV/Parquet with model_name, si_ratio, and embedding_cosine_similarity.')] = None, dual_sensor_evidence: Annotated[Optional[Path], typer.Option('--dual-sensor-evidence', help='Paired sensor table with timestamp, dexcom_mgdl, libre_mgdl, and cohort.')] = None, safety_trace: Annotated[Optional[Path], typer.Option('--safety-trace', help='In-silico trace with comparator and supervised glucose columns.')] = None)
research_eucys_playbook(output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for the complete EUCYS 2026 jury scientific portfolio & dossier')] = Path('results/eucys_jury_dossier'), prediction_evidence: Annotated[Optional[Path], typer.Option('--prediction-evidence', help='Held-out CSV containing reference_mgdl and predicted_mgdl for Clarke EGA.')] = None, arena_results: Annotated[Optional[list[Path]], typer.Option('--arena-result', help='Measured foundation evaluation JSON; repeat for each comparable model.')] = None, confounder_evidence: Annotated[Optional[Path], typer.Option('--confounder-evidence', help='Pair-level physiological confounder evidence table.')] = None, dual_sensor_evidence: Annotated[Optional[Path], typer.Option('--dual-sensor-evidence', help='Paired Dexcom/Libre evidence table.')] = None, safety_trace: Annotated[Optional[Path], typer.Option('--safety-trace', help='In-silico comparator/supervisor safety trace.')] = None)
research_forecast_run(input_path: Annotated[Path, typer.Option('--input', help='Run directory or CSV. Accepts results.csv, raw/steps.csv, or research/predictor_training.csv.')], output_dir: Annotated[Path, typer.Option(help='Output directory for forecast evidence')] = Path('results/glucose_forecast'), predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional trained predictor checkpoint (.pt)')] = None, history_minutes: Annotated[int, typer.Option(help='History window in minutes')] = 240, horizon_minutes: Annotated[int, typer.Option(help='Forecast horizon in minutes')] = 30, time_step_minutes: Annotated[int, typer.Option(help='Expected sample interval in minutes')] = 5, hidden_biology: Annotated[str, typer.Option('--hidden-biology', help='Optional hidden-biology stress test: none or insulin-antibody.')] = 'none', antibody_binding_fraction: Annotated[Optional[float], typer.Option('--antibody-binding-fraction', help='Research-only insulin-antibody binding fraction override for --hidden-biology insulin-antibody.')] = None, antibody_release_fraction: Annotated[Optional[float], typer.Option('--antibody-release-fraction', help='Research-only bound-insulin release fraction override for --hidden-biology insulin-antibody.')] = None, mc_samples: Annotated[int, typer.Option(help='MC dropout samples when the predictor supports uncertainty')] = 30)
research_glucose_model_build_dataset(input_paths: Annotated[List[Path], typer.Option('--input', '-i', help='Prepared glucose dataset CSV/Parquet. Repeat for Ohio, AZT1D, simulator exports, etc.')], output_dir: Annotated[Path, typer.Option(help='Output folder for normalized training dataset, manifest, and config.')] = Path('models/iints-glucose-forecast-v0/dataset'), labels_csv: Annotated[Optional[str], typer.Option('--labels', help='Optional comma-separated labels matching --input order, e.g. ohio_train,sim_10k.')] = None, profile: Annotated[str, typer.Option(help='Training profile: smoke, quick, long, or paper.')] = 'long', output_format: Annotated[str, typer.Option(help='Dataset output format: csv or parquet.')] = 'csv', history_minutes: Annotated[int, typer.Option(help='Model history window in minutes.')] = 360, horizon_minutes: Annotated[int, typer.Option(help='Prediction horizon in minutes.')] = 120, time_step_minutes: Annotated[int, typer.Option(help='Expected CGM sample interval in minutes.')] = 5) -> None
research_glucose_model_init(output_dir: Annotated[Path, typer.Option(help='Output directory for the glucose model starter files.')] = Path('models/iints-glucose-forecast-v0'), profile: Annotated[str, typer.Option(help='Training profile: smoke, quick, long, or paper.')] = 'long', history_minutes: Annotated[int, typer.Option(help='Model history window in minutes.')] = 360, horizon_minutes: Annotated[int, typer.Option(help='Prediction horizon in minutes.')] = 120, time_step_minutes: Annotated[int, typer.Option(help='Expected CGM sample interval in minutes.')] = 5) -> None
research_glucose_model_train(data: Annotated[Path, typer.Option(help='Normalized glucose training dataset CSV/Parquet.')], output_dir: Annotated[Path, typer.Option(help='Output directory for predictor.pt and training_report.json.')] = Path('models/iints-glucose-forecast-v0'), config: Annotated[Optional[Path], typer.Option(help='Config YAML. If omitted, one is generated.')] = None, profile: Annotated[str, typer.Option(help='Generated config profile: smoke, quick, long, or paper.')] = 'long', epochs: Annotated[Optional[int], typer.Option(help='Override training.epochs for long local runs.')] = None, batch_size: Annotated[Optional[int], typer.Option(help='Override training.batch_size.')] = None, learning_rate: Annotated[Optional[float], typer.Option(help='Override training.learning_rate.')] = None, warm_start: Annotated[Optional[Path], typer.Option(help='Optional predictor.pt warm-start checkpoint.')] = None, export_hf: Annotated[bool, typer.Option('--export-hf/--no-export-hf', help='Build a Hugging Face-ready folder after training.')] = True, repo_id: Annotated[Optional[str], typer.Option(help='Optional Hugging Face repo id for model card hints.')] = None, dataset_manifest: Annotated[Optional[Path], typer.Option(help='Optional dataset manifest for HF public metadata.')] = None, comparison_dir: Annotated[Optional[Path], typer.Option(help='Optional glucose-model compare output directory to bundle with the Hugging Face export.')] = None) -> None
research_glucose_model_export_hf(model_dir: Annotated[Path, typer.Option(help='Directory containing predictor.pt and training_report.json.')] = Path('models/iints-glucose-forecast-v0'), output_dir: Annotated[Path, typer.Option(help='Output directory for the Hugging Face-ready bundle.')] = Path('models/iints-glucose-forecast-v0/huggingface'), repo_id: Annotated[Optional[str], typer.Option(help='Optional Hugging Face repo id, e.g. user/iints-glucose-forecast-v0.')] = None, dataset_manifest: Annotated[Optional[Path], typer.Option(help='Optional private manifest to redact into public metadata.')] = None, comparison_dir: Annotated[Optional[Path], typer.Option(help='Optional glucose-model compare output directory to include comparison metrics and reports.')] = None) -> None
research_glucose_model_compare(data: Annotated[Path, typer.Option(help='Normalized glucose dataset CSV/Parquet to evaluate on.')], output_dir: Annotated[Path, typer.Option(help='Output directory for comparison reports.')] = Path('results/glucose_model_comparison'), model_specs: Annotated[Optional[List[str]], typer.Option('--model', '-m', help='Model checkpoint as label=path/to/predictor.pt. Repeat for MSE, band-weighted, or physiology-regularized models (legacy name: PINN).')] = None, config: Annotated[Optional[Path], typer.Option(help='Comparison config YAML. Defaults to glucose-model quick config.')] = None, include_baselines: Annotated[bool, typer.Option('--include-baselines/--no-baselines', help='Compare transparent LastValue/LinearTrend/Physiology baselines.')] = True, mc_samples: Annotated[int, typer.Option(help='MC dropout samples for checkpoint uncertainty. Use 0 to disable.')] = 0, max_roc_mgdl_min: Annotated[float, typer.Option(help='Maximum plausible predicted glucose rate-of-change in mg/dL/min.')] = 3.0) -> None
research_glucose_model_jetson_train_hf(dataset: Annotated[Path, typer.Option(help='Normalized glucose training dataset CSV/Parquet built by glucose-model build-dataset.')] = Path('models/iints-glucose-forecast-v0/dataset/glucose_training_dataset.csv'), base_hf_repo: Annotated[Optional[str], typer.Option('--base-hf-repo', '--repo-id', help='IINTS native glucose-forecast bundle containing predictor.pt. Arbitrary foundation-model repositories are not compatible. If empty, pulls from target_hf_repo. --repo-id is a compatibility alias.')] = None, target_hf_repo: Annotated[Optional[str], typer.Option('--target-hf-repo', help='Your Hugging Face model repo id to push to, e.g. username/iints-glucose-forecast-v0.')] = 'IINTS/iints-glucose-forecast-v0', local_base_dir: Annotated[Optional[Path], typer.Option(help='Use an already downloaded base model folder instead of downloading from Hugging Face.')] = None, work_dir: Annotated[Path, typer.Option(help='Jetson training workspace for downloads, trials, champion, and leaderboard.')] = Path('models/jetson_hf_training'), revision: Annotated[Optional[str], typer.Option(help='Optional Hugging Face revision/tag/branch to download.')] = None, profile: Annotated[str, typer.Option(help='Fallback config profile when the HF repo has no glucose_model_config.yaml.')] = 'quick', max_trials: Annotated[int, typer.Option(help='Number of trials. Use 0 to keep training until Ctrl+C.')] = 1, epochs: Annotated[int, typer.Option(help='Fine-tune epochs per trial.')] = 8, batch_size: Annotated[int, typer.Option(help='Batch size per trial; keep modest on Jetson Nano.')] = 64, timeout_minutes: Annotated[float, typer.Option(help='Timeout for each train/compare subprocess.')] = 45.0, cooldown_seconds: Annotated[float, typer.Option(help='Pause between trials to keep Jetson thermals stable.')] = 10.0, min_lr: Annotated[float, typer.Option(help='Minimum sampled learning rate for fine-tuning.')] = 1e-05, max_lr: Annotated[float, typer.Option(help='Maximum sampled learning rate for fine-tuning.')] = 0.0005, min_pinn_lambda: Annotated[float, typer.Option(help='Minimum sampled PINN loss weight.')] = 0.05, max_pinn_lambda: Annotated[float, typer.Option(help='Maximum sampled PINN loss weight.')] = 0.8, min_score_improvement: Annotated[float, typer.Option(help='Required composite-score improvement before replacing the local champion.')] = 0.0, physiology_weight: Annotated[float, typer.Option(help='Composite score penalty weight for physiological violations.')] = 0.1, hypo_weight: Annotated[float, typer.Option(help='Composite score penalty weight for missed/false hypo behavior.')] = 0.2, seed: Annotated[int, typer.Option(help='Random seed for reproducible trial configs.')] = 42, dataset_manifest: Annotated[Optional[Path], typer.Option(help='Optional dataset manifest to redact into the HF export bundle.')] = None, upload_mode: Annotated[str, typer.Option(help='Upload behavior: none, pr, or direct. Default is safe local-only.')] = 'none', private_upload: Annotated[bool, typer.Option('--private-upload/--public-upload', help='Mark HF upload private when upload is enabled.')] = True, force_download: Annotated[bool, typer.Option('--force-download/--reuse-download', help='Re-download the HF base model even if cached locally.')] = False, hf_home: Annotated[Optional[Path], typer.Option(help='Optional HF_HOME cache directory. Defaults inside the Jetson work dir.')] = None) -> None
research_parity_check(model: Annotated[Path, typer.Option(help='Predictor checkpoint (.pt)')], onnx: Annotated[Path, typer.Option(help='Exported ONNX model path')], samples: Annotated[int, typer.Option(help='Random sample count for parity check')] = 64, tolerance: Annotated[float, typer.Option(help='Maximum allowed absolute error')] = 0.001, seed: Annotated[int, typer.Option(help='Random seed')] = 42, output_json: Annotated[Optional[Path], typer.Option(help='Write parity report JSON')] = None)
research_registry_list(registry: Annotated[Path, typer.Option(help='Path to model registry JSON')] = Path('models/registry.json'), stage: Annotated[Optional[str], typer.Option(help='Optional stage filter (candidate/validated/production/archived)')] = None, limit: Annotated[int, typer.Option(help='Max rows to print')] = 30)
research_registry_promote(registry: Annotated[Path, typer.Option(help='Path to model registry JSON')] = Path('models/registry.json'), run_id: Annotated[str, typer.Option(help='Run ID to promote')] = '', stage: Annotated[str, typer.Option(help='Target stage (validated/production/archived/candidate)')] = 'validated', force: Annotated[bool, typer.Option(help='Allow production promotion without validated stage')] = False, output_json: Annotated[Optional[Path], typer.Option(help='Write promotion result JSON')] = None)
import_data(input_csv: Annotated[Path, typer.Option(help='Path to CGM CSV file')], output_dir: Annotated[Path, typer.Option(help='Output directory for scenario + standard CSV')] = Path('./results/imported'), data_format: Annotated[str, typer.Option(help='Data format preset: generic, dexcom, libre, carelink')] = 'generic', scenario_name: Annotated[str, typer.Option(help='Scenario name')] = 'Imported CGM Scenario', scenario_version: Annotated[str, typer.Option(help='Scenario version')] = '1.0', time_unit: Annotated[str, typer.Option(help='Timestamp unit: minutes or seconds')] = 'minutes', carb_threshold: Annotated[float, typer.Option(help='Minimum carbs (g) to create a meal event')] = 0.1, scenario_path: Annotated[Optional[Path], typer.Option(help='Optional output scenario path')] = None, data_path: Annotated[Optional[Path], typer.Option(help='Optional output standard CSV path')] = None, mapping: Annotated[List[str], typer.Option('--map', help='Column mapping key=value (e.g., timestamp=Time, glucose=SGV)')] = [])
import_carelink(input_csv: Annotated[Path, typer.Option(help='Path to a Medtronic CareLink CSV export')], output_dir: Annotated[Path, typer.Option(help='Output directory for imported CareLink artifacts')] = Path('./results/imported_carelink'), scenario_name: Annotated[str, typer.Option(help='Scenario name')] = 'Imported CareLink Scenario', scenario_version: Annotated[str, typer.Option(help='Scenario version')] = '1.0', scenario_path: Annotated[Optional[Path], typer.Option(help='Optional output scenario path')] = None, data_path: Annotated[Optional[Path], typer.Option(help='Optional output standard CSV path')] = None, summary_path: Annotated[Optional[Path], typer.Option(help='Optional output summary JSON path')] = None, carb_threshold: Annotated[float, typer.Option(help='Minimum carbs (g) to create a meal event')] = 0.1)
carelink_workbench(input_csv: Annotated[Path, typer.Option(help='Path to a Medtronic CareLink CSV export')], output_dir: Annotated[Path, typer.Option(help='Output directory for the personal CareLink workspace')] = Path('./results/carelink_workbench'), scenario_name: Annotated[str, typer.Option(help='Scenario name for the generated experiment scenario')] = 'Imported CareLink Scenario', scenario_version: Annotated[str, typer.Option(help='Scenario version')] = '1.0', carb_threshold: Annotated[float, typer.Option(help='Minimum carbs (g) to create a meal event')] = 0.1, create_dev_mdmp_cert: Annotated[bool, typer.Option('--create-dev-mdmp-cert/--no-create-dev-mdmp-cert', help='Generate a local development MDMP certificate and keypair for the AI assistant.')] = True, grade: Annotated[str, typer.Option(help='Grade to embed in the local development MDMP certificate.')] = 'research_grade', expires_days: Annotated[int, typer.Option(help='Certificate expiry window in days for local development certs.')] = 30, key_dir: Annotated[Optional[Path], typer.Option(help='Optional directory for the generated local MDMP keypair.')] = None) -> None
import_wizard()
import_demo(output_dir: Annotated[Path, typer.Option(help='Output directory for scenario + CSV')] = Path('./results/demo_import'), scenario_name: Annotated[str, typer.Option(help='Scenario name')] = 'Demo CGM Scenario', export_raw: Annotated[bool, typer.Option(help='Export the raw demo CSV into output dir')] = True)
import_nightscout_cmd(url: Annotated[str, typer.Option(help='Nightscout base URL. Use https for non-local hosts.')], output_dir: Annotated[Path, typer.Option(help='Output directory for scenario + CSV')] = Path('./results/nightscout_import'), api_secret: Annotated[Optional[str], typer.Option(help='API secret (if required)')] = None, api_secret_env: Annotated[Optional[str], typer.Option(help='Environment variable name containing the Nightscout API secret.')] = None, api_secret_file: Annotated[Optional[Path], typer.Option(help='Path to a file containing the Nightscout API secret.')] = None, token: Annotated[Optional[str], typer.Option(help='API token (if required)')] = None, token_env: Annotated[Optional[str], typer.Option(help='Environment variable name containing the Nightscout API token.')] = None, token_file: Annotated[Optional[Path], typer.Option(help='Path to a file containing the Nightscout API token.')] = None, start: Annotated[Optional[str], typer.Option(help='Start time (ISO string)')] = None, end: Annotated[Optional[str], typer.Option(help='End time (ISO string)')] = None, limit: Annotated[Optional[int], typer.Option(help='Limit number of entries')] = None, scenario_name: Annotated[str, typer.Option(help='Scenario name')] = 'Nightscout Import')
import_tidepool_cmd(base_url: Annotated[str, typer.Option(help='Tidepool API base URL. Use https for non-local hosts.')] = 'https://api.tidepool.org', token: Annotated[Optional[str], typer.Option(help='Tidepool session token')] = None, token_env: Annotated[Optional[str], typer.Option(help='Environment variable name containing the Tidepool session token.')] = None, token_file: Annotated[Optional[Path], typer.Option(help='Path to a file containing the Tidepool session token.')] = None, user_id: Annotated[Optional[str], typer.Option(help='Optional Tidepool user id. Defaults to the current authenticated user.')] = None, start: Annotated[Optional[str], typer.Option(help='Optional ISO-8601 start timestamp.')] = None, end: Annotated[Optional[str], typer.Option(help='Optional ISO-8601 end timestamp.')] = None, output_dir: Annotated[Path, typer.Option(help='Directory for imported scenario and standard CSV.')] = Path('results/tidepool_import'), scenario_name: Annotated[str, typer.Option(help='Scenario name written into scenario.json.')] = 'Tidepool Import')
medtronic_live_cmd(base_url: Annotated[str, typer.Option(help='Authorized Medtronic/CareLink live relay base URL. Use https for non-local hosts.')], endpoint_path: Annotated[str, typer.Option(help='Read-only JSON endpoint path on the authorized relay.')] = '/carelink/live', output_dir: Annotated[Path, typer.Option(help='Directory for live timeline, standard CSV, and latest snapshot JSON.')] = Path('./results/medtronic_live'), token: Annotated[Optional[str], typer.Option(help='Bearer token for the authorized relay.')] = None, token_env: Annotated[Optional[str], typer.Option(help='Environment variable name containing the bearer token.')] = None, token_file: Annotated[Optional[Path], typer.Option(help='Path to a file containing the bearer token.')] = None, device_id: Annotated[Optional[str], typer.Option(help='Optional pump/device id query parameter.')] = None, patient_id: Annotated[Optional[str], typer.Option(help='Optional patient id query parameter.')] = None, since: Annotated[Optional[str], typer.Option(help='Optional ISO-8601 lower-bound query parameter.')] = None, limit: Annotated[Optional[int], typer.Option(help='Optional max records query parameter.')] = None, samples: Annotated[int, typer.Option(help='Number of polling samples. Use 0 to poll until interrupted.')] = 1, poll_seconds: Annotated[float, typer.Option(help='Seconds between polling samples.')] = 30.0, source: Annotated[str, typer.Option(help='Source label written into IINTS outputs.')] = 'medtronic_carelink_live') -> None
medtronic_pump_direct_cmd(transport: Annotated[str, typer.Option(help='Direct pump transport: simulated or official-module.')] = 'simulated', official_factory: Annotated[Optional[str], typer.Option(help='Approved internal factory reference for official-module mode, e.g. package.module:create_transport.')] = None, read_only_confirm: Annotated[Optional[str], typer.Option(help='Required confirmation string for official-module hardware transport.')] = None, output_dir: Annotated[Path, typer.Option(help='Directory for pump_timeline.csv, cgm_standard.csv, and pump_latest.json.')] = Path('./results/medtronic_pump_direct'), samples: Annotated[int, typer.Option(help='Number of snapshots to read. Use 0 to poll until interrupted.')] = 1, poll_seconds: Annotated[float, typer.Option(help='Seconds between snapshots.')] = 30.0, simulated_seed: Annotated[int, typer.Option(help='Seed for simulated bench transport.')] = 42, simulated_start_glucose_mgdl: Annotated[float, typer.Option(help='Initial glucose for simulated bench transport.')] = 118.0, simulated_step_minutes: Annotated[float, typer.Option(help='Minutes advanced per simulated snapshot.')] = 5.0) -> None
check_deps()
algorithms_list()
algorithms_info(name: Annotated[str, typer.Argument(help='Algorithm display name')])
plugin_install(path: Annotated[Path, typer.Argument(help='Path to a local InsulinAlgorithm .py file')], name: Annotated[Optional[str], typer.Option(help='Optional display name override')] = None)
plugin_register_algo(path: Annotated[Path, typer.Argument(help='Path to a local InsulinAlgorithm .py file')], name: Annotated[Optional[str], typer.Option(help='Optional display name override')] = None)
plugin_register_patient_model(path: Annotated[Path, typer.Argument(help='Path to a local patient model .py file')], name: Annotated[Optional[str], typer.Option(help='Optional display name override')] = None)
plugin_register_data_source(path: Annotated[Path, typer.Argument(help='Path to a local data source .py file')], name: Annotated[Optional[str], typer.Option(help='Optional display name override')] = None)
plugin_register_validator(path: Annotated[Path, typer.Argument(help='Path to a local validator .py file')], name: Annotated[Optional[str], typer.Option(help='Optional display name override')] = None)
plugin_list(kind: Annotated[Optional[str], typer.Option(help='Filter by kind: algorithm, patient_model, data_source, validator')] = None)
plugin_uninstall(name: Annotated[str, typer.Argument(help='Local plugin display name')], kind: Annotated[Optional[str], typer.Option(help='Optional kind filter')] = None, remove_file: Annotated[bool, typer.Option(help='Also delete the copied plugin file from the plugin home')] = False)
patientmodel_list()
jetson_doctor()
jetson_theory_stress_run(output_dir: Annotated[Path, typer.Option(help='Output directory for Theory Stress Lab artifacts')] = Path('results/theory_stress_lab'), profile: Annotated[str, typer.Option(help='Run profile: jetson, ci, or deep')] = 'jetson', seed: Annotated[int, typer.Option(help='Deterministic seed for reproducible scenario generation')] = 42, repeats: Annotated[int, typer.Option(help='Repeat the configured check suite with shifted seeds')] = 1, duration_minutes: Annotated[float, typer.Option(help='Labelled run duration for the report metadata')] = 30.0, fail_on_weakness: Annotated[bool, typer.Option(help='Exit with code 1 when any invariant fails')] = False)
jetson_endurance_start(algo: Annotated[Path, typer.Option('--algo', help='Path to an InsulinAlgorithm Python file')], predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional LSTM predictor checkpoint')] = None, duration: Annotated[str, typer.Option(help='Duration such as 1h, 24h, 7d, 30d')] = '24h', output_dir: Annotated[Path, typer.Option(help='Output directory for the endurance study')] = Path('results/jetson_endurance'), profile: Annotated[str, typer.Option(help='Endurance profile name')] = 'mixed_adversarial', seed: Annotated[int, typer.Option(help='Deterministic simulation seed')] = 42, patient_model: Annotated[str, typer.Option(help='Patient model name passed to PatientFactory')] = 'bergman', sensor_profile: Annotated[str, typer.Option(help='Sensor profile for the simulated CGM stream')] = 'free_living_cgm', custom_profile: Annotated[Optional[Path], typer.Option(help='YAML file for --profile custom')] = None, time_step: Annotated[int, typer.Option(help='Simulation step size in minutes')] = 5, checkpoint_interval: Annotated[int, typer.Option(help='Checkpoint interval in simulated minutes.')] = 360, hardware_sample_interval: Annotated[int, typer.Option(help='Hardware telemetry interval in simulated minutes.')] = 60, status_interval_steps: Annotated[int, typer.Option(help='How often to persist status and partial CSV data.')] = 25, wall_clock: Annotated[bool, typer.Option('--wall-clock/--accelerated', help='Use real wall-clock pacing so 1d takes an actual 24 hours instead of finishing as fast as possible.')] = False, research_export: Annotated[bool, typer.Option('--research-export/--no-research-export', help='Write a predictor-training dataset and research manifest next to the normal endurance artifacts.')] = True, finalize_research: Annotated[bool, typer.Option('--finalize-research/--no-finalize-research', help='After the endurance run, train local research models and write a held-out evaluation report.')] = False, resume: Annotated[bool, typer.Option(help='Resume from the latest snapshot in the output directory')] = False)
jetson_endurance_finalize_research(output_dir: Annotated[Path, typer.Option(help='Completed endurance output directory')], train_predictor: Annotated[bool, typer.Option('--train-predictor/--skip-predictor', help='Train a glucose predictor from the exported endurance dataset when enough rows are available.')] = True, train_neural: Annotated[bool, typer.Option('--train-neural/--skip-neural', help='Train the PyTorch controller in addition to the auditable linear baseline.')] = True, duration_minutes: Annotated[int, typer.Option(help='Closed-loop evaluation duration per held-out run in minutes.')] = 1440)
jetson_endurance_status(output_dir: Annotated[Path, typer.Option(help='Endurance output directory')])
jetson_endurance_monitor(output_dir: Annotated[Path, typer.Option(help='Endurance output directory')], watch: Annotated[bool, typer.Option(help='Refresh while the run is active')] = False, interval_seconds: Annotated[int, typer.Option(help='Refresh interval for --watch')] = 5)
jetson_endurance_stop(output_dir: Annotated[Path, typer.Option(help='Endurance output directory')], generate_report: Annotated[bool, typer.Option(help='Ask the runner to finalize reports before stopping')] = False)
jetson_endurance_export(output_dir: Annotated[Path, typer.Option(help='Endurance output directory')], output: Annotated[Path, typer.Option(help='Destination zip archive')])
jetson_endurance_install_service(algo: Annotated[Path, typer.Option('--algo', help='Path to an InsulinAlgorithm Python file')], duration: Annotated[str, typer.Option(help='Duration such as 24h, 7d, 30d')] = '7d', output_dir: Annotated[Path, typer.Option(help='Output directory for the endurance study')] = Path('results/jetson_endurance'), predictor_path: Annotated[Optional[Path], typer.Option('--predictor', help='Optional LSTM predictor checkpoint')] = None, profile: Annotated[str, typer.Option(help='Endurance profile name')] = 'mixed_adversarial', seed: Annotated[int, typer.Option(help='Deterministic simulation seed')] = 42, wall_clock: Annotated[bool, typer.Option('--wall-clock/--accelerated', help='Write a service that paces the run in real time instead of accelerated simulation time.')] = False, service_path: Annotated[Optional[Path], typer.Option(help='Where to write the systemd unit file')] = None)
docs_algo(algo_path: Annotated[Path, typer.Option(help='Path to the algorithm Python file to document')])
benchmark(algo_to_benchmark: Annotated[Path, typer.Option(help='Path to the AI algorithm Python file to benchmark')], patient_configs_dir: Annotated[Path, typer.Option(help='Directory containing patient configuration YAML files')] = Path('src/iints/data/virtual_patients'), scenarios_dir: Annotated[Path, typer.Option(help='Directory containing scenario JSON files')] = Path('scenarios'), duration: Annotated[int, typer.Option(help='Simulation duration in minutes for each run')] = 720, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes')] = 5, output_dir: Annotated[Optional[Path], typer.Option(help='Directory to save all benchmark results')] = None, seed: Annotated[Optional[int], typer.Option(help='Base seed for deterministic runs')] = None)
edge_benchmark(algo: Annotated[Path, typer.Option(help='Path to the insulin algorithm Python file used for the edge benchmark.')], output_json: Annotated[Path, typer.Option(help='Output JSON path for the hardware benchmark results.')] = Path('results/edge_benchmark.json'), patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', scenario_profile: Annotated[str, typer.Option(help='Digital patient scenario profile.')] = 'normal_day', steps: Annotated[int, typer.Option(help='Number of simulated steps used for throughput measurement.')] = 72, platform_name: Annotated[str, typer.Option('--platform', help="Platform label written into the benchmark report. Use 'auto' to detect locally.")] = 'auto', api_host: Annotated[str, typer.Option(help='Host used for the local dashboard probe.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Port used for the local dashboard probe.')] = 8766, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None) -> None
edge_setup(output_dir: Annotated[Path, typer.Option(help='Directory where the edge-ready project scaffold should be written.')] = Path('iints_edge_demo'), board: Annotated[str, typer.Option(help='Edge board target: raspberry_pi or uno_q.')] = 'raspberry_pi', workspace_name: Annotated[str, typer.Option(help='Workspace folder name used for the persistent patient runtime.')] = 'patient_runtime', scenario_profile: Annotated[str, typer.Option(help='Initial live scenario profile.')] = 'normal_day', patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', mode: Annotated[str, typer.Option(help='Clock mode for the generated edge project.')] = 'demo-time', speed: Annotated[str, typer.Option(help='Acceleration factor for demo-time mode. Accepts 60 or 60x.')] = '60x', api_host: Annotated[str, typer.Option(help='Dashboard host to bake into the generated runtime config.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Dashboard port to bake into the generated runtime config.')] = 8765, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None, service_name: Annotated[str, typer.Option(help='systemd service name without the .service suffix.')] = 'iints-digital-patient', user_name: Annotated[Optional[str], typer.Option(help='Linux user that should own the generated systemd service.')] = None, uno_bridge_port: Annotated[Optional[str], typer.Option(help='Optional UNO Q serial port to bake into a generated bridge systemd service.')] = None, uno_bridge_service_name: Annotated[str, typer.Option(help='UNO Q bridge systemd service name without the .service suffix.')] = 'iints-uno-q-bridge') -> None
edge_quickstart(board: Annotated[str, typer.Option(help='Edge board target: raspberry_pi or uno_q.')] = 'raspberry_pi', output_dir: Annotated[Optional[Path], typer.Option(help='Project directory to create. Defaults to iints_pi_demo or iints_uno_q_demo.')] = None, scenario_profile: Annotated[str, typer.Option(help='Initial live scenario profile.')] = 'expo_hot_start', patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', mode: Annotated[str, typer.Option(help='Clock mode for the generated edge project.')] = 'demo-time', speed: Annotated[str, typer.Option(help='Acceleration factor for demo-time mode. Accepts 60 or 60x.')] = '60x', api_host: Annotated[str, typer.Option(help='Dashboard host to bake into the generated runtime config.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Dashboard port to bake into the generated runtime config.')] = 8765, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None, start: Annotated[bool, typer.Option('--start/--no-start', help='Start the Linux-side digital patient after creating the project.')] = True, reset: Annotated[bool, typer.Option(help='Reset runtime state when starting.')] = True, foreground: Annotated[bool, typer.Option(help='Run in the foreground instead of spawning the daemon.')] = False, bridge_port: Annotated[str, typer.Option(help='UNO Q bridge port for printed commands and optional testing. Use auto for autodetect.')] = 'auto', test_bridge: Annotated[bool, typer.Option(help='After setup, run one UNO Q bridge test if a board is connected.')] = False, max_steps: Annotated[Optional[int], typer.Option('--max-steps', hidden=True)] = None) -> None
edge_install(board: Annotated[str, typer.Option(help='Edge board target: raspberry_pi or uno_q.')] = 'raspberry_pi', output_dir: Annotated[Optional[Path], typer.Option(help='Project directory to create. Defaults to iints_pi_demo or iints_uno_q_demo.')] = None, scenario_profile: Annotated[str, typer.Option(help='Initial live scenario profile.')] = 'expo_hot_start', patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', mode: Annotated[str, typer.Option(help='Clock mode for the generated edge project.')] = 'demo-time', speed: Annotated[str, typer.Option(help='Acceleration factor for demo-time mode. Accepts 60 or 60x.')] = '60x', api_host: Annotated[str, typer.Option(help='Dashboard host to bake into the generated runtime config.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Dashboard port to bake into the generated runtime config.')] = 8765, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None, install_python_extras: Annotated[bool, typer.Option('--install-python-extras/--no-install-python-extras', help='Install or upgrade the SDK edge extras in the current Python environment.')] = True, package_spec: Annotated[str, typer.Option(help='Package spec used when installing edge extras.')] = 'iints-sdk-python35[edge,mdmp]', start: Annotated[bool, typer.Option('--start/--no-start', help='Start the Linux-side digital patient after setup.')] = True, reset: Annotated[bool, typer.Option(help='Reset runtime state when starting.')] = True, foreground: Annotated[bool, typer.Option(help='Run the patient runtime in the foreground instead of spawning the daemon.')] = False, bridge_port: Annotated[str, typer.Option(help='UNO Q serial port. Use auto if exactly one board is connected.')] = 'auto', flash: Annotated[bool, typer.Option(help='Flash the generated UNO Q bridge sketch with Arduino CLI.')] = False, fqbn: Annotated[Optional[str], typer.Option(help='Arduino CLI FQBN used when --flash is set.')] = None, arduino_cli: Annotated[str, typer.Option(help='Arduino CLI executable name or path.')] = 'arduino-cli', test_bridge: Annotated[bool, typer.Option(help='Run one UNO Q bridge test after setup/flash.')] = False, dry_run: Annotated[bool, typer.Option(help='Write the project scaffold but skip pip install, start, flash, and bridge test.')] = False, max_steps: Annotated[Optional[int], typer.Option('--max-steps', hidden=True)] = None) -> None
edge_deploy(host: Annotated[str, typer.Option(help='Remote Raspberry Pi hostname or IP address.')], user_name: Annotated[Optional[str], typer.Option('--user', help='Optional remote SSH username.')] = None, ssh_port: Annotated[int, typer.Option(help='SSH port used for the remote Raspberry Pi.')] = 22, remote_dir: Annotated[str, typer.Option(help='Target project directory on the Raspberry Pi.')] = '~/iints_pi_demo', local_output_dir: Annotated[Path, typer.Option(help='Local scaffold directory that will also be synced to the Pi.')] = Path('iints_pi_demo'), board: Annotated[str, typer.Option(help='Edge board target: raspberry_pi or uno_q.')] = 'raspberry_pi', workspace_name: Annotated[str, typer.Option(help='Workspace folder name used for the persistent patient runtime.')] = 'patient_runtime', scenario_profile: Annotated[str, typer.Option(help='Initial live scenario profile deployed to the Pi.')] = 'expo_hot_start', patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', mode: Annotated[str, typer.Option(help='Clock mode for the generated edge project.')] = 'demo-time', speed: Annotated[str, typer.Option(help='Acceleration factor for demo-time mode. Accepts 60 or 60x.')] = '60x', api_host: Annotated[str, typer.Option(help='Dashboard host to bake into the generated runtime config. Keep 127.0.0.1 when using Raspberry Pi Connect.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Dashboard port to bake into the generated runtime config.')] = 8765, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None, service_name: Annotated[str, typer.Option(help='systemd service name without the .service suffix.')] = 'iints-digital-patient', install_autostart: Annotated[bool, typer.Option(help='Install the generated systemd service, watchdog timer, and desktop autostart on the Pi.')] = True, start_runtime: Annotated[bool, typer.Option(help='Start the Maker Faire runtime after deployment.')] = True, enable_connect_linger: Annotated[bool, typer.Option(help='Runloginctl enable-lingeron the Pi so Raspberry Pi Connect remote shell keeps working after reboots.')] = True, ssh_timeout_seconds: Annotated[float, typer.Option(help='Timeout per remote SSH step in seconds.')] = 300.0, ssh_retries: Annotated[int, typer.Option(help='How many times to retry a failing SSH step before giving up.')] = 1, uno_bridge_port: Annotated[Optional[str], typer.Option(help='Optional UNO Q serial port on the Pi, for example /dev/ttyACM0. Generates and installs a bridge service.')] = None, uno_bridge_service_name: Annotated[str, typer.Option(help='UNO Q bridge systemd service name without the .service suffix.')] = 'iints-uno-q-bridge', flash_uno_bridge: Annotated[bool, typer.Option(help='Flash the UNO Q bridge sketch remotely after syncing the project. Requires --uno-bridge-port and --uno-fqbn.')] = False, uno_fqbn: Annotated[Optional[str], typer.Option(help='Arduino CLI FQBN used when --flash-uno-bridge is enabled.')] = None, arduino_cli: Annotated[str, typer.Option(help='Arduino CLI executable name or path on the Raspberry Pi.')] = 'arduino-cli', dry_run: Annotated[bool, typer.Option(help='Show the remote deployment plan without executing SSH commands.')] = False, verbose: Annotated[bool, typer.Option(help='Print the raw remote SSH command and deploy stdout for debugging.')] = False) -> None
edge_offline_bundle(output: Annotated[Path, typer.Option(help='Tarball written for offline USB-stick installs.')] = Path('iints_offline.tar.gz'), board: Annotated[str, typer.Option(help='Edge board target baked into the scaffold: raspberry_pi or uno_q.')] = 'raspberry_pi', workspace_name: Annotated[str, typer.Option(help='Workspace folder name used for the persistent patient runtime.')] = 'patient_runtime', scenario_profile: Annotated[str, typer.Option(help='Initial live scenario profile baked into the scaffold.')] = 'expo_hot_start', patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', mode: Annotated[str, typer.Option(help='Clock mode baked into the generated edge project.')] = 'demo-time', speed: Annotated[str, typer.Option(help='Acceleration factor for demo-time mode. Accepts 60 or 60x.')] = '60x', api_host: Annotated[str, typer.Option(help='Dashboard host baked into the runtime config. Keep 127.0.0.1 for Pi Connect setups.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Dashboard port baked into the runtime config.')] = 8765, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None) -> None
edge_study(algo: Annotated[Path, typer.Option(help='Path to the algorithm Python file.')], output_dir: Annotated[Path, typer.Option(help='Root directory for the Pi-generated study bundle.')] = Path('results/pi_study'), preset: Annotated[str, typer.Option(help='Study preset: default or eucys.')] = 'default', profile_set: Annotated[str, typer.Option(help='Patient profile set to evaluate on the Pi.')] = DEFAULT_PROFILE_SET, scenarios: Annotated[str, typer.Option(help='Optional comma-separated scenario slugs to run.')] = '', seeds: Annotated[str, typer.Option(help='Comma-separated seed list.')] = '1,2,3,4,5', duration: Annotated[Optional[int], typer.Option(help='Override scenario duration in minutes.')] = None, time_step: Annotated[int, typer.Option(help='Simulation time step in minutes.')] = 5, include_default_baselines: Annotated[bool, typer.Option('--include-default-baselines/--no-include-default-baselines', help='Include the default baseline registry in the Pi study matrix.')] = True, extra_algorithms: Annotated[str, typer.Option(help='Comma-separated additional comparison algorithm labels.')] = '', prepare_ai: Annotated[bool, typer.Option(help='Generate AI-ready artifacts for non-corrupted study arms.')] = False) -> None
edge_long_study(config: Annotated[Path, typer.Option(help='YAML config describing the multi-day edge study.')], project_dir: Annotated[Path, typer.Option(help='Edge project directory that contains the algorithms folder and runtime scaffold.')] = Path('.'), resume: Annotated[bool, typer.Option(help='Resume from the next incomplete day by inspecting long_study_index.csv.')] = False) -> None
edge_study_snapshot(project_dir: Annotated[Path, typer.Option(help='Edge project directory used to resolve relative study paths.')] = Path('.'), input_dir: Annotated[Path, typer.Option(help='Long-study directory to snapshot.')] = Path('results/long_study'), output: Annotated[Path, typer.Option(help='Output directory or .tar.gz path for the snapshot archive.')] = Path('snapshots')) -> None
edge_study_export(project_dir: Annotated[Path, typer.Option(help='Edge project directory used to resolve relative study paths.')] = Path('.'), input_dir: Annotated[Path, typer.Option(help='Long-study directory to export.')] = Path('results/long_study'), output: Annotated[Path, typer.Option(help='Zip archive written for transfer to another device.')] = Path('results/long_study_export.zip')) -> None
edge_doctor(board: Annotated[str, typer.Option(help='Board target to validate: raspberry_pi or uno_q.')] = 'raspberry_pi', project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime') -> None
edge_remote_status(host: Annotated[str, typer.Option(help='Remote Raspberry Pi hostname or IP address.')], user_name: Annotated[Optional[str], typer.Option('--user', help='Optional remote SSH username.')] = None, ssh_port: Annotated[int, typer.Option(help='SSH port used for the remote Raspberry Pi.')] = 22, remote_dir: Annotated[str, typer.Option(help='Target project directory on the Raspberry Pi.')] = '~/iints_pi_demo', ssh_timeout_seconds: Annotated[float, typer.Option(help='Timeout per remote SSH step in seconds.')] = 60.0, ssh_retries: Annotated[int, typer.Option(help='How many times to retry a failing SSH step before giving up.')] = 0) -> None
edge_remote_reset(host: Annotated[str, typer.Option(help='Remote Raspberry Pi hostname or IP address.')], user_name: Annotated[Optional[str], typer.Option('--user', help='Optional remote SSH username.')] = None, ssh_port: Annotated[int, typer.Option(help='SSH port used for the remote Raspberry Pi.')] = 22, remote_dir: Annotated[str, typer.Option(help='Target project directory on the Raspberry Pi.')] = '~/iints_pi_demo', scenario_profile: Annotated[Optional[str], typer.Option(help='Optional profile to load after reset.')] = None, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override for the reset profile.')] = None, ssh_timeout_seconds: Annotated[float, typer.Option(help='Timeout per remote SSH step in seconds.')] = 60.0, ssh_retries: Annotated[int, typer.Option(help='How many times to retry a failing SSH step before giving up.')] = 0) -> None
edge_remote_stop(host: Annotated[str, typer.Option(help='Remote Raspberry Pi hostname or IP address.')], user_name: Annotated[Optional[str], typer.Option('--user', help='Optional remote SSH username.')] = None, ssh_port: Annotated[int, typer.Option(help='SSH port used for the remote Raspberry Pi.')] = 22, remote_dir: Annotated[str, typer.Option(help='Target project directory on the Raspberry Pi.')] = '~/iints_pi_demo', ssh_timeout_seconds: Annotated[float, typer.Option(help='Timeout per remote SSH step in seconds.')] = 60.0, ssh_retries: Annotated[int, typer.Option(help='How many times to retry a failing SSH step before giving up.')] = 0) -> None
edge_up(project_dir: Annotated[Path, typer.Option(help='Edge project directory created byiints edge setup.')] = Path('.'), workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', foreground: Annotated[bool, typer.Option(help='Run the digital patient in the foreground instead of spawning the daemon.')] = False, reset: Annotated[bool, typer.Option(help='Reset the runtime state before starting.')] = False, max_steps: Annotated[Optional[int], typer.Option('--max-steps', hidden=True)] = None) -> None
makerfaire_up(project_dir: Annotated[Path, typer.Option(help='Edge project directory created byiints edge setup.')] = Path('.'), workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', scenario_profile: Annotated[str, typer.Option(help='Booth-ready scenario profile. Defaults to expo_hot_start.')] = 'expo_hot_start', seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override for the booth reset/start.')] = None, reset: Annotated[bool, typer.Option(help='Reset into the booth profile when the runtime is already running.')] = True, foreground: Annotated[bool, typer.Option(help='Run in the foreground instead of using the background daemon.')] = False, show_kiosk: Annotated[bool, typer.Option(help='Print the kiosk panel after startup so you can copy the Pi display URL quickly.')] = True) -> None
makerfaire_autostart(project_dir: Annotated[Path, typer.Option(help='Edge project directory created byiints edge setup.')] = Path('.'), workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime') -> None
makerfaire_watchdog(project_dir: Annotated[Path, typer.Option(help='Edge project directory created byiints edge setup.')] = Path('.'), workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', scenario_profile: Annotated[str, typer.Option(help='Booth-safe scenario profile to restore if the runtime must be restarted.')] = 'expo_hot_start', seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override used when the watchdog has to restart the runtime.')] = None, quiet: Annotated[bool, typer.Option(help='Print only minimal output. Useful for watchdog scripts and timers.')] = False) -> None
edge_kiosk(project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace: Annotated[Optional[Path], typer.Option(help='Optional runtime workspace override.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime') -> None
edge_reset(project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace: Annotated[Optional[Path], typer.Option(help='Optional runtime workspace override.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', scenario_profile: Annotated[Optional[str], typer.Option(help='Optional profile to load after reset. Defaults to expo_hot_start.')] = None, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override for the reset profile.')] = None) -> None
edge_stop(project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace: Annotated[Optional[Path], typer.Option(help='Optional runtime workspace override.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime') -> None
edge_service(project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace: Annotated[Optional[Path], typer.Option(help='Optional runtime workspace override.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', output: Annotated[Optional[Path], typer.Option(help='Optional output service file path.')] = None, service_name: Annotated[str, typer.Option(help='systemd service name without the .service suffix.')] = 'iints-digital-patient', user_name: Annotated[Optional[str], typer.Option(help='Linux user that should run the service. Defaults to the current shell user.')] = None, python_path: Annotated[Optional[Path], typer.Option(help='Python executable used in ExecStart. Defaults to the current interpreter.')] = None) -> None
edge_status(workspace: Annotated[Optional[Path], typer.Option(help='Workspace directory for the persistent digital patient state.')] = None, project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime') -> None
edge_bundle(workspace: Annotated[Optional[Path], typer.Option(help='Workspace directory for the persistent digital patient state.')] = None, project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', output: Annotated[Path, typer.Option(help='ZIP archive written for workstation-side analysis.')] = Path('results/edge_runtime_bundle.zip'), include_log: Annotated[bool, typer.Option(help='Include the patient log in the archive.')] = True, include_database: Annotated[bool, typer.Option(help='Include the SQLite runtime database in the archive.')] = True) -> None
edge_update(output_script: Annotated[Path, typer.Option(help='Where to write the edge update shell script.')] = Path('update_edge_runtime.sh'), profile: Annotated[str, typer.Option(help='Install profile to upgrade: edge or full.')] = 'edge', version_pin: Annotated[Optional[str], typer.Option(help='Optional exact SDK version pin, for example 1.5.2.')] = None) -> None
edge_hardware_bridge(board: Annotated[str, typer.Option(help='Hardware bridge target. Currently supported: uno_q.')] = 'uno_q', output_dir: Annotated[Path, typer.Option(help='Directory where the hardware bridge scaffold should be written.')] = Path('uno_q_bridge')) -> None
fpga_setup(output_dir: Annotated[Path, typer.Option(help='Directory where the FPGA lab workspace should be written.')] = Path('iints_fpga_lab')) -> None
fpga_doctor() -> None
fpga_simulate(events: Annotated[Optional[Path], typer.Option(help='Optional JSON/CSV event file. Defaults to bundled FPGA demo events.')] = None, output_dir: Annotated[Path, typer.Option(help='Output directory for FPGA comparison artifacts.')] = Path('results/fpga_mock_run'), transport: Annotated[str, typer.Option(help='FPGA transport: mock or serial.')] = 'mock', port: Annotated[Optional[str], typer.Option(help='Serial port when --transport serial is used.')] = None, baudrate: Annotated[int, typer.Option(help='Serial baudrate for FPGA JSON-lines transport.')] = FPGA_DEFAULT_BAUDRATE, timeout_seconds: Annotated[float, typer.Option(help='Serial timeout per event in seconds.')] = 1.5) -> None
fpga_export_events(results_csv: Annotated[Path, typer.Option(help='Existing IINTS results CSV to convert into FPGA event JSON.')], output_events: Annotated[Path, typer.Option(help='Output FPGA events JSON path.')] = Path('results/fpga_events_from_results.json'), stride: Annotated[int, typer.Option(help='Use every Nth results row when exporting events.')] = 1, max_events: Annotated[Optional[int], typer.Option(help='Maximum exported events. Use 0 for no limit.')] = 288) -> None
fpga_replay(results_csv: Annotated[Path, typer.Option(help='Existing IINTS results CSV to replay through FPGA mode.')], output_dir: Annotated[Path, typer.Option(help='Output directory for replay artifacts.')] = Path('results/fpga_replay'), transport: Annotated[str, typer.Option(help='FPGA transport: mock or serial.')] = 'mock', port: Annotated[Optional[str], typer.Option(help='Serial port when --transport serial is used.')] = None, baudrate: Annotated[int, typer.Option(help='Serial baudrate for FPGA JSON-lines transport.')] = FPGA_DEFAULT_BAUDRATE, timeout_seconds: Annotated[float, typer.Option(help='Serial timeout per event in seconds.')] = 1.5, stride: Annotated[int, typer.Option(help='Use every Nth results row when generating events.')] = 1, max_events: Annotated[Optional[int], typer.Option(help='Maximum replayed events. Use 0 for no limit.')] = 288) -> None
fpga_run(events: Annotated[Optional[Path], typer.Option(help='Optional JSON/CSV event file. Defaults to bundled FPGA demo events.')] = None, output_dir: Annotated[Path, typer.Option(help='Output directory for FPGA comparison artifacts.')] = Path('results/fpga_run'), transport: Annotated[str, typer.Option(help='FPGA transport: mock or serial.')] = 'mock', port: Annotated[Optional[str], typer.Option(help='Serial port when --transport serial is used.')] = None, baudrate: Annotated[int, typer.Option(help='Serial baudrate for FPGA JSON-lines transport.')] = FPGA_DEFAULT_BAUDRATE, timeout_seconds: Annotated[float, typer.Option(help='Serial timeout per event in seconds.')] = 1.5) -> None
fpga_compare(run_dir: Annotated[Path, typer.Option(help='FPGA run directory containing fpga_comparison.json.')]) -> None
fpga_report(run_dir: Annotated[Path, typer.Option(help='FPGA run directory containing fpga_report.md.')]) -> None
fpga_demo(output_dir: Annotated[Path, typer.Option(help='Output directory for the complete FPGA demo bundle.')] = Path('results/fpga_demo')) -> None
fpga_start(output_dir: Annotated[Path, typer.Option(help='Output directory for the guided FPGA quickstart bundle.')] = Path('results/fpga_start')) -> None
edge_pump_init(output_dir: Annotated[Path, typer.Option(help='Directory where the Pico pump lab workspace should be written.')] = Path('iints_pico_pump_lab'), algorithm: Annotated[Optional[Path], typer.Option(help='Optional existing SDK algorithm to copy into the lab workspace.')] = None) -> None
edge_pump_firmware(output_dir: Annotated[Path, typer.Option(help='Directory where locked Pico bench firmware should be written.')] = Path('pico_pump_firmware')) -> None
edge_pump_package(algorithm: Annotated[Path, typer.Option(help='SDK algorithm Python file to package for bench-only Pico testing.')], output_dir: Annotated[Path, typer.Option(help='Output bundle directory.')] = Path('pico_pump_bundle'), safety_contract: Annotated[Optional[Path], typer.Option(help='Optional zero-delivery safety contract JSON.')] = None, label: Annotated[str, typer.Option(help='Human-readable bundle label written into the manifest.')] = 'pico_pump_bench') -> None
edge_pump_upload(bundle_dir: Annotated[Path, typer.Option(help='Bundle directory fromiints edge pump package.')], mount_dir: Annotated[Path, typer.Option(help='Mounted writable Pico/CircuitPython-style drive or a test folder.')], bench_only_confirm: Annotated[str, typer.Option(help=f'Must be exactly: {PICO_PUMP_CONFIRMATION}')] = '', write: Annotated[bool, typer.Option('--write', help='Actually copy files. Without this flag, only prints the copy plan.')] = False) -> None
edge_pump_serial_test(port: Annotated[str, typer.Option(help='Serial port for the Pico bench firmware, for example /dev/ttyACM0 or /dev/tty.usbmodem*.')], baudrate: Annotated[int, typer.Option(help='Serial baud rate used by the Pico bench firmware.')] = PICO_PUMP_BAUDRATE, timeout_seconds: Annotated[float, typer.Option(help='Read timeout per command in seconds.')] = 1.5) -> None
pump_init(output_dir: Annotated[Path, typer.Option(help='Directory where the Pico pump lab workspace should be written.')] = Path('iints_pico_pump_lab'), algorithm: Annotated[Optional[Path], typer.Option(help='Optional existing SDK algorithm to copy into the lab workspace.')] = None) -> None
pump_compile(algorithm: Annotated[Path, typer.Option(help='SDK algorithm Python file to compile/package for bench-only Pico testing.')], output_dir: Annotated[Path, typer.Option(help='Output bundle directory.')] = Path('pico_pump_bundle'), safety_contract: Annotated[Optional[Path], typer.Option(help='Optional zero-delivery safety contract JSON.')] = None, label: Annotated[str, typer.Option(help='Human-readable bundle label written into the manifest.')] = 'pico_pump_bench') -> None
pump_bench_test(bundle_dir: Annotated[Path, typer.Option(help='Bundle directory fromiints pump compile.')], output_json: Annotated[Optional[Path], typer.Option(help='Optional JSON report path.')] = None, port: Annotated[Optional[str], typer.Option(help='Optional Pico serial port for an additional non-actuating smoke test.')] = None, baudrate: Annotated[int, typer.Option(help='Serial baud rate used by the Pico bench firmware.')] = PICO_PUMP_BAUDRATE, timeout_seconds: Annotated[float, typer.Option(help='Read timeout per serial command in seconds.')] = 1.5) -> None
pump_upload(bundle_dir: Annotated[Path, typer.Option(help='Bundle directory fromiints pump compile.')], mount_dir: Annotated[Path, typer.Option(help='Mounted writable Pico/CircuitPython-style drive or a test folder.')], bench_only_confirm: Annotated[str, typer.Option(help=f'Must be exactly: {PICO_PUMP_CONFIRMATION}')] = '', write: Annotated[bool, typer.Option('--write', help='Actually copy files. Without this flag, only prints the copy plan.')] = False) -> None
edge_bridge_test(port: Annotated[Optional[str], typer.Option(help='Serial port for the UNO Q STM32 side. Useautoor omit it if exactly one port is connected.')] = None, baudrate: Annotated[int, typer.Option(help='Serial baud rate used by the UNO Q bridge sketch.')] = UNO_Q_BRIDGE_BAUDRATE, delay_seconds: Annotated[float, typer.Option(help='Pause between test states in seconds.')] = 0.75) -> None
edge_bridge_run(port: Annotated[Optional[str], typer.Option(help='Serial port for the UNO Q STM32 side. Useautoor omit it if exactly one port is connected.')] = None, workspace: Annotated[Optional[Path], typer.Option(help='Workspace directory for the persistent digital patient state.')] = None, project_dir: Annotated[Optional[Path], typer.Option(help='Optional edge project directory created byiints edge setup.')] = None, workspace_name: Annotated[str, typer.Option(help='Workspace folder inside the edge project.')] = 'patient_runtime', baudrate: Annotated[int, typer.Option(help='Serial baud rate used by the UNO Q bridge sketch.')] = UNO_Q_BRIDGE_BAUDRATE, poll_interval: Annotated[float, typer.Option(help='Polling interval in seconds while following runtime status.')] = 1.0, once: Annotated[bool, typer.Option(help='Send the current state once and exit.')] = False, max_cycles: Annotated[Optional[int], typer.Option('--max-cycles', hidden=True)] = None) -> None
edge_bridge_flash(port: Annotated[str, typer.Option(help='Serial port used to upload the UNO Q bridge sketch.')], fqbn: Annotated[str, typer.Option(help='Arduino CLI FQBN for the UNO Q board package.')], project_dir: Annotated[Path, typer.Option(help='Edge project directory created byiints edge setup.')] = Path('.'), sketch_dir: Annotated[Optional[Path], typer.Option(help='Optional bridge sketch directory. Defaults to <project-dir>/uno_q_bridge.')] = None, arduino_cli: Annotated[str, typer.Option(help='Arduino CLI executable name or path.')] = 'arduino-cli') -> None
edge_benchmark_alias(algo: Annotated[Path, typer.Option(help='Path to the insulin algorithm Python file used for the edge benchmark.')], output_json: Annotated[Path, typer.Option(help='Output JSON path for the hardware benchmark results.')] = Path('results/edge_benchmark.json'), patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type.')] = 'auto', scenario_profile: Annotated[str, typer.Option(help='Digital patient scenario profile.')] = 'normal_day', steps: Annotated[int, typer.Option(help='Number of simulated steps used for throughput measurement.')] = 72, platform_name: Annotated[str, typer.Option('--platform', help="Platform label written into the benchmark report. Use 'auto' to detect locally.")] = 'auto', api_host: Annotated[str, typer.Option(help='Host used for the local dashboard probe.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Port used for the local dashboard probe.')] = 8766, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override.')] = None) -> None
render_molecules(target: Annotated[str, typer.Option('--target', help='The structural target to render (e.g. insulin-mutation, glucagon, glut4, insulin-receptor, or all)')] = 'all') -> None
render_pathways(network: Annotated[str, typer.Option('--network', help='The physiological network to render (e.g. insulin-cascade, glucagon-rescue, or all)')] = 'all') -> None
render_pae(target: Annotated[str, typer.Option('--target', help='The structural target to render the PAE matrix for (e.g. insulin-mutation, glucagon, glut4, insulin-receptor, or all)')] = 'all') -> None
simulate_mutation(gene: Annotated[str, typer.Option('--gene', help='The gene to simulate a mutation for (e.g. INSR or INS)')] = 'INSR') -> None
analyze_insulin(drug: Annotated[str, typer.Option('--drug', help='The insulin analog to analyze (e.g. lispro, glargine, regular)')] = 'lispro') -> None
render_expression(gene: Annotated[str, typer.Option('--gene', help='The gene to map anatomically (e.g. GLUT4 or GCGR)')] = 'GLUT4') -> None
safety_fda_list()
safety_fda_benchmark(output_dir: Annotated[Path, typer.Option('--output-dir', help='Output directory for FDA safety evaluation artifacts')] = Path('results/fda_safety_study'))
Public Constants
APP_HELP
IINTS_ASCII_LOGO
- Source:
src/iints/cli/menu.py
- Summary: Small, stable navigation helpers for the public CLI.
- Explicit exports:
COMMAND_DOMAINS, interactive_menu, show_command_map
Public Classes
| Class |
Signature |
Summary |
CommandDomain |
CommandDomain |
No module docstring. |
Public Functions
show_command_map(console: Optional[Console] = None) -> None
interactive_menu(console: Optional[Console] = None) -> None
Public Constants
iints.cli.patient_cli
- Source:
src/iints/cli/patient_cli.py
- Summary: No module docstring.
Public Functions
scenarios() -> None
start(algo: Annotated[Path, typer.Option(help='Path to the insulin algorithm Python file.')], patient_config: Annotated[str, typer.Option(help='Patient configuration name or YAML path.')] = 'default_patient', patient_model: Annotated[str, typer.Option('--patient-model', help='Patient model type: auto, bergman, custom, simglucose.')] = 'auto', scenario_profile: Annotated[str, typer.Option(help='Live day profile: school_day, normal_day, sport_day, bad_carb_count, night_hypo_risk, relaxed_day, expo_hot_start.')] = 'normal_day', workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime'), mode: Annotated[str, typer.Option(help='Clock mode: real-time or demo-time.')] = 'demo-time', speed: Annotated[str, typer.Option(help='Acceleration factor for demo-time mode. Accepts values like 60 or 60x.')] = '60x', api_host: Annotated[str, typer.Option(help='Host for the FastAPI dashboard service. Loopback is the safe default; non-loopback requires --allow-remote-api plus a token.')] = '127.0.0.1', api_port: Annotated[int, typer.Option(help='Port for the local FastAPI dashboard service.')] = 8765, allow_remote_api: Annotated[bool, typer.Option(help='Allow the dashboard API to listen on a non-loopback host. Use this only with --api-token-env, --api-token-file, or --api-token.')] = False, api_token: Annotated[Optional[str], typer.Option(help='Bearer token for dashboard and control access. Prefer --api-token-env or --api-token-file in shared environments.')] = None, api_token_env: Annotated[Optional[str], typer.Option(help='Environment variable name that stores the dashboard/control bearer token.')] = None, api_token_file: Annotated[Optional[Path], typer.Option(help='Path to a file containing the dashboard/control bearer token.')] = None, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic simulation seed.')] = None, foreground: Annotated[bool, typer.Option('--foreground', hidden=True)] = False, max_steps: Annotated[Optional[int], typer.Option('--max-steps', hidden=True)] = None, reset: Annotated[bool, typer.Option('--reset', hidden=True)] = False) -> None
status(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
inject_meal(carbs: Annotated[float, typer.Option(help='Carbohydrate amount to inject immediately into the live patient.')], workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
pause(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
resume(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
expo_reset(scenario_profile: Annotated[Optional[str], typer.Option(help='Optional profile to load after reset. Defaults to expo_hot_start.')] = None, seed: Annotated[Optional[int], typer.Option(help='Optional deterministic seed override for the reset profile.')] = None, workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
stop(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
export_service(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime'), output: Annotated[Optional[Path], typer.Option(help='Optional output service file path.')] = None, service_name: Annotated[str, typer.Option(help='systemd service name without the .service suffix.')] = 'iints-digital-patient', user_name: Annotated[Optional[str], typer.Option(help='Linux user that should run the service. Defaults to the current shell user.')] = None, python_path: Annotated[Optional[Path], typer.Option(help='Python executable used in ExecStart. Defaults to the current interpreter.')] = None) -> None
export_uno_bridge(output_dir: Annotated[Path, typer.Option(help='Directory where the UNO Q bridge scaffold should be written.')] = Path('./uno_q_bridge')) -> None
hardware_bridge(board: Annotated[str, typer.Option(help='Hardware bridge target. Currently supported: uno_q.')] = 'uno_q', output_dir: Annotated[Path, typer.Option(help='Directory where the hardware bridge scaffold should be written.')] = Path('./uno_q_bridge')) -> None
kiosk(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime')) -> None
review(workspace: Annotated[Path, typer.Option(help='Workspace directory for the persistent digital patient state.')] = Path('./digital_patient_runtime'), model: Annotated[str, typer.Option(help='Local Ollama model used for the realism review.')] = DEFAULT_MINISTRAL_MODEL, mdmp_cert: Annotated[Optional[Path], typer.Option(help='Optional MDMP certificate path. If omitted, the live bundle gets a local dev cert.')] = None, output: Annotated[Optional[Path], typer.Option(help='Optional output markdown file for the review.')] = None, ollama_host: Annotated[Optional[str], typer.Option(help='Optional Ollama base URL override.')] = None, minimum_grade: Annotated[str, typer.Option(help='Minimum MDMP grade required before review runs.')] = 'research_grade') -> None
iints.core
- Source:
src/iints/core/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.algorithms
- Source:
src/iints/core/algorithms/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.algorithms.battle_runner
- Source:
src/iints/core/algorithms/battle_runner.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
BattleRunner |
BattleRunner |
Runs a battle between different insulin algorithms. |
BattleRunner methods
run_battle(self, isf_override: Optional[float] = None, icr_override: Optional[float] = None) -> Tuple[Dict[str, Any], Dict[str, pd.DataFrame]]
print_battle_report(self, battle_report: Dict[str, Any])
iints.core.algorithms.clinical_baseline
- Source:
src/iints/core/algorithms/clinical_baseline.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ClinicalBaselineAlgorithm |
ClinicalBaselineAlgorithm(InsulinAlgorithm) |
Conservative clinician-style baseline. |
ClinicalBaselineAlgorithm methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.algorithms.correction_bolus
- Source:
src/iints/core/algorithms/correction_bolus.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
CorrectionBolus |
CorrectionBolus(InsulinAlgorithm) |
An insulin algorithm that calculates a meal bolus based on carbohydrates and adds a correction bolus if current glucose is above a target. |
CorrectionBolus methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.algorithms.discovery
- Source:
src/iints/core/algorithms/discovery.py
- Summary: No module docstring.
Public Functions
discover_algorithms() -> Dict[str, Type[InsulinAlgorithm]]
iints.core.algorithms.fixed_basal_bolus
- Source:
src/iints/core/algorithms/fixed_basal_bolus.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
FixedBasalBolus |
FixedBasalBolus(InsulinAlgorithm) |
A simple insulin algorithm that delivers a fixed basal rate and a meal bolus based on carbohydrate intake. |
FixedBasalBolus methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.algorithms.hybrid_algorithm
- Source:
src/iints/core/algorithms/hybrid_algorithm.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.algorithms.imitation_controller
- Source:
src/iints/core/algorithms/imitation_controller.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ExperimentalImitationController |
ExperimentalImitationController(InsulinAlgorithm) |
Research-only local policy that imitates previously supervised insulin actions. |
ExperimentalImitationController methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.algorithms.lstm_algorithm
- Source:
src/iints/core/algorithms/lstm_algorithm.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.algorithms.mock_algorithms
- Source:
src/iints/core/algorithms/mock_algorithms.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ConstantDoseAlgorithm |
ConstantDoseAlgorithm(InsulinAlgorithm) |
Always returns a fixed insulin dose for CI and smoke testing. |
RandomDoseAlgorithm |
RandomDoseAlgorithm(InsulinAlgorithm) |
Returns a random dose within a safe range for stochastic testing. |
RunawayAIAlgorithm |
RunawayAIAlgorithm(InsulinAlgorithm) |
Delivers a maximal bolus during glucose decline to stress-test supervisor. |
StackingAIAlgorithm |
StackingAIAlgorithm(InsulinAlgorithm) |
Delivers repeated boluses over consecutive steps to simulate stacking. |
ConstantDoseAlgorithm methods
get_algorithm_metadata(self) -> AlgorithmMetadata
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
RandomDoseAlgorithm methods
get_algorithm_metadata(self) -> AlgorithmMetadata
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
RunawayAIAlgorithm methods
get_algorithm_metadata(self) -> AlgorithmMetadata
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
StackingAIAlgorithm methods
get_algorithm_metadata(self) -> AlgorithmMetadata
reset(self) -> None
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.algorithms.mpc_controller
- Source:
src/iints/core/algorithms/mpc_controller.py
- Summary: Model Predictive Controller (MPC) — IINTS-AF ============================================= Uses an internal ODE model (Bergman Minimal Model) to predict glucose trajectory and scipy.optimize to calculate the mathematically optimal insulin dose that minimizes glucose deviation from target.
Public Classes
| Class |
Signature |
Summary |
MPCController |
MPCController(InsulinAlgorithm) |
Research nonlinear MPC prototype using an adapted Bergman model. |
MPCController methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
reset(self) -> None
get_algorithm_info(self) -> Dict[str, Any]
iints.core.algorithms.neural_controller
- Source:
src/iints/core/algorithms/neural_controller.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ExperimentalNeuralController |
ExperimentalNeuralController(InsulinAlgorithm) |
Research-only PyTorch policy trained from safety-supervised teacher actions. |
ExperimentalNeuralController methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.algorithms.pid_controller
- Source:
src/iints/core/algorithms/pid_controller.py
- Summary: Industry-Standard PID Controller - IINTS-AF Simple PID implementation for algorithm comparison
Public Classes
| Class |
Signature |
Summary |
PIDController |
PIDController(InsulinAlgorithm) |
Industry-standard PID controller for glucose management |
PIDController methods
predict_insulin(self, data: AlgorithmInput)
reset(self)
get_algorithm_info(self)
iints.core.algorithms.standard_pump_algo
- Source:
src/iints/core/algorithms/standard_pump_algo.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StandardPumpAlgorithm |
StandardPumpAlgorithm(InsulinAlgorithm) |
A simplified algorithm representing a standard insulin pump. It delivers a fixed basal rate and a simple bolus based on carbs, with minimal correction for high glucose. |
StandardPumpAlgorithm methods
predict_insulin(self, data: AlgorithmInput) -> Dict[str, Any]
iints.core.clinical_metrics
- Source:
src/iints/core/clinical_metrics.py
- Summary: Core Clinical Metrics - IINTS-AF Dependency-light clinical metrics shared by core, data, validation, and reports.
Public Classes
| Class |
Signature |
Summary |
ClinicalMetricsResult |
ClinicalMetricsResult |
Comprehensive clinical metrics result |
ClinicalMetricsCalculator |
ClinicalMetricsCalculator |
Calculate standard clinical metrics for diabetes management. |
ClinicalMetricsResult methods
to_dict(self) -> Dict
get_summary(self) -> str
get_rating(self) -> str
ClinicalMetricsCalculator methods
calculate_tir(self, glucose: pd.Series, low: float, high: float) -> float
calculate_all_tir_metrics(self, glucose: pd.Series) -> Dict[str, float]
calculate_gmi(self, glucose: pd.Series) -> float
calculate_cv(self, glucose: pd.Series) -> float
calculate_hypoglycemia_index(self, glucose: pd.Series, timestamp: Optional[pd.Series] = None) -> float
calculate_hypo_severity_score(self, glucose: pd.Series, timestamp: Optional[pd.Series] = None) -> float
calculate_lbgi(self, glucose: pd.Series) -> float
calculate_hbgi(self, glucose: pd.Series) -> float
calculate_readings_per_day(self, glucose: pd.Series, duration_hours: float) -> float
calculate_data_coverage(self, glucose: pd.Series, expected_interval_minutes: int = 5, duration_hours: float = 24, timestamp: Optional[pd.Series] = None) -> float
calculate(self, glucose: pd.Series, timestamp: Optional[pd.Series] = None, duration_hours: Optional[float] = None) -> ClinicalMetricsResult
compare_metrics(self, metrics1: ClinicalMetricsResult, metrics2: ClinicalMetricsResult) -> Dict[str, Tuple[float, str]]
Public Functions
iints.core.device
- Source:
src/iints/core/device.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.device_manager
- Source:
src/iints/core/device_manager.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DeviceManager |
DeviceManager |
Manages hardware device detection for cross-platform compatibility. Detects MPS (Apple Silicon), CUDA (NVIDIA GPUs), or falls back to CPU. |
DeviceManager methods
iints.core.devices
- Source:
src/iints/core/devices/__init__.py
- Summary: No module docstring.
- Explicit exports:
SensorModel, PumpModel, SENSOR_PROFILES, create_sensor_model
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.devices.models
- Source:
src/iints/core/devices/models.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SensorReading |
SensorReading |
No module docstring. |
SensorModel |
SensorModel |
Sensor error model for CGM readings. |
PumpDelivery |
PumpDelivery |
No module docstring. |
PumpModel |
PumpModel |
Pump error model for insulin delivery. |
SensorModel methods
reset(self) -> None
read(self, true_glucose: float, current_time: float) -> SensorReading
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
PumpModel methods
reset(self) -> None
deliver(self, requested_units: float, time_step_minutes: float) -> PumpDelivery
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
Public Functions
create_sensor_model(*, profile: str = 'clinical_cgm', seed: Optional[int] = None, **overrides: Any) -> SensorModel
Public Constants
iints.core.digital_twin
- Source:
src/iints/core/digital_twin.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DigitalTwinCalibrator |
DigitalTwinCalibrator |
Research parameter-calibration engine for a Hovorka simulation profile. |
DigitalTwinCalibrator methods
fit(self, history: List[Dict[str, Any]]) -> HovorkaParameters
export_profile(self, filepath: str) -> None
- Source:
src/iints/core/formula_registry.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
FormulaSpec |
FormulaSpec |
Immutable description of a formula used by the SDK. |
to_dict(self) -> dict[str, object]
Public Functions
get_formula_registry() -> tuple[FormulaSpec, ...]
get_formula(formula_id: str) -> FormulaSpec
formula_registry_dict() -> dict[str, object]
formula_context_for_ai() -> dict[str, object]
formula_registry_markdown() -> str
Public Constants
FORMULAS
FORMULA_REGISTRY_VERSION
iints.core.glycemic_risk
- Source:
src/iints/core/glycemic_risk.py
- Summary: Canonical blood-glucose risk-space transforms (Kovatchev symmetrization).
- Explicit exports:
RISK_SCALE, RISK_EXPONENT, RISK_OFFSET, RISK_AMPLITUDE, EUGLYCEMIC_CENTER_MGDL, bg_risk_transform, bg_risk, lbgi, hbgi, bgri, lbgi_risk_category
Public Functions
bg_risk_transform(glucose: GlucoseLike) -> np.ndarray
bg_risk(glucose: GlucoseLike) -> np.ndarray
lbgi(glucose: GlucoseLike) -> float
hbgi(glucose: GlucoseLike) -> float
bgri(glucose: GlucoseLike) -> float
lbgi_risk_category(value: float) -> str
Public Constants
EUGLYCEMIC_CENTER_MGDL
RISK_AMPLITUDE
RISK_EXPONENT
RISK_OFFSET
RISK_SCALE
iints.core.patient
- Source:
src/iints/core/patient/__init__.py
- Summary: No module docstring.
- Explicit exports:
PatientProfile, PatientModel, BergmanPatientModel, AdvancedMetabolicModel
No public classes, functions, or all-caps constants are declared directly in this module.
- Source:
src/iints/core/patient/advanced_metabolic_model.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
AdvancedMetabolicModel |
AdvancedMetabolicModel(BergmanPatientModel) |
Advanced Metabolic Model for IINTS-AF. Extends the Bergman-compatible base state to an 18-state model including: - F: Free Fatty Acids (FFA) (mmol/L) - K: Ketone Bodies (mmol/L) - Beta: Residual Beta-cell mass fraction (0.0 to 1.0) - Q_fat: Fat stomach pool (grams) - Q_prot: Protein stomach pool (grams) |
reset(self) -> None
get_patient_state(self) -> Dict[str, float]
set_state(self, state: Dict[str, Any]) -> None
update(self, time_step: float = 0.0, delivered_insulin: float = 0.0, carb_intake: float = 0.0, delivered_glucagon_mg: float = 0.0, current_time: Optional[float] = None, **kwargs: Any) -> float
start_illness(self, severity: float) -> None
stop_illness(self) -> None
start_menstrual_cycle(self, current_time_minutes: float = 0.0) -> None
stop_menstrual_cycle(self) -> None
trigger_event(self, event_type: str, value: Any) -> None
get_state(self) -> Dict[str, Any]
iints.core.patient.bergman_model
- Source:
src/iints/core/patient/bergman_model.py
- Summary: Bergman Minimal Model — IINTS-AF ================================== ODE-based patient model inspired by the Bergman Minimal Model with an adapted gut absorption chain for delayed carbohydrate appearance.
Public Classes
| Class |
Signature |
Summary |
BergmanParameters |
BergmanParameters |
Physiological parameters for the Bergman Minimal Model. |
BergmanPatientModel |
BergmanPatientModel |
ODE-based patient model providing the same interface as CustomPatientModel for drop-in use with the IINTS Simulator. |
BergmanPatientModel methods
reset(self) -> None
start_exercise(self, intensity: float) -> None
stop_exercise(self) -> None
start_stress(self, intensity: float) -> None
stop_stress(self) -> None
update(self, time_step: float, delivered_insulin: float, carb_intake: float = 0.0, delivered_glucagon_mg: float = 0.0, current_time: Optional[float] = None, **kwargs) -> float
get_current_glucose(self) -> float
trigger_event(self, event_type: str, value: Any) -> None
get_patient_state(self) -> Dict[str, float]
get_ratio_state(self) -> Dict[str, float]
set_ratio_state(self, isf: Optional[float] = None, icr: Optional[float] = None, basal_rate: Optional[float] = None, dia_minutes: Optional[float] = None) -> None
describe_compartments(self) -> Dict[str, Any]
get_compartment_state(self) -> Dict[str, float]
flux_snapshot(self, insulin_rate_mu_per_min: Optional[float] = None, glucagon_rate_pg_per_min: Optional[float] = None, current_time: Optional[float] = None) -> Dict[str, float]
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
iints.core.patient.compartments
- Source:
src/iints/core/patient/compartments.py
- Summary: Compartment and flux schema for the IINTS patient models.
- Explicit exports:
Compartment, Flux, HOVORKA_COMPARTMENTS, HOVORKA_FLUXES, BERGMAN_COMPARTMENTS, MODEL_SCHEMAS, compartment_schema, schema_for_model
Public Classes
| Class |
Signature |
Summary |
Compartment |
Compartment |
One state variable of a patient ODE. |
Flux |
Flux |
One transfer term between compartments, or in/out of the patient. |
Compartment methods
is_physical_content(self) -> bool
Public Functions
compartment_schema(model_key: str) -> Dict[str, Any]
schema_for_model(model: Any) -> Optional[Dict[str, Any]]
Public Constants
BERGMAN_COMPARTMENTS
BERGMAN_FLUXES
HOVORKA_COMPARTMENTS
HOVORKA_FLUXES
MODEL_SCHEMAS
iints.core.patient.hovorka_model
- Source:
src/iints/core/patient/hovorka_model.py
- Summary: Adapted Hovorka Research Model - IINTS-AF ========================================== Based on published Hovorka artificial-pancreas equations and extended with explicit research stressors to match the IINTS simulator interface. The extensions are not part of the canonical Hovorka model and are not clinically validated patient physiology.
Public Classes
| Class |
Signature |
Summary |
HovorkaParameters |
HovorkaParameters |
Physiological parameters for the Hovorka Model. |
HovorkaPatientModel |
HovorkaPatientModel |
No module docstring. |
HovorkaPatientModel methods
reset(self) -> None
start_exercise(self, intensity: float) -> None
stop_exercise(self) -> None
start_stress(self, intensity: float) -> None
stop_stress(self) -> None
update(self, time_step: float, delivered_insulin: float, carb_intake: float = 0.0, delivered_glucagon_mg: float = 0.0, current_time: Optional[float] = None, **kwargs) -> float
get_current_glucose(self) -> float
trigger_event(self, event_type: str, value: Any) -> None
get_patient_state(self) -> Dict[str, float]
get_ratio_state(self) -> Dict[str, float]
set_ratio_state(self, isf: Optional[float] = None, icr: Optional[float] = None, basal_rate: Optional[float] = None, dia_minutes: Optional[float] = None) -> None
describe_compartments(self) -> Dict[str, Any]
get_compartment_state(self) -> Dict[str, float]
flux_snapshot(self, insulin_rate_mu_per_min: Optional[float] = None, glucagon_rate_pg_per_min: Optional[float] = None, current_time: Optional[float] = None) -> Dict[str, float]
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
iints.core.patient.models
- Source:
src/iints/core/patient/models.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PatientModelDomainError |
PatientModelDomainError(RuntimeError) |
The model left its declared numerical/physiological validity domain. |
CustomPatientModel |
CustomPatientModel |
A simplified patient model for simulating blood glucose dynamics. This model is intended for educational and stress-testing purposes, not for clinical accuracy. |
CustomPatientModel methods
reset(self)
start_exercise(self, intensity: float)
stop_exercise(self)
start_stress(self, intensity: float)
stop_stress(self)
update(self, time_step: float, delivered_insulin: float, carb_intake: float = 0.0, current_time: Optional[float] = None, **kwargs) -> float
get_current_glucose(self) -> float
trigger_event(self, event_type: str, value: Any)
get_patient_state(self) -> Dict[str, float]
get_ratio_state(self) -> Dict[str, float]
set_ratio_state(self, isf: Optional[float] = None, icr: Optional[float] = None, basal_rate: Optional[float] = None, dia_minutes: Optional[float] = None) -> None
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
iints.core.patient.patient_factory
- Source:
src/iints/core/patient/patient_factory.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PatientFactory |
PatientFactory |
Factory for creating different types of patient models. |
SimglucosePatientWrapper |
SimglucosePatientWrapper |
Wrapper for simglucose patients to match CustomPatientModel interface. |
PatientFactory methods
create_patient(patient_type = 'auto', patient_id = None, initial_glucose = 120.0, **kwargs)
get_patient_diversity_set()
SimglucosePatientWrapper methods
reset(self)
get_current_glucose(self)
update(self, time_step, delivered_insulin, carb_intake = 0.0, **kwargs)
insulin_on_board(self)
carbs_on_board(self)
trigger_event(self, event_type, value)
get_patient_state(self)
get_ratio_state(self) -> Dict[str, float]
set_ratio_state(self, isf: Optional[float] = None, icr: Optional[float] = None, basal_rate: Optional[float] = None, dia_minutes: Optional[float] = None) -> None
iints.core.patient.physiology
- Source:
src/iints/core/patient/physiology.py
- Summary: Reusable physiology math helpers for patient models.
Public Functions
validated_snapshot_scalar(value: Any, *, name: str, minimum: float | None = None, maximum: float | None = None) -> float
validated_snapshot_bool(value: Any, *, name: str) -> bool
validated_activity_events(value: Any, *, name: str, age_key: str) -> list[dict[str, float]]
glucagon_mg_to_pg(dose_mg: float) -> float
dawn_window_fraction(current_time_minutes: float, *, start_hour: float, end_hour: float) -> float
dawn_glucose_rate_mgdl_min(current_time_minutes: float, *, peak_strength_mgdl_per_hour: float, start_hour: float, end_hour: float) -> float
dawn_insulin_sensitivity_multiplier(current_time_minutes: float, *, peak_resistance_fraction: float, start_hour: float, end_hour: float) -> float
antecedent_hypoglycemia_memory_derivative(glucose_mgdl: float, memory: float, *, awareness_threshold_mgdl: float = 70.0, severe_threshold_mgdl: float = 54.0, build_time_constant_minutes: float = 360.0, recovery_time_constant_minutes: float = 4320.0) -> float
counterregulatory_rescue_multiplier(glucose_mgdl: float, memory: float, *, threshold_mgdl: float = 70.0, half_activation_mgdl: float = 16.0, maximum_fractional_increase: float = 1.0) -> float
smooth_threshold_excess(value: float, *, threshold: float, splay: float = 10.0) -> float
renal_glucose_clearance_concentration(glucose_mgdl: float, *, threshold_mgdl: float = 180.0, gain: float = 0.05, splay_mgdl: float = 10.0) -> float
Public Constants
iints.core.patient.profile
- Source:
src/iints/core/patient/profile.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PatientProfile |
PatientProfile |
User-facing patient profile that maps to the simulator config. |
PatientProfilePreset |
PatientProfilePreset |
Named starter profile with a concise purpose statement. |
PatientProfile methods
to_patient_config(self) -> Dict[str, Any]
PatientProfilePreset methods
build_profile(self) -> PatientProfile
Public Functions
get_patient_profile_preset(name: str) -> PatientProfilePreset
Public Constants
iints.core.physiology_variation
- Source:
src/iints/core/physiology_variation.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
EmpiricalResidualProfile |
EmpiricalResidualProfile |
No module docstring. |
EmpiricalResidualModel |
EmpiricalResidualModel |
Small additive model-discrepancy layer sampled from real CGM day residuals. |
EmpiricalResidualProfile methods
from_dict(cls, payload: dict[str, Any]) -> 'EmpiricalResidualProfile'
EmpiricalResidualModel methods
from_profile_id(cls, profile_id: str, *, seed: int | None = None, scale: float = 1.0, max_residual_rate_mgdl_per_min: float | None = 0.75) -> 'EmpiricalResidualModel'
reset(self) -> None
offset_at(self, current_time_minutes: float) -> float
get_state(self) -> dict[str, Any]
set_state(self, state: dict[str, Any]) -> None
Public Functions
load_empirical_residual_profiles() -> list[EmpiricalResidualProfile]
get_empirical_residual_profile(profile_id: str) -> EmpiricalResidualProfile
iints.core.safety
- Source:
src/iints/core/safety/__init__.py
- Summary: No module docstring.
- Explicit exports:
SafetyConfig, SafetySupervisor, InputValidator
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.safety.config
- Source:
src/iints/core/safety/config.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SafetyConfig |
SafetyConfig |
Central safety configuration for simulator, input validation, and supervisor. |
SafetyConfig methods
to_versioned_dict(self) -> dict[str, Any]
fingerprint_sha256(self) -> str
Public Constants
CONTROLLER_FALLING_TREND_GUARD_MGDL_MIN
CONTROLLER_HIGH_IOB_GUARD_UNITS
CONTROLLER_HYPO_GUARD_MGDL
ML_MAX_INSULIN_CANDIDATE_PER_STEP_UNITS
SAFETY_FORMULA_VERSION
SENSOR_FAIL_SOFT_MAX_FOLLOW_PER_5_MIN_MGDL
SENSOR_GLUCOSE_MAX_MGDL
SENSOR_GLUCOSE_MIN_MGDL
SENSOR_MAX_GLUCOSE_DELTA_PER_5_MIN_MGDL
SENSOR_MAX_GLUCOSE_RATE_PER_MIN_MGDL
SIMULATION_GLUCOSE_CEILING_MGDL
SIMULATION_GLUCOSE_FLOOR_MGDL
- Source:
src/iints/core/safety/input_validator.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
InputValidator |
InputValidator |
A biological validation filter for sensor inputs to ensure they are physiologically plausible before being used by an algorithm. This component makes the system robust against common sensor errors. |
reset(self) -> None
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
validate_glucose(self, glucose_value: float, current_time: float) -> float
validate_insulin(self, dose: float) -> float
iints.core.safety.supervisor
- Source:
src/iints/core/safety/supervisor.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
IndependentSupervisor |
IndependentSupervisor(FullSupervisor) |
Safety supervisor that operates independently to validate insulin delivery. |
IndependentSupervisor methods
validate_insulin_dose(self, proposed_dose: float, current_glucose: float, active_insulin: float, time_since_last_dose: float) -> float
iints.core.simulation
- Source:
src/iints/core/simulation/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.core.simulation.scenario_parser
- Source:
src/iints/core/simulation/scenario_parser.py
- Summary: No module docstring.
Public Functions
parse_scenario(file_path: str) -> Tuple[Dict[str, Any], List[StressEvent]]
iints.core.simulator
- Source:
src/iints/core/simulator.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SimulationLimitError |
SimulationLimitError(RuntimeError) |
Raised when a simulation violates critical safety limits. |
StressEvent |
StressEvent |
Represents a discrete event that can occur during a simulation for stress testing. |
Simulator |
Simulator |
Orchestrates the interaction between a patient model and an insulin algorithm over a simulated period, including stress-test scenarios. |
Simulator methods
add_stress_event(self, event: StressEvent) -> None
run(self, duration_minutes: int) -> Tuple[pd.DataFrame, Dict[str, Any]]
run_batch(self, duration_minutes: int, step_callback: Optional[Callable[[int, int, float], None]] = None) -> Tuple[pd.DataFrame, Dict[str, Any]]
export_audit_trail(self, simulation_results_df: pd.DataFrame, output_dir: str) -> Dict[str, str]
run_live(self, duration_minutes: int) -> Generator[Dict[str, Any], None, None]
save_state(self) -> Dict[str, Any]
load_state(self, state: Dict[str, Any]) -> None
iints.core.supervisor
- Source:
src/iints/core/supervisor.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SafetyLevel |
SafetyLevel(Enum) |
No module docstring. |
SafetyViolation |
SafetyViolation |
No module docstring. |
SafetyDecision |
SafetyDecision |
No module docstring. |
IndependentSupervisor |
IndependentSupervisor |
Independent safety supervisor that operates separately from algorithms. Implements hard safety limits and emergency overrides. |
IndependentSupervisor methods
evaluate_safety(self, current_glucose: float, proposed_insulin: float, current_time: float, current_iob: float = 0.0, predicted_glucose_30min: Optional[float] = None, basal_insulin_units: Optional[float] = None, basal_limit_units: Optional[float] = None, meal_bolus_units: Optional[float] = None) -> Dict[str, Any]
get_safety_report(self) -> Dict[str, Any]
reset(self) -> None
get_state(self) -> Dict[str, Any]
set_state(self, state: Dict[str, Any]) -> None
iints.core.units
- Source:
src/iints/core/units.py
- Summary: Small runtime unit contracts for safety-relevant numeric boundaries.
Public Functions
finite_value(value: Any, *, name: str, unit: str) -> float
nonnegative_value(value: Any, *, name: str, unit: str) -> float
bounded_value(value: Any, *, name: str, unit: str, minimum: float, maximum: float) -> float
iints.data
- Source:
src/iints/data/__init__.py
- Summary: IINTS-AF Data Module Universal data ingestion and quality validation.
- Explicit exports:
DataAdapter, ColumnMapper, ColumnMapping, ImportResult, export_demo_csv, export_standard_csv, guess_column_mapping, import_carelink_csv, import_carelink_timeline, import_cgm_csv, import_cgm_dataframe, load_carelink_event_log, load_demo_dataframe, scenario_from_csv, scenario_from_dataframe, summarize_carelink_csv, DataQualityChecker, QualityReport, DataGap, DataAnomaly, REALISM_VERDICT_ORDER, MealResponse, RealismCheck, RealismReport, realism_verdict_meets_minimum, validate_realism_csv, validate_realism_dataset, write_realism_report, RealDataGateProfile, RealDataGateResult, STRICT_REAL_DATA_RESEARCH_PROFILE, review_real_data_realism, rank_real_data_sources, ReferenceBand, ReferenceComparison, RealismReferenceProfile, get_realism_reference, list_realism_reference_ids, load_realism_reference_registry, build_realism_dashboard_html, write_realism_dashboard, certify_csv, certify_dataset, certification_payload, create_mdmp_certificate_payload, load_standard_diabetes_contract, render_certification_dashboard, sign_mdmp_certificate_payload, standard_diabetes_contract_path, write_mdmp_certificate, write_certification_dashboard, write_certification_report, write_standard_diabetes_contract, AVAILABLE_STUDY_CORRUPTIONS, apply_study_corruptions, write_corrupted_study_csv, UniversalParser, StandardDataPack, ParseResult, load_dataset_registry, get_dataset, list_dataset_ids, fetch_dataset, DEFAULT_RESEARCH_DATASET_IDS, build_research_dataset_matrix, resolve_research_dataset_entries, write_research_dataset_plan, NightscoutConfig, import_nightscout, TidepoolClient, TidepoolConfig, fetch_tidepool_dataframe, import_tidepool, load_openapi_spec, MedtronicLiveClient, MedtronicLiveConfig, fetch_medtronic_live_dataframe, fetch_medtronic_live_timeline, import_medtronic_live, normalize_medtronic_live_payload, StreamSpec, FeatureSpec, LabelSpec, ValidationSpec, ProcessSpec, ModelReadyContract, compile_contract, parse_contract, load_contract_yaml, ContractRunner, ValidationResult, CheckResult, MDMP_PROTOCOL_VERSION, MDMP_GRADE_ORDER, MDMP_GRADE_DEFINITIONS, classify_mdmp_grade, mdmp_grade_meets_minimum, dataframe_fingerprint, build_mdmp_dashboard_html, mdmp_gate, MDMPGateError, generate_synthetic_mirror, SyntheticMirrorArtifact, CGMacrosSubjectBio, CGMacrosMealEvent, CGMacrosImportResult, parse_cgmacros_bio, parse_cgmacros_subject_timeseries, extract_cgmacros_meal_episodes, import_cgmacros_dataset, download_or_generate_cgmacros, fetch_and_import_cgmacros_pipeline
No public classes, functions, or all-caps constants are declared directly in this module.
iints.data.adapter
- Source:
src/iints/data/adapter.py
- Summary: IINTS-AF Universal Data Adapter Professional data import layer with schema validation
Public Classes
| Class |
Signature |
Summary |
DataAdapter |
DataAdapter |
Universal data adapter for IINTS-AF framework |
DataAdapter methods
load_data_pack(self, pack_name: str) -> Dict
load_ohio_dataset(self, patient_id: str) -> pd.DataFrame
get_available_ohio_patients(self) -> List[str]
clinical_benchmark_comparison(self, patient_id: str, algorithms: List[str], evaluated_outputs: Optional[Dict[str, Union[pd.DataFrame, str, Path]]] = None) -> Dict[str, Any]
Public Functions
iints.data.certify
- Source:
src/iints/data/certify.py
- Summary: No module docstring.
Public Functions
standard_diabetes_contract_path() -> Path
load_standard_diabetes_contract() -> Any
write_standard_diabetes_contract(output_path: str | Path) -> Path
certify_dataset(contract: Any | str | Path, dataframe: pd.DataFrame, *, apply_builtin_transforms: bool = True) -> MDMPValidationResult
certify_csv(contract_path: str | Path, input_csv: str | Path, *, apply_builtin_transforms: bool = True, quick: bool = False, quick_rows: int = 5000) -> MDMPValidationResult
certification_payload(report: Mapping[str, Any] | MDMPValidationResult, *, quick: bool = False, quick_rows: int | None = None, input_path: str | Path | None = None) -> dict[str, Any]
create_mdmp_certificate_payload(report: Mapping[str, Any] | MDMPValidationResult, *, issued_by: str = 'IINTS-AF Local MDMP', certificate_id: str | None = None) -> dict[str, Any]
sign_mdmp_certificate_payload(certificate: Mapping[str, Any], *, signing_key: str | Path, signed_by: str = 'IINTS-AF Local MDMP', key_id: str = 'iints_local_mdmp_v1', passphrase: str | bytes | None = None) -> dict[str, Any]
write_mdmp_certificate(report: Mapping[str, Any] | MDMPValidationResult, output_path: str | Path, *, issued_by: str = 'IINTS-AF Local MDMP', signing_key: str | Path | None = None, key_id: str = 'iints_local_mdmp_v1', passphrase_env: str | None = None) -> Path
render_certification_dashboard(report: Mapping[str, Any] | MDMPValidationResult, *, title: str = 'IINTS Data Certification Dashboard') -> str
write_certification_report(report: Mapping[str, Any] | MDMPValidationResult, output_path: str | Path) -> Path
write_certification_dashboard(report: Mapping[str, Any] | MDMPValidationResult, output_path: str | Path, *, title: str = 'IINTS Data Certification Dashboard') -> Path
Public Constants
STANDARD_DIABETES_CONTRACT
iints.data.cgmacros
- Source:
src/iints/data/cgmacros.py
- Summary: No module docstring.
- Explicit exports:
CGMacrosSubjectBio, CGMacrosMealEvent, CGMacrosImportResult, parse_cgmacros_bio, parse_cgmacros_subject_timeseries, extract_cgmacros_meal_episodes, import_cgmacros_dataset
Public Classes
| Class |
Signature |
Summary |
CGMacrosSubjectBio |
CGMacrosSubjectBio |
Demographics, anthropometrics, and blood biomarkers for one CGMacros participant. |
CGMacrosMealEvent |
CGMacrosMealEvent |
One quantified meal event with exact macronutrient composition. |
CGMacrosImportResult |
CGMacrosImportResult |
Summary of the standardized CGMacros dataset ingestion. |
CGMacrosSubjectBio methods
to_dict(self) -> dict[str, Any]
CGMacrosMealEvent methods
to_dict(self) -> dict[str, Any]
Public Functions
parse_cgmacros_bio(bio_path: Path | str) -> dict[str, CGMacrosSubjectBio]
parse_cgmacros_subject_timeseries(file_path: Path | str, subject_id: str | None = None) -> pd.DataFrame
extract_cgmacros_meal_episodes(timeseries_df: pd.DataFrame, min_carbs_g: float = 5.0, horizon_minutes: int = 120, step_minutes: int = 5) -> list[CGMacrosMealEvent]
import_cgmacros_dataset(data_dir: Path | str, output_dir: Path | str, *, bio_filename: str = 'bio.csv') -> CGMacrosImportResult
iints.data.cgmacros_downloader
- Source:
src/iints/data/cgmacros_downloader.py
- Summary: No module docstring.
- Explicit exports:
download_or_generate_cgmacros, fetch_and_import_cgmacros_pipeline
Public Functions
download_or_generate_cgmacros(destination_dir: Path | str, participant_count: int = 45, force_download: bool = False) -> Path
fetch_and_import_cgmacros_pipeline(raw_dir: Path | str = 'data/raw_cgmacros', processed_dir: Path | str = 'data/processed_cgmacros', participant_count: int = 45) -> CGMacrosImportResult
Public Constants
BENCHMARK_PARTICIPANTS_META
CGMACROS_GITHUB_BASE_URL
iints.data.column_mapper
- Source:
src/iints/data/column_mapper.py
- Summary: Column Mapper - IINTS-AF Maps various column names to standard IINTS format
Public Classes
| Class |
Signature |
Summary |
ColumnMapping |
ColumnMapping |
Result of column mapping operation |
ColumnMapper |
ColumnMapper |
Maps various column name aliases to standard IINTS format. |
ColumnMapper methods
detect_source(self, columns: List[str]) -> Optional[str]
normalize_column_name(self, column_name: str) -> str
find_standard_mapping(self, column_name: str) -> Optional[str]
map_columns(self, columns: List[str]) -> ColumnMapping
apply_mapping(self, df, mapping: ColumnMapping) -> 'pd.DataFrame'
get_recommended_parser(self, source: str) -> str
get_source_info(self, source: str) -> Dict
Public Functions
iints.data.contracts
- Source:
src/iints/data/contracts.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StreamSpec |
StreamSpec |
No module docstring. |
FeatureSpec |
FeatureSpec |
No module docstring. |
LabelSpec |
LabelSpec |
No module docstring. |
ValidationSpec |
ValidationSpec |
No module docstring. |
ProcessSpec |
ProcessSpec |
No module docstring. |
ModelReadyContract |
ModelReadyContract |
No module docstring. |
StreamSpec methods
to_dict(self) -> Dict[str, Any]
FeatureSpec methods
to_dict(self) -> Dict[str, Any]
LabelSpec methods
to_dict(self) -> Dict[str, Any]
ValidationSpec methods
to_dict(self) -> Dict[str, Any]
ProcessSpec methods
to_dict(self) -> Dict[str, Any]
ModelReadyContract methods
to_dict(self) -> Dict[str, Any]
fingerprint(self) -> str
Public Functions
canonicalize_contract(payload: Dict[str, Any]) -> str
compile_contract(payload: Dict[str, Any]) -> Dict[str, Any]
parse_contract(payload: Dict[str, Any]) -> ModelReadyContract
load_contract_yaml(path: Path) -> ModelReadyContract
iints.data.demo
- Source:
src/iints/data/demo/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.data.evidence
- Source:
src/iints/data/evidence.py
- Summary: No module docstring.
Public Functions
rank_real_data_sources() -> List[Dict[str, Any]]
Public Constants
CONTROLLED_ACCESS_MARKERS
OPEN_ACCESS_MARKERS
iints.data.guardians
- Source:
src/iints/data/guardians.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
MDMPGateError |
MDMPGateError(RuntimeError) |
No module docstring. |
Public Functions
mdmp_gate(contract: ContractInput, *, min_grade: str = 'research_grade', fail_mode: GateFailMode = 'raise', dataframe_arg: Optional[str] = None, apply_builtin_transforms: bool = True, transform_hooks: Optional[Iterable[Callable[[pd.DataFrame], pd.DataFrame]]] = None, on_result: Optional[Callable[[ValidationResult], None]] = None) -> Callable[[Callable[..., Any]], Callable[..., Any]]
Public Constants
iints.data.importer
- Source:
src/iints/data/importer.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ImportResult |
ImportResult |
No module docstring. |
Public Functions
summarize_carelink_csv(path: Union[str, Path]) -> Dict[str, Any]
load_carelink_event_log(path: Union[str, Path]) -> tuple[pd.DataFrame, Dict[str, Any]]
import_carelink_timeline(path: Union[str, Path], *, source: Optional[str] = None, event_tolerance_minutes: float = 7.5) -> pd.DataFrame
import_carelink_csv(path: Union[str, Path], *, source: Optional[str] = None, event_tolerance_minutes: float = 7.5) -> pd.DataFrame
guess_column_mapping(columns: Iterable[str], data_format: str = 'generic') -> Dict[str, Optional[str]]
validate_import_schema(columns: Iterable[str], data_format: str, column_map: Optional[Dict[str, str]] = None) -> None
import_cgm_dataframe(df: pd.DataFrame, data_format: str = 'generic', column_map: Optional[Dict[str, str]] = None, time_unit: str = 'minutes', source: Optional[str] = None) -> pd.DataFrame
import_cgm_csv(path: Union[str, Path], data_format: str = 'generic', column_map: Optional[Dict[str, str]] = None, time_unit: str = 'minutes', source: Optional[str] = None) -> pd.DataFrame
scenario_from_dataframe(df: pd.DataFrame, scenario_name: str, scenario_version: str = '1.0', description: str = 'Imported CGM scenario', carb_threshold: float = 0.1, absorption_delay_minutes: int = 10, duration_minutes: int = 60) -> Dict[str, Any]
scenario_from_csv(path: Union[str, Path], scenario_name: str = 'Imported CGM Scenario', scenario_version: str = '1.0', data_format: str = 'generic', column_map: Optional[Dict[str, str]] = None, time_unit: str = 'minutes', carb_threshold: float = 0.1) -> ImportResult
export_standard_csv(df: pd.DataFrame, output_path: Union[str, Path]) -> str
load_demo_dataframe() -> pd.DataFrame
export_demo_csv(output_path: Union[str, Path]) -> str
Public Constants
DEFAULT_MAPPINGS
IMPORT_FORMAT_SCHEMAS
iints.data.ingestor
- Source:
src/iints/data/ingestor.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DataIngestor |
DataIngestor |
Standardized Data Bridge for ingesting various diabetes datasets into a universal IINTS-AF format. |
DataIngestor methods
get_patient_model(self, file_path: Union[str, Path], data_type: str) -> pd.DataFrame
iints.data.mdmp_visualizer
- Source:
src/iints/data/mdmp_visualizer.py
- Summary: No module docstring.
Public Functions
build_mdmp_dashboard_html(report: Dict[str, Any], *, title: str = 'IINTS MDMP Certification Dashboard', generated_at_utc: Optional[str] = None) -> str
iints.data.medtronic_live
- Source:
src/iints/data/medtronic_live.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
MedtronicLiveConfig |
MedtronicLiveConfig |
Configuration for an authorized read-only Medtronic/CareLink live relay. |
MedtronicLiveClient |
MedtronicLiveClient |
Small authenticated JSON client for a read-only Medtronic live data relay. |
MedtronicLiveClient methods
get_json(self, path: str, *, query: Optional[Dict[str, Any]] = None) -> Any
Public Functions
normalize_medtronic_live_payload(payload: Any, *, event_tolerance_minutes: float = 7.5, source: str = 'medtronic_carelink_live') -> pd.DataFrame
fetch_medtronic_live_payload(config: MedtronicLiveConfig) -> Any
fetch_medtronic_live_timeline(config: MedtronicLiveConfig) -> pd.DataFrame
medtronic_live_timeline_to_standard(timeline: pd.DataFrame, *, source: str = 'medtronic_carelink_live') -> pd.DataFrame
fetch_medtronic_live_dataframe(config: MedtronicLiveConfig) -> pd.DataFrame
import_medtronic_live(config: MedtronicLiveConfig, scenario_name: str = 'Medtronic CareLink Live Import', scenario_version: str = '1.0', carb_threshold: float = 0.1) -> ImportResult
poll_medtronic_live_timeline(config: MedtronicLiveConfig, *, samples: int = 1, poll_seconds: float = 30.0) -> Iterable[pd.DataFrame]
write_latest_medtronic_live_snapshot(timeline: pd.DataFrame, output_dir: Path) -> Dict[str, str]
Public Constants
CARB_KEYS
GLUCOSE_KEYS
GLUCOSE_TYPES
INSULIN_KEYS
LIST_KEYS
SINGLE_RECORD_KEYS
TIMESTAMP_KEYS
TYPE_KEYS
UNIT_KEYS
iints.data.nightscout
- Source:
src/iints/data/nightscout.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
NightscoutConfig |
NightscoutConfig |
No module docstring. |
Public Functions
fetch_nightscout_dataframe(config: NightscoutConfig) -> pd.DataFrame
import_nightscout(config: NightscoutConfig, scenario_name: str = 'Nightscout Import', scenario_version: str = '1.0', carb_threshold: float = 0.1) -> ImportResult
iints.data.quality_checker
- Source:
src/iints/data/quality_checker.py
- Summary: Data Quality Checker - IINTS-AF Validates data quality and calculates confidence scores with gap detection.
Public Classes
| Class |
Signature |
Summary |
QualityReport |
QualityReport |
Comprehensive data quality report |
DataGap |
DataGap |
Represents a gap in the data |
DataAnomaly |
DataAnomaly |
Represents an anomalous data point |
DataQualityChecker |
DataQualityChecker |
Validates data quality and calculates confidence scores. |
QualityReport methods
DataGap methods
to_dict(self) -> Dict
get_warning_message(self) -> str
DataAnomaly methods
DataQualityChecker methods
check_completeness(self, df: pd.DataFrame) -> Tuple[float, List[DataGap]]
check_consistency(self, df: pd.DataFrame) -> float
check_validity(self, df: pd.DataFrame) -> Tuple[float, List[DataAnomaly]]
check(self, df: pd.DataFrame) -> QualityReport
get_confidence_score(self, df: pd.DataFrame) -> float
print_report(self, report: QualityReport)
Public Functions
iints.data.realism_dashboard
- Source:
src/iints/data/realism_dashboard.py
- Summary: No module docstring.
Public Functions
build_realism_dashboard_html(report: RealismReport, dataframe: pd.DataFrame, *, title: str = 'IINTS Physiological Realism Dashboard', source_label: Optional[str] = None) -> str
write_realism_dashboard(report: RealismReport, dataframe: pd.DataFrame, output_path: str | Path, *, title: str = 'IINTS Physiological Realism Dashboard', source_label: Optional[str] = None) -> Path
iints.data.realism_governance
- Source:
src/iints/data/realism_governance.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
RealDataGateProfile |
RealDataGateProfile |
Strict research gate for traces used as realism evidence or AI training data. |
RealDataGateResult |
RealDataGateResult |
No module docstring. |
RealDataGateResult methods
to_dict(self) -> Dict[str, Any]
Public Functions
review_real_data_realism(report: RealismReport, *, profile: RealDataGateProfile = STRICT_REAL_DATA_RESEARCH_PROFILE) -> RealDataGateResult
Public Constants
STRICT_REAL_DATA_RESEARCH_PROFILE
iints.data.realism_reference
- Source:
src/iints/data/realism_reference.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ReferenceBand |
ReferenceBand |
No module docstring. |
ReferenceComparison |
ReferenceComparison |
No module docstring. |
RealismReferenceProfile |
RealismReferenceProfile |
No module docstring. |
ReferenceBand methods
from_dict(cls, payload: Dict[str, Any]) -> 'ReferenceBand'
to_dict(self) -> Dict[str, float]
ReferenceComparison methods
to_dict(self) -> Dict[str, Any]
RealismReferenceProfile methods
from_dict(cls, payload: Dict[str, Any]) -> 'RealismReferenceProfile'
to_dict(self) -> Dict[str, Any]
Public Functions
load_realism_reference_registry() -> List[RealismReferenceProfile]
list_realism_reference_ids() -> List[str]
get_realism_reference(reference_id: str) -> RealismReferenceProfile
compare_to_reference_band(metric_key: str, label: str, observed_value: float | None, band: ReferenceBand) -> ReferenceComparison
metric_label(metric_key: str) -> str
build_reference_comparisons(observed_metrics: Dict[str, Any], profile: RealismReferenceProfile) -> List[ReferenceComparison]
iints.data.realism_validator
- Source:
src/iints/data/realism_validator.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
RealismCheck |
RealismCheck |
No module docstring. |
MealResponse |
MealResponse |
No module docstring. |
RealismReport |
RealismReport |
No module docstring. |
RealismCheck methods
to_dict(self) -> Dict[str, Any]
MealResponse methods
to_dict(self) -> Dict[str, float | None]
RealismReport methods
to_dict(self) -> Dict[str, Any]
Public Functions
realism_verdict_meets_minimum(verdict: str, minimum: str) -> bool
validate_realism_dataset(dataframe: pd.DataFrame, *, expected_interval_minutes: int = 5, min_meal_grams: float = 10.0, reference: str | RealismReferenceProfile | None = None) -> RealismReport
validate_realism_csv(input_csv: str | Path, *, data_format: str = 'generic', column_map: Optional[Dict[str, str]] = None, time_unit: str = 'minutes', source: Optional[str] = None, expected_interval_minutes: int = 5, min_meal_grams: float = 10.0, reference: str | RealismReferenceProfile | None = None) -> RealismReport
write_realism_report(report: RealismReport, output_path: str | Path) -> Path
Public Constants
MEAL_RESPONSE_MAX_LAG_MINUTES
REALISM_VERDICT_ORDER
iints.data.registry
- Source:
src/iints/data/registry.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DatasetRegistryError |
DatasetRegistryError(RuntimeError) |
No module docstring. |
DatasetFetchError |
DatasetFetchError(RuntimeError) |
No module docstring. |
Public Functions
load_dataset_registry() -> List[Dict[str, Any]]
get_dataset(dataset_id: str) -> Dict[str, Any]
list_dataset_ids() -> List[str]
fetch_dataset(dataset_id: str, output_dir: Path, extract: bool = True, verify: bool = True) -> List[Path]
iints.data.research_catalog
- Source:
src/iints/data/research_catalog.py
- Summary: No module docstring.
Public Functions
resolve_research_dataset_entries(dataset_ids: Sequence[str] | None = None) -> list[Dict[str, Any]]
build_research_dataset_matrix(dataset_ids: Sequence[str] | None = None) -> list[dict[str, Any]]
write_research_dataset_plan(output_dir: Path, dataset_ids: Sequence[str] | None = None) -> dict[str, Any]
Public Constants
DEFAULT_RESEARCH_DATASET_IDS
TASK_COLUMNS
iints.data.runner
- Source:
src/iints/data/runner.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
CheckResult |
CheckResult |
No module docstring. |
ValidationResult |
ValidationResult |
No module docstring. |
ContractRunner |
ContractRunner |
Lightweight executor for model-ready data contracts. |
CheckResult methods
to_dict(self) -> Dict[str, Any]
ValidationResult methods
to_dict(self) -> Dict[str, Any]
ContractRunner methods
run(self, df: pd.DataFrame, *, transform_hooks: Optional[Iterable[TransformHook]] = None, apply_builtin_transforms: bool = True) -> ValidationResult
Public Functions
dataframe_fingerprint(df: pd.DataFrame) -> str
classify_mdmp_grade(score: float, is_compliant: bool) -> str
mdmp_grade_meets_minimum(actual_grade: str, minimum_grade: str) -> bool
Public Constants
MDMP_GRADE_DEFINITIONS
MDMP_GRADE_ORDER
MDMP_PROTOCOL_VERSION
iints.data.study_corruption
- Source:
src/iints/data/study_corruption.py
- Summary: No module docstring.
Public Functions
apply_study_corruptions(dataframe: pd.DataFrame, *, modes: list[str], seed: int = 42, timestamp_shift_minutes: int = 60, missing_fraction: float = 0.1, duplicate_fraction: float = 0.05, spike_fraction: float = 0.03, spike_magnitude_mgdl: float = 60.0) -> tuple[pd.DataFrame, dict[str, Any]]
write_corrupted_study_csv(input_csv: str | Path, *, output_csv: str | Path, modes: list[str], manifest_output: str | Path | None = None, seed: int = 42, timestamp_shift_minutes: int = 60, missing_fraction: float = 0.1, duplicate_fraction: float = 0.05, spike_fraction: float = 0.03, spike_magnitude_mgdl: float = 60.0) -> dict[str, str]
Public Constants
AVAILABLE_STUDY_CORRUPTIONS
iints.data.synthetic_mirror
- Source:
src/iints/data/synthetic_mirror.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SyntheticMirrorArtifact |
SyntheticMirrorArtifact |
No module docstring. |
SyntheticMirrorArtifact methods
to_dict(self) -> Dict[str, Any]
Public Functions
generate_synthetic_mirror(source_df: pd.DataFrame, contract: ContractInput, *, rows: Optional[int] = None, seed: int = 42, noise_scale: float = 0.05, timestamp_column: str = 'timestamp') -> Tuple[pd.DataFrame, SyntheticMirrorArtifact]
iints.data.tidepool
- Source:
src/iints/data/tidepool.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
TidepoolConfig |
TidepoolConfig |
No module docstring. |
TidepoolClient |
TidepoolClient |
Small authenticated Tidepool Data Platform client for read-only imports. |
TidepoolClient methods
get_json(self, path: str, *, query: Optional[dict[str, Any]] = None) -> Any
current_user(self) -> dict[str, Any]
fetch_device_data(self, user_id: str, *, start: Optional[str] = None, end: Optional[str] = None, types: Iterable[str] = ('cbg', 'bolus', 'wizard', 'food')) -> list[dict[str, Any]]
Public Functions
fetch_tidepool_dataframe(config: TidepoolConfig) -> pd.DataFrame
import_tidepool(config: TidepoolConfig, scenario_name: str = 'Tidepool Import', scenario_version: str = '1.0', carb_threshold: float = 0.1) -> ImportResult
load_openapi_spec(path: str) -> Dict[str, Any]
Public Constants
iints.data.universal_parser
- Source:
src/iints/data/universal_parser.py
- Summary: Universal Data Parser - IINTS-AF Universal ingestion engine for any CSV/JSON data format.
Public Classes
| Class |
Signature |
Summary |
StandardDataPack |
StandardDataPack |
Standard data format for IINTS-AF. |
ParseResult |
ParseResult |
Result of a parse operation |
UniversalParser |
UniversalParser |
Universal data parser for IINTS-AF. |
StandardDataPack methods
duration_hours(self) -> float
data_points(self) -> int
confidence_score(self) -> float
ParseResult methods
UniversalParser methods
detect_format(self, file_path: str) -> str
detect_delimiter(self, file_path: str) -> Optional[str]
parse_datetime(self, value: Any) -> Optional[float]
parse_glucose(self, value: Any, unit: str = 'mg/dL') -> Optional[float]
parse_csv(self, file_path: str) -> pd.DataFrame
parse_json(self, file_path: str) -> pd.DataFrame
convert_to_standard(self, df: pd.DataFrame) -> Tuple[pd.DataFrame, dict]
normalize_timestamps(self, df: pd.DataFrame) -> pd.DataFrame
validate_and_clean(self, df: pd.DataFrame) -> Tuple[pd.DataFrame, QualityReport]
parse(self, file_path: str, validate: Optional[bool] = None, metadata: Optional[Dict] = None) -> ParseResult
parse_string(self, content: str, format_type: str = 'csv', validate: bool = True) -> ParseResult
Public Functions
iints.demo_assets
- Source:
src/iints/demo_assets.py
- Summary: No module docstring.
Public Functions
export_live_stage_demo(output_dir: str | Path = '.', *, overwrite: bool = False) -> dict[str, str]
iints.emulation
- Source:
src/iints/emulation/__init__.py
- Summary: No module docstring.
- Explicit exports:
LegacyEmulator, PumpBehavior, PIDParameters, SafetyLimits, SafetyLevel, EmulatorDecision, Medtronic780GEmulator, Medtronic780GBehavior, TandemControlIQEmulator, TandemControlIQBehavior, Omnipod5Emulator, Omnipod5Behavior
Public Functions
get_emulator(pump_type: str) -> InsulinAlgorithm
list_available_emulators() -> list
Public Constants
iints.emulation.legacy_base
- Source:
src/iints/emulation/legacy_base.py
- Summary: Legacy Emulator Base Class - IINTS-AF Base class for commercial insulin pump emulation.
Public Classes
| Class |
Signature |
Summary |
SafetyLevel |
SafetyLevel(Enum) |
Safety level classification for pump behaviors |
SafetyLimits |
SafetyLimits |
Pump-specific safety constraints |
PIDParameters |
PIDParameters |
PID controller parameters |
PumpBehavior |
PumpBehavior |
Complete pump behavior profile |
EmulatorDecision |
EmulatorDecision |
Decision output from a pump emulator |
LegacyEmulator |
LegacyEmulator(InsulinAlgorithm) |
Abstract base class for commercial insulin pump emulation. |
PumpBehavior methods
EmulatorDecision methods
LegacyEmulator methods
get_sources(self) -> List[Dict[str, str]]
reset(self)
set_safety_mode(self, level: SafetyLevel)
get_behavior_profile(self) -> PumpBehavior
emulate_decision(self, glucose: float, velocity: float, insulin_on_board: float, carbs: float, current_time: float = 0) -> EmulatorDecision
predict_insulin(self, algo_input: AlgorithmInput) -> Dict[str, Any]
get_decision_history(self) -> List[EmulatorDecision]
export_behavior_report(self) -> Dict
compare_with_new_ai(self, new_ai_decisions: List[Dict]) -> Dict
Public Functions
iints.emulation.medtronic_780g
- Source:
src/iints/emulation/medtronic_780g.py
- Summary: Medtronic 780G Emulator - IINTS-AF Emulates the Medtronic MiniMed 780G with SmartGuard algorithm.
Public Classes
| Class |
Signature |
Summary |
Medtronic780GBehavior |
Medtronic780GBehavior(PumpBehavior) |
Medtronic 780G specific behavior profile |
Medtronic780GEmulator |
Medtronic780GEmulator(LegacyEmulator) |
Emulates Medtronic 780G SmartGuard algorithm. |
Medtronic780GEmulator methods
get_sources(self) -> List[Dict[str, str]]
emulate_decision(self, glucose: float, velocity: float, insulin_on_board: float, carbs: float, current_time: float = 0) -> EmulatorDecision
get_algorithm_personality(self) -> Dict
Public Functions
iints.emulation.omnipod_5
- Source:
src/iints/emulation/omnipod_5.py
- Summary: Omnipod 5 Emulator - IINTS-AF Emulates the Omnipod 5 with Horizon Algorithm.
Public Classes
| Class |
Signature |
Summary |
Omnipod5Behavior |
Omnipod5Behavior(PumpBehavior) |
Omnipod 5 specific behavior profile |
Omnipod5Emulator |
Omnipod5Emulator(LegacyEmulator) |
Emulates Omnipod 5 with Horizon algorithm. |
Omnipod5Emulator methods
get_sources(self) -> List[Dict[str, str]]
set_activity_mode(self, enabled: bool, mode_type: str = 'exercise')
emulate_decision(self, glucose: float, velocity: float, insulin_on_board: float, carbs: float, current_time: float = 0) -> EmulatorDecision
get_algorithm_personality(self) -> Dict
Public Functions
iints.emulation.tandem_controliq
- Source:
src/iints/emulation/tandem_controliq.py
- Summary: Tandem Control-IQ Emulator - IINTS-AF Emulates the Tandem t:slim X2 with Control-IQ algorithm.
Public Classes
| Class |
Signature |
Summary |
TandemControlIQBehavior |
TandemControlIQBehavior(PumpBehavior) |
Tandem Control-IQ specific behavior profile |
TandemControlIQEmulator |
TandemControlIQEmulator(LegacyEmulator) |
Emulates Tandem Control-IQ algorithm. |
TandemControlIQEmulator methods
get_sources(self) -> List[Dict[str, str]]
set_exercise_mode(self, enabled: bool)
emulate_decision(self, glucose: float, velocity: float, insulin_on_board: float, carbs: float, current_time: float = 0) -> EmulatorDecision
get_algorithm_personality(self) -> Dict
Public Functions
iints.governance
- Source:
src/iints/governance/__init__.py
- Summary: Governance helpers for IINTS-AF research-only runtime boundaries.
- Explicit exports:
PolicyGuardResult, RESEARCH_ONLY_NOTICE, guard_ai_output, scan_text_for_policy_violations, scan_text_for_policy_warnings
No public classes, functions, or all-caps constants are declared directly in this module.
iints.governance.research_policy
- Source:
src/iints/governance/research_policy.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PolicyGuardResult |
PolicyGuardResult |
Result of checking generated text against the research-only boundary. |
Public Functions
scan_text_for_policy_violations(text: str) -> tuple[str, ...]
scan_text_for_policy_warnings(text: str) -> tuple[str, ...]
guard_ai_output(text: str, *, source: str = 'local_ai') -> PolicyGuardResult
Public Constants
iints.highlevel
- Source:
src/iints/highlevel.py
- Summary: No module docstring.
Public Functions
run_simulation(algorithm: Union[InsulinAlgorithm, type], scenario: Optional[Union[str, Path, Dict[str, Any]]] = None, patient_config: Union[str, Path, Dict[str, Any], PatientProfile] = 'default_patient', patient_model_type: str = 'auto', sensor_noise_std: Optional[float] = None, sensor_lag_minutes: Optional[int] = None, sensor_dropout_prob: Optional[float] = None, sensor_bias: Optional[float] = None, sensor_profile: Optional[str] = None, duration_minutes: int = 720, time_step: int = 5, seed: Optional[int] = None, output_dir: Optional[Union[str, Path]] = None, compare_baselines: bool = True, export_audit: bool = True, generate_report: bool = True, safety_config: Optional[SafetyConfig] = None, predictor: Optional[object] = None, physiology_variation_profile: Optional[str] = None, physiology_variation_scale: float = 1.0) -> Dict[str, Any]
run_full(algorithm: Union[InsulinAlgorithm, type], scenario: Optional[Union[str, Path, Dict[str, Any]]] = None, patient_config: Union[str, Path, Dict[str, Any], PatientProfile] = 'default_patient', patient_model_type: str = 'auto', sensor_noise_std: Optional[float] = None, sensor_lag_minutes: Optional[int] = None, sensor_dropout_prob: Optional[float] = None, sensor_bias: Optional[float] = None, sensor_profile: Optional[str] = None, duration_minutes: int = 720, time_step: int = 5, seed: Optional[int] = None, output_dir: Optional[Union[str, Path]] = None, enable_profiling: bool = True, safety_config: Optional[SafetyConfig] = None, predictor: Optional[object] = None, step_callback: Optional[Callable[[int, int, float], None]] = None) -> Dict[str, Any]
run_population(algo_path: Optional[Union[str, Path]] = None, algo_class_name: Optional[str] = None, n_patients: int = 100, scenario: Optional[Union[str, Path, Dict[str, Any]]] = None, patient_config: Union[str, Path, Dict[str, Any], PatientProfile] = 'default_patient', duration_minutes: int = 720, time_step: int = 5, seed: Optional[int] = None, output_dir: Optional[Union[str, Path]] = None, max_workers: Optional[int] = None, safety_config: Optional[SafetyConfig] = None, safety_weights: Optional[Dict[str, float]] = None, patient_model_type: str = 'auto', population_cv: Optional[Dict[str, float]] = None) -> Dict[str, Any]
iints.jetson
- Source:
src/iints/jetson/__init__.py
- Summary: No module docstring.
- Explicit exports:
ENDURANCE_PROFILES, EnduranceConfig, JetsonEnduranceError, build_endurance_service_file, collect_jetson_hardware_info, export_endurance_archive, load_endurance_status, parse_duration_to_minutes, run_endurance_study, stop_endurance_study
No public classes, functions, or all-caps constants are declared directly in this module.
iints.jetson.endurance
- Source:
src/iints/jetson/endurance.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
JetsonEnduranceError |
JetsonEnduranceError(RuntimeError) |
No module docstring. |
EnduranceConfig |
EnduranceConfig |
No module docstring. |
EnduranceConfig methods
expected_steps(self) -> int
simulator_end_minutes(self) -> int
wall_clock_target_seconds(self) -> int
Public Functions
utc_now_iso() -> str
parse_duration_to_minutes(value: str) -> int
collect_jetson_hardware_info() -> Dict[str, Any]
run_endurance_study(*, algorithm: InsulinAlgorithm, predictor: Optional[object], config: EnduranceConfig, progress_callback: Optional[Any] = None, monotonic_fn: Any = time.monotonic, sleep_fn: Any = time.sleep) -> Dict[str, Any]
load_endurance_status(output_dir: str | Path) -> Dict[str, Any]
stop_endurance_study(output_dir: str | Path, *, generate_report: bool = False) -> Dict[str, Any]
export_endurance_archive(output_dir: str | Path, output: str | Path) -> Path
build_endurance_service_file(*, algo: str, duration: str, output_dir: str, predictor: Optional[str] = None, profile: str = 'mixed_adversarial', seed: Optional[int] = None, wall_clock: bool = False, working_directory: Optional[str] = None) -> str
Public Constants
ENDURANCE_EXECUTION_MODES
ENDURANCE_PROFILES
iints.jetson.research_pipeline
- Source:
src/iints/jetson/research_pipeline.py
- Summary: No module docstring.
Public Functions
finalize_endurance_research(output_dir: Path, *, repo_root: Path, train_predictor: bool = True, predictor_config_path: Path | None = None, train_neural: bool = True, evaluation_presets: Iterable[str] = DEFAULT_HELD_OUT_PRESETS, evaluation_seeds: Iterable[int] = (101, 202, 303), evaluation_duration_minutes: int = 1440) -> Dict[str, Any]
iints.learning
- Source:
src/iints/learning/__init__.py
- Summary: No module docstring.
- Explicit exports:
AutonomousLearningSystem, ClinicalTeacher, ClinicalConstraints
No public classes, functions, or all-caps constants are declared directly in this module.
iints.learning.autonomous_optimizer
- Source:
src/iints/learning/autonomous_optimizer.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ClinicalConstraints |
ClinicalConstraints |
Research-sandbox constraints; not clinical dosing guidance. |
iints.learning.learning_system
- Source:
src/iints/learning/learning_system.py
- Summary: IINTS-AF Legacy Learning Storage Stores externally validated parameters; mock learning is intentionally disabled.
Public Classes
| Class |
Signature |
Summary |
LearningSystem |
LearningSystem |
Store externally produced research parameters with validation metadata. |
LearningSystem methods
save_learned_parameters(self, patient_id: str, parameters: Dict, performance_metrics: Dict)
load_learned_parameters(self, patient_id: str) -> Optional[Dict]
simulate_learning_process(self, patient_id: str, glucose_data: List[float]) -> Tuple[Dict, List[float]]
validate_learning_safety(self, parameters: Dict, patient_id: str) -> Tuple[bool, str]
get_learning_status(self, patient_id: str) -> str
iints.live_patient
- Source:
src/iints/live_patient/__init__.py
- Summary: No module docstring.
- Explicit exports:
create_edge_bundle, export_edge_setup, summarize_edge_workspace, write_edge_update_script, render_edge_long_study_config_template, load_edge_long_study_config, run_edge_long_study, create_edge_study_snapshot, export_edge_study_archive, create_patient_app, run_edge_benchmark, export_uno_q_bridge, DIRECT_PUMP_READ_ONLY_CONFIRMATION, DirectPumpConfig, PumpSnapshot, SimulatedMedtronicPumpTransport, stream_direct_pump_snapshots, write_direct_pump_snapshot, bench_test_pico_pump_bundle, build_pico_pump_bundle, create_pico_pump_lab, LivePatientDaemon, PatientRuntimeConfig, PatientRuntimeStore, get_runtime_scenario_profile, list_runtime_scenario_profiles, load_runtime_status, is_process_alive
Public Functions
run_edge_benchmark(*args: Any, **kwargs: Any) -> Any
iints.live_patient.api
- Source:
src/iints/live_patient/api.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
MealRequest |
MealRequest(BaseModel) |
No module docstring. |
ScenarioResetRequest |
ScenarioResetRequest(BaseModel) |
No module docstring. |
Public Functions
create_patient_app(workspace: str | Path, api_token: str | None = None) -> FastAPI
Public Constants
CONTROL_HEADER_NAME
CONTROL_HEADER_VALUE
SECURITY_RESPONSE_HEADERS
iints.live_patient.daemon
- Source:
src/iints/live_patient/daemon.py
- Summary: No module docstring.
Public Functions
iints.live_patient.edge_benchmark
- Source:
src/iints/live_patient/edge_benchmark.py
- Summary: No module docstring.
Public Functions
run_edge_benchmark(*, algo_path: Path, patient_config: str = 'default_patient', patient_model_type: str = 'auto', scenario_profile: str = 'normal_day', steps: int = 72, platform_name: str = 'auto', api_host: str = '127.0.0.1', api_port: int = 8766, seed: int | None = None) -> dict[str, Any]
iints.live_patient.edge_ops
- Source:
src/iints/live_patient/edge_ops.py
- Summary: No module docstring.
Public Functions
summarize_edge_workspace(workspace: str | Path) -> dict[str, Any]
create_edge_bundle(workspace: str | Path, *, output_path: str | Path, include_log: bool = True, include_database: bool = True) -> dict[str, Any]
render_edge_update_script(*, profile: str = 'edge', version_pin: str | None = None) -> str
write_edge_update_script(output_path: str | Path, *, profile: str = 'edge', version_pin: str | None = None) -> Path
export_edge_setup(output_dir: str | Path, *, board: str = 'raspberry_pi', workspace_name: str = 'patient_runtime', scenario_profile: str = 'normal_day', patient_config: str = 'default_patient', patient_model_type: str = 'auto', mode: str = 'demo-time', speed: float = 60.0, api_host: str = '127.0.0.1', api_port: int = 8765, seed: int | None = None, service_name: str = 'iints-digital-patient', user_name: str | None = None, include_uno_bridge: bool = False, uno_bridge_port: str | None = None, uno_bridge_baudrate: int = UNO_Q_BRIDGE_BAUDRATE, uno_bridge_service_name: str = 'iints-uno-q-bridge') -> dict[str, str]
deploy_edge_project(*, host: str, user_name: str | None = None, ssh_port: int = 22, remote_dir: str = '~/iints_pi_demo', local_output_dir: str | Path = 'iints_pi_demo', board: str = 'raspberry_pi', workspace_name: str = 'patient_runtime', scenario_profile: str = 'expo_hot_start', patient_config: str = 'default_patient', patient_model_type: str = 'auto', mode: str = 'demo-time', speed: float = 60.0, api_host: str = '127.0.0.1', api_port: int = 8765, seed: int | None = None, service_name: str = 'iints-digital-patient', include_uno_bridge: bool = False, uno_bridge_port: str | None = None, uno_bridge_baudrate: int = UNO_Q_BRIDGE_BAUDRATE, uno_bridge_service_name: str = 'iints-uno-q-bridge', install_autostart: bool = True, start_runtime: bool = True, enable_connect_linger: bool = True, flash_uno_bridge: bool = False, uno_fqbn: str | None = None, arduino_cli: str = 'arduino-cli', dry_run: bool = False, ssh_timeout_seconds: float = 300.0, ssh_retries: int = 1, progress_callback: Callable[[str], None] | None = None) -> dict[str, Any]
build_edge_offline_bundle(output_path: str | Path, *, board: str = 'raspberry_pi', workspace_name: str = 'patient_runtime', scenario_profile: str = 'expo_hot_start', patient_config: str = 'default_patient', patient_model_type: str = 'auto', mode: str = 'demo-time', speed: float = 60.0, api_host: str = '127.0.0.1', api_port: int = 8765, seed: int | None = None, service_name: str = 'iints-digital-patient', user_name: str | None = None, include_uno_bridge: bool = False, progress_callback: Callable[[str], None] | None = None) -> dict[str, str]
run_remote_edge_command(*, host: str, user_name: str | None = None, ssh_port: int = 22, remote_dir: str = '~/iints_pi_demo', action: str = 'status', scenario_profile: str | None = None, seed: int | None = None, timeout_seconds: float = 60.0, retries: int = 0) -> dict[str, str]
iints.live_patient.fpga
- Source:
src/iints/live_patient/fpga.py
- Summary: FPGA safety-core workflow helpers for bench-only hardware research.
Public Classes
| Class |
Signature |
Summary |
FPGARunSummary |
FPGARunSummary |
Paths and pass/fail metadata from one FPGA safety-core comparison run. |
MockFPGATransport |
MockFPGATransport |
Reference transport that behaves like an FPGA safety core without hardware. |
SerialFPGATransport |
SerialFPGATransport |
JSON-lines serial transport for a future FPGA board or MCU bridge. |
FPGARunSummary methods
to_dict(self) -> dict[str, Any]
MockFPGATransport methods
evaluate(self, event: dict[str, Any]) -> tuple[dict[str, Any], float]
SerialFPGATransport methods
evaluate(self, event: dict[str, Any]) -> tuple[dict[str, Any], float]
Public Functions
normalize_fpga_event(event: dict[str, Any]) -> dict[str, Any]
evaluate_fpga_safety_reference(event: dict[str, Any]) -> dict[str, Any]
load_fpga_events(path: str | Path | None = None) -> list[dict[str, Any]]
fpga_events_from_results_dataframe(dataframe: pd.DataFrame, *, stride: int = 1, max_events: int | None = 288) -> list[dict[str, Any]]
write_fpga_events_from_results_csv(results_csv: str | Path, output_path: str | Path, *, stride: int = 1, max_events: int | None = 288) -> Path
run_fpga_replay_from_results(*, results_csv: str | Path, output_dir: str | Path, transport: str = 'mock', port: str | None = None, baudrate: int = FPGA_DEFAULT_BAUDRATE, timeout_seconds: float = 1.5, stride: int = 1, max_events: int | None = 288) -> FPGARunSummary
write_fpga_report(path: Path, *, comparison: dict[str, Any], rows: list[dict[str, Any]]) -> None
run_fpga_safety_simulation(*, output_dir: str | Path, events_path: str | Path | None = None, transport: str = 'mock', port: str | None = None, baudrate: int = FPGA_DEFAULT_BAUDRATE, timeout_seconds: float = 1.5, scenario_name: str | None = None) -> FPGARunSummary
create_fpga_lab(output_dir: str | Path) -> dict[str, str]
fpga_environment_report() -> dict[str, Any]
Public Constants
DEFAULT_FPGA_EVENTS
DEFAULT_FPGA_SAFETY_CONTRACT
FPGA_CONFIRMATION
FPGA_DEFAULT_BAUDRATE
FPGA_NIGHT_HYPO_RISK_EVENTS
FPGA_READY_BANNER
iints.live_patient.long_study
- Source:
src/iints/live_patient/long_study.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
EdgeLongStudyConfig |
EdgeLongStudyConfig |
No module docstring. |
LongStudyAlgorithmSpec |
LongStudyAlgorithmSpec |
No module docstring. |
LongStudySnapshotResult |
LongStudySnapshotResult |
No module docstring. |
LongStudyConfigError |
LongStudyConfigError(ValueError) |
No module docstring. |
EdgeLongStudyExecutionError |
EdgeLongStudyExecutionError(RuntimeError) |
No module docstring. |
EdgeLongStudyConfig methods
weekday_for_day(self, day_index: int) -> str
profile_for_day(self, day_index: int) -> str
snapshot_every_days(self) -> int
to_dict(self) -> dict[str, Any]
LongStudyAlgorithmSpec methods
to_dict(self) -> dict[str, str]
LongStudySnapshotResult methods
to_dict(self) -> dict[str, str]
Public Functions
render_edge_long_study_config_template(*, output_dir: str = '/media/pi/usb_ssd/results/long_study', scratch_dir: str = '/tmp/iints_edge_long_study', algorithms: list[str] | None = None) -> str
load_edge_long_study_config(config_path: Path) -> EdgeLongStudyConfig
build_long_study_day_scenario(*, profile: RuntimeScenarioProfile, day_number: int, weekday: str, sequence_seed: int) -> dict[str, Any]
create_edge_study_snapshot(input_dir: str | Path, *, output: str | Path) -> LongStudySnapshotResult
export_edge_study_archive(input_dir: str | Path, *, output: str | Path) -> dict[str, str]
run_edge_long_study(*, config_path: str | Path, project_dir: str | Path = '.', resume: bool = False, progress_callback: Callable[[str], None] | None = None) -> dict[str, Any]
Public Constants
iints.live_patient.medtronic_direct
- Source:
src/iints/live_patient/medtronic_direct.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PumpTransport |
PumpTransport(Protocol) |
Read-only direct pump transport protocol. |
PumpSnapshot |
PumpSnapshot |
No module docstring. |
DirectPumpConfig |
DirectPumpConfig |
No module docstring. |
SimulatedMedtronicPumpTransport |
SimulatedMedtronicPumpTransport |
Bench-only direct pump transport for SDK integration testing. |
OfficialModulePumpTransport |
OfficialModulePumpTransport |
Wrapper for an approved internal Medtronic read-only transport factory. |
PumpTransport methods
connect(self) -> None
read_snapshot(self) -> 'PumpSnapshot | Mapping[str, Any]'
disconnect(self) -> None
PumpSnapshot methods
from_mapping(cls, payload: Mapping[str, Any]) -> 'PumpSnapshot'
validate(self) -> None
to_json_dict(self) -> dict[str, Any]
SimulatedMedtronicPumpTransport methods
connect(self) -> None
disconnect(self) -> None
read_snapshot(self) -> PumpSnapshot
OfficialModulePumpTransport methods
connect(self) -> None
read_snapshot(self) -> PumpSnapshot | Mapping[str, Any]
disconnect(self) -> None
Public Functions
create_direct_pump_transport(config: DirectPumpConfig) -> PumpTransport
stream_direct_pump_snapshots(config: DirectPumpConfig, *, samples: int = 1, poll_seconds: float = 30.0) -> Iterable[PumpSnapshot]
snapshots_to_dataframes(snapshots: Iterable[PumpSnapshot]) -> tuple[pd.DataFrame, pd.DataFrame]
write_direct_pump_snapshot(snapshots: Iterable[PumpSnapshot], output_dir: str | Path) -> dict[str, str]
Public Constants
AUTHORIZED_IDENTITY_MODE
COMMAND_LIKE_KEYS
DIRECT_PUMP_READ_ONLY_CONFIRMATION
DIRECT_PUMP_SOURCE
DISALLOWED_IDENTITY_MODES
GLUCOSE_KEYS
TIMESTAMP_KEYS
iints.live_patient.pico_pump
- Source:
src/iints/live_patient/pico_pump.py
- Summary: No module docstring.
Public Functions
export_pico_pump_firmware(output_dir: str | Path) -> dict[str, str]
create_pico_pump_lab(output_dir: str | Path, *, algorithm_path: str | Path | None = None) -> dict[str, str]
build_pico_pump_bundle(algorithm_path: str | Path, output_dir: str | Path, *, safety_contract_path: str | Path | None = None, label: str = 'pico_pump_bench') -> dict[str, Any]
bench_test_pico_pump_bundle(bundle_dir: str | Path) -> dict[str, Any]
upload_pico_pump_bundle(bundle_dir: str | Path, mount_dir: str | Path, *, bench_only_confirmation: str, write: bool = False) -> dict[str, Any]
run_pico_pump_serial_self_test(port: str, *, baudrate: int = PICO_PUMP_BAUDRATE, timeout_seconds: float = 1.5) -> list[dict[str, str | None]]
Public Constants
BENCH_ALGORITHM_TEMPLATE
DEFAULT_PICO_PUMP_SAFETY_CONTRACT
PICO_PUMP_BAUDRATE
PICO_PUMP_CONFIRMATION
PICO_PUMP_DEVICE_ID
PICO_PUMP_READY_BANNER
iints.live_patient.runtime
- Source:
src/iints/live_patient/runtime.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DailyEventTemplate |
DailyEventTemplate |
No module docstring. |
RuntimeScenarioProfile |
RuntimeScenarioProfile |
No module docstring. |
PatientRuntimeConfig |
PatientRuntimeConfig |
No module docstring. |
PatientRuntimeStore |
PatientRuntimeStore |
No module docstring. |
DailySchedulePlanner |
DailySchedulePlanner |
No module docstring. |
LivePatientDaemon |
LivePatientDaemon |
No module docstring. |
PatientRuntimeConfig methods
workspace_path(self) -> Path
algo_file(self) -> Path
db_path(self) -> Path
snapshot_path(self) -> Path
pid_path(self) -> Path
log_path(self) -> Path
config_path(self) -> Path
bundle_dir(self) -> Path
dashboard_url(self) -> str
api_url(self) -> str
to_json(self) -> dict[str, Any]
from_path(cls, path: Path) -> 'PatientRuntimeConfig'
PatientRuntimeStore methods
update_status(self, **fields: Any) -> None
read_status(self) -> dict[str, Any]
append_reading(self, payload: dict[str, Any], *, event_summary: str = '') -> None
get_recent_readings(self, limit: int = 288) -> list[dict[str, Any]]
get_latest_reading(self) -> dict[str, Any] | None
enqueue_command(self, command: str, payload: dict[str, Any] | None = None) -> int
fetch_pending_commands(self) -> list[dict[str, Any]]
complete_command(self, command_id: int, *, status: str, result: dict[str, Any] | None = None) -> None
await_command(self, command_id: int, timeout_seconds: float = 5.0) -> dict[str, Any] | None
clear_runtime_data(self) -> None
build_audit_summary(self) -> dict[str, Any]
DailySchedulePlanner methods
set_templates(self, templates: Iterable[DailyEventTemplate]) -> None
reset(self) -> None
schedule_for_time(self, simulator: Simulator, current_time_minutes: int) -> str
event_labels_for_time(self, current_time_minutes: int) -> list[str]
describe_clock(current_time_minutes: int) -> str
LivePatientDaemon methods
install_signal_handlers(self) -> None
bootstrap(self, *, reset: bool = False) -> None
advance_once(self) -> dict[str, Any]
run(self, *, max_steps: int | None = None) -> None
shutdown(self) -> None
Public Functions
get_runtime_scenario_profile(name: str) -> RuntimeScenarioProfile
list_runtime_scenario_profiles() -> list[RuntimeScenarioProfile]
is_process_alive(pid: int | None) -> bool
load_runtime_status(workspace: Path) -> dict[str, Any]
iints.live_patient.service_export
- Source:
src/iints/live_patient/service_export.py
- Summary: No module docstring.
Public Functions
service_file_text(config: PatientRuntimeConfig, *, service_name: str, user_name: str, python_path: str) -> str
service_instructions_text(service_path: Path, service_name: str) -> str
makerfaire_kiosk_script_text(config: PatientRuntimeConfig) -> str
makerfaire_desktop_entry_text(project_root: Path) -> str
makerfaire_watchdog_name(service_name: str) -> str
makerfaire_watchdog_script_text(*, cli_path: str, scenario_profile: str, seed: int | None) -> str
makerfaire_watchdog_service_text(*, project_root: Path, watchdog_name: str, user_name: str) -> str
makerfaire_watchdog_timer_text(*, watchdog_name: str, interval_seconds: int = 30) -> str
makerfaire_install_script_text(*, service_name: str) -> str
makerfaire_autostart_instructions_text(*, project_root: Path, service_path: Path, desktop_entry_path: Path, kiosk_script_path: Path, install_script_path: Path, watchdog_script_path: Path, watchdog_service_path: Path, watchdog_timer_path: Path, service_name: str) -> str
write_service_artifacts(config: PatientRuntimeConfig, *, output_path: Path, service_name: str = 'iints-digital-patient', user_name: str | None = None, python_path: Path | None = None) -> dict[str, str]
write_makerfaire_autostart_artifacts(config: PatientRuntimeConfig, *, project_root: Path, service_path: Path, service_name: str = 'iints-digital-patient', user_name: str | None = None, cli_path: str | Path | None = None) -> dict[str, str]
uno_q_bridge_service_text(*, project_root: Path, user_name: str, cli_path: str, port: str, baudrate: int, workspace_name: str = 'patient_runtime', service_name: str = 'iints-uno-q-bridge', patient_service_name: str = 'iints-digital-patient') -> str
uno_q_bridge_service_instructions_text(service_path: Path, service_name: str) -> str
write_uno_q_bridge_service_artifact(*, project_root: Path, output_path: Path, user_name: str, cli_path: str | Path, port: str, baudrate: int, workspace_name: str = 'patient_runtime', service_name: str = 'iints-uno-q-bridge', patient_service_name: str = 'iints-digital-patient') -> dict[str, str]
iints.live_patient.uno_q
- Source:
src/iints/live_patient/uno_q.py
- Summary: No module docstring.
Public Functions
list_uno_q_serial_ports() -> list[str]
resolve_uno_q_port(port: str | None) -> str
uno_q_bridge_environment_report(*, arduino_cli: str = 'arduino-cli') -> dict[str, Any]
export_uno_q_bridge(output_dir: str | Path) -> dict[str, str]
bridge_state_from_runtime_status(status: Mapping[str, Any] | None) -> str
send_uno_q_bridge_state(port: str | None, state: str, *, baudrate: int = UNO_Q_BRIDGE_BAUDRATE, timeout_seconds: float = 1.5, expect_response: bool = True) -> dict[str, Any]
run_uno_q_bridge_test(port: str | None, *, baudrate: int = UNO_Q_BRIDGE_BAUDRATE, delay_seconds: float = 0.75) -> list[dict[str, Any]]
run_uno_q_bridge_forwarder(workspace: str | Path, port: str | None, *, baudrate: int = UNO_Q_BRIDGE_BAUDRATE, poll_interval: float = 1.0, once: bool = False, max_cycles: int | None = None) -> dict[str, Any]
flash_uno_q_bridge(sketch_dir: str | Path, *, port: str, fqbn: str, arduino_cli: str = 'arduino-cli') -> dict[str, Any]
Public Constants
UNO_Q_BRIDGE_BAUDRATE
UNO_Q_BRIDGE_BOOT_DELAY_SECONDS
UNO_Q_BRIDGE_READY_BANNER
UNO_Q_BRIDGE_READ_POLL_SECONDS
UNO_Q_BRIDGE_STATES
iints.mdmp
- Source:
src/iints/mdmp/__init__.py
- Summary: MDMP public API (separated namespace).
- Explicit exports:
StreamSpec, FeatureSpec, LabelSpec, ValidationSpec, ProcessSpec, ModelReadyContract, compile_contract, parse_contract, load_contract_yaml, ContractRunner, ValidationResult, CheckResult, MDMP_PROTOCOL_VERSION, MDMP_GRADE_ORDER, classify_mdmp_grade, mdmp_grade_meets_minimum, dataframe_fingerprint, mdmp_gate, MDMPGateError, generate_synthetic_mirror, SyntheticMirrorArtifact, build_mdmp_dashboard_html, MDMPValidationResult, MDMPCheckResult, BACKEND_MDMP_GRADE_ORDER, backend_mdmp_grade_meets_minimum, get_backend, is_mdmp_available, active_mdmp_backend, load_mdmp_contract, run_mdmp_validation, build_mdmp_dashboard_html_with_backend, CORE_AI_PACT_CONTROLS, EU_AI_PACT_CONTROL_DESCRIPTIONS, HIGH_RISK_READINESS_CONTROLS, EUAIPactReadinessResult, review_eu_ai_pact_readiness, MDMPSigner, MDMPVerifier, derive_key_hkdf, derive_key_scrypt, encrypt_patient_payload, decrypt_patient_payload, encrypt_cgm_dataset_file, decrypt_cgm_dataset_file
No public classes, functions, or all-caps constants are declared directly in this module.
iints.mdmp.backend
- Source:
src/iints/mdmp/backend.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
MDMPCheckResult |
MDMPCheckResult |
No module docstring. |
MDMPValidationResult |
MDMPValidationResult |
No module docstring. |
MDMPCheckResult methods
to_dict(self) -> dict[str, Any]
MDMPValidationResult methods
to_dict(self) -> dict[str, Any]
Public Functions
mdmp_grade_meets_minimum(actual_grade: str, minimum_grade: str) -> bool
is_mdmp_available() -> bool
get_backend() -> str
active_mdmp_backend() -> str
load_mdmp_contract(path: Path) -> Any
run_mdmp_validation(contract: Any, df: pd.DataFrame, *, apply_builtin_transforms: bool = True) -> MDMPValidationResult
build_mdmp_dashboard_html(report: dict[str, Any], *, title: str) -> str
Public Constants
BACKEND_BUILTIN
BACKEND_MDMP
MDMP_GRADE_DEFINITIONS
MDMP_GRADE_ORDER
iints.mdmp.eu_ai_pact
- Source:
src/iints/mdmp/eu_ai_pact.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
EUAIPactReadinessResult |
EUAIPactReadinessResult |
No module docstring. |
EUAIPactReadinessResult methods
to_dict(self) -> Dict[str, Any]
Public Functions
review_eu_ai_pact_readiness(payload: Mapping[str, Any], *, strict: bool = True) -> EUAIPactReadinessResult
Public Constants
CORE_AI_PACT_CONTROLS
EU_AI_PACT_CONTROL_DESCRIPTIONS
HIGH_RISK_READINESS_CONTROLS
iints.metrics
- Source:
src/iints/metrics.py
- Summary: No module docstring.
Public Functions
calculate_gmi(glucose: pd.Series) -> float
calculate_cv(glucose: pd.Series) -> float
calculate_lbgi(glucose: pd.Series) -> float
calculate_hbgi(glucose: pd.Series) -> float
calculate_tir(glucose: pd.Series, low: float = 70, high: float = 180) -> float
calculate_full_metrics(glucose: pd.Series, duration_hours: Optional[float] = None)
iints.population
- Source:
src/iints/population/__init__.py
- Summary: No module docstring.
- Explicit exports:
PopulationGenerator, PopulationConfig, ParameterDistribution, PopulationRunner, PopulationResult, PatientResult
No public classes, functions, or all-caps constants are declared directly in this module.
iints.population.generator
- Source:
src/iints/population/generator.py
- Summary: Population Generator — IINTS-AF ================================ Generates a virtual population of N patients with physiological variation around a base patient profile. Each parameter is drawn from a configurable distribution (truncated normal or log-normal) whose bounds respect the configured research ranges defined in the SDK schemas. These bounds are not population-validation or clinical-validity claims.
Public Classes
| Class |
Signature |
Summary |
ParameterDistribution |
ParameterDistribution |
Distribution specification for a single patient parameter. |
PopulationConfig |
PopulationConfig |
Configuration for virtual population generation. |
PopulationGenerator |
PopulationGenerator |
Generates N virtual :class:PatientProfile instances with physiological variation drawn from configurable distributions. |
PopulationGenerator methods
generate(self) -> List[PatientProfile]
iints.population.runner
- Source:
src/iints/population/runner.py
- Summary: Population Runner — IINTS-AF ============================== Runs N virtual patients through the simulator in parallel using
concurrent.futures.ProcessPoolExecutor. Each worker loads the algorithm from a file path (same pattern as run-parallel in the CLI) so that all algorithm classes are safely picklable.
Public Classes
| Class |
Signature |
Summary |
PatientResult |
PatientResult |
Result for a single patient in the population. |
PopulationResult |
PopulationResult |
Aggregate result for the entire population run. |
PopulationRunner |
PopulationRunner |
Runs a virtual patient population through the simulator in parallel. |
PopulationRunner methods
run(self, profiles) -> PopulationResult
iints.presets
- Source:
src/iints/presets/__init__.py
- Summary: Built-in clinic-safe presets.
- Explicit exports:
load_presets, get_preset
Public Functions
load_presets() -> List[Dict[str, Any]]
get_preset(name: str) -> Dict[str, Any]
iints.research
- Source:
src/iints/research/__init__.py
- Summary: No module docstring.
- Explicit exports:
PredictorConfig, TrainingConfig, build_sequences, subject_split, FeatureScaler, load_parquet, save_parquet, load_dataset, save_dataset, compute_dataset_lineage, LSTMPredictor, load_predictor, PredictorService, load_predictor_service, QuantileLoss, SafetyWeightedMSE, BandWeightedMSE, PhysiologicalPINNLoss, BandWeightedPINNLoss, regression_metrics, band_regression_metrics, interval_coverage_metrics, forecast_error_report, hypoglycemia_detection_report, uncertainty_reliability_report, subgroup_error_report, feature_drift_report, audit_subject_split_and_leakage, ForecastCalibrationGate, evaluate_calibration_gate, load_calibration_gate_profiles, PromotionResult, append_registry_entry, list_registry, load_registry, promote_registry_run, write_registry, CONTROL_FEATURE_COLUMNS, CONTROL_TARGET_COLUMN, build_control_dataset_from_runs, evaluate_controller_predictions, load_linear_controller, predict_linear_controller, save_linear_controller, summarize_control_dataset, train_linear_imitation_controller, NeuralControllerConfig, instantiate_neural_controller_model, load_neural_controller, predict_neural_controller, save_neural_controller, train_neural_imitation_controller, PREDICTOR_OPTIONAL_COLUMNS, PREDICTOR_REQUIRED_COLUMNS, blend_predictor_datasets, DEFAULT_HELD_OUT_PRESETS, evaluate_controller_factories, DEFAULT_LOCAL_AI_SAFETY_PROFILE, LocalAIGateResult, LocalAISafetyProfile, review_closed_loop_evaluation, review_controller_training_artifacts, build_predictor_dataset_from_runs, run_local_ai_lab, DEFAULT_FORECAST_FEATURE_COLUMNS, ForecastConfig, PhysiologyAwareBaseline, assess_forecast_risk, attach_forecasts_to_frame, resolve_forecast_input, summarize_forecast_frame, write_forecast_bundle, ResultsIndexBundle, build_artifact_inventory, discover_result_csvs, index_results, summarize_results_csv, AcademicBundleResult, build_academic_bundle, MechanisticRunResult, SBMLModelSummary, inspect_sbml_model, roadrunner_status, run_sbml_model, COPASIModelSummary, COPASIRunResult, copasi_status, inspect_copasi_model, run_copasi_model, CellMLModelSummary, CellMLValidationResult, inspect_cellml_model, opencor_status, validate_cellml_model, FMUModelSummary, FMURunResult, fmpy_status, inspect_fmu_model, run_fmu_model, BindingEvidenceResult, query_bindingdb_uniprot, ClinVarEngine, normalize_protein_variant, RegenerativeEvidencePlan, RegenerativeComparisonResult, RegenerativeProteinPanel, RegenerativeProteinTarget, build_regenerative_evidence_plan, compare_regenerative_islet_proteomics, get_regenerative_protein_panel, load_regenerative_protein_panels, ProteomicsImportResult, load_sample_metadata, import_maxquant_protein_groups, import_diann_report, import_wide_proteomics_matrix, import_and_validate_proteomics, GLUCOSE_MODEL_FEATURE_COLUMNS, GLUCOSE_MODEL_ID, GlucoseModelComparisonBundle, GlucoseModelSpec, GlucoseTrainingPack, build_glucose_training_pack, compare_glucose_models, glucose_model_config_payload, horizon_error_rows, parse_model_specs, physiological_violation_report, public_manifest_from_private, render_hf_comparison_interpretation, standardize_glucose_forecast_frame, write_glucose_model_config, JetsonHFTrainingResult, jetson_hf_model_score, run_jetson_hf_training, DualStreamDecomposition, decompose_dual_stream, extract_dual_stream_pre_meal_features, PPGRTrajectoryMetrics, PPGRBenchmarkResult, BasePPGRModel, CarbOnlyLinearPPGR, MultiMacroLinearPPGR, ContextFeatureRidgePPGR, DualStreamGlucoFMPPGR, compute_trajectory_metrics, build_ppgr_dataset, run_ppgr_benchmark, CGMJEPAConfig, CGMJEPAEncoder, load_cgm_jepa_model, extract_cgm_jepa_embeddings, SimulationJEPAEmbeddingResult, prepare_cgm_jepa_window, bridge_simulation_to_jepa, PhysiologicalSensitivityResult, simulate_physiological_cgm_24h, add_sensor_noise_and_dropouts, run_cgm_jepa_parameter_experiment, ConfounderPairResult, PhysiologicalConfounderStudyResult, generate_confounded_physiological_pair, run_physiological_confounder_experiment, GlucoFMConfig, GlucoFMCheckpointMetadata, GlucoFMEmbeddingResult, GlucoFMStreamEncoder, GlucoFMDualStreamEncoder, GlucoFMDownstreamProbes, GlucoFMPretrainer, align_cgm_window, load_glucofm_checkpoint, embed_cgm_with_glucofm, embed_cgm_with_glucofm_result, build_glucofm_foundation_model, GlucoFMWindowCollection, GlucoFMTrainingResult, load_glucofm_windows, pretrain_glucofm, ArenaMetric, ModelArenaMetrics, FoundationArenaReport, load_foundation_evaluation, run_foundation_model_arena
No public classes, functions, or all-caps constants are declared directly in this module.
iints.research.academic_bundle
- Source:
src/iints/research/academic_bundle.py
- Summary: FAIR, reviewable metadata bundles for completed IINTS research runs.
Public Classes
| Class |
Signature |
Summary |
AcademicBundleResult |
AcademicBundleResult |
Artifacts written by :func:build_academic_bundle. |
Public Functions
build_academic_bundle(run_dir: Path, *, title: str | None = None, description: str | None = None, creator_name: str | None = None, creator_orcid: str | None = None, license_id: str = 'NOASSERTION', source_ids: Iterable[str] = ()) -> AcademicBundleResult
Public Constants
ACADEMIC_BUNDLE_FORMAT_VERSION
LICENSE_URLS
RO_CRATE_CONTEXT
RO_CRATE_PROFILE
RO_CRATE_VERSION
SENSITIVE_HEADER_TOKENS
iints.research.alphafold_engine
- Source:
src/iints/research/alphafold_engine.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
AlphaFoldGenomicsEngine |
AlphaFoldGenomicsEngine |
Retrieves residue-level AlphaFold confidence for structural context. |
AlphaFoldGenomicsEngine methods
evaluate_plddt_impact(uniprot_id: str, residue_index: int) -> Dict[str, Any]
iints.research.anatomy
- Source:
src/iints/research/anatomy.py
- Summary: GTEx tissue-expression renders for anatomy-aware model explanations.
Public Classes
| Class |
Signature |
Summary |
GTExError |
GTExError(RuntimeError) |
Raised when GTEx lookup or rendering fails. |
TissueExpression |
TissueExpression |
Median GTEx expression for one tissue. |
ExpressionRenderResult |
ExpressionRenderResult |
Interactive expression artifact produced for one gene. |
Public Functions
official_gene_symbol(gene: str) -> str
resolve_gtex_gencode_id(gene_symbol: str) -> str
fetch_gtex_expression(gene_symbol: str) -> list[TissueExpression]
fetch_gtex_expression_by_gencode(official_gene: str, gencode_id: str) -> list[TissueExpression]
render_expression(gene: str, *, output_dir: Path = DEFAULT_OUTPUT_DIR) -> ExpressionRenderResult | None
Public Constants
DEFAULT_OUTPUT_DIR
GENE_ALIASES
GTEX_API
USER_AGENT
iints.research.audit
- Source:
src/iints/research/audit.py
- Summary: No module docstring.
Public Functions
audit_subject_split_and_leakage(df: pd.DataFrame, *, history_steps: int, horizon_steps: int, feature_columns: List[str], target_column: str, subject_column: str = 'subject_id', segment_column: Optional[str] = None, val_fraction: float = 0.15, test_fraction: float = 0.15, seed: int = 42) -> Dict[str, Any]
iints.research.binding_evidence
- Source:
src/iints/research/binding_evidence.py
- Summary: Measured BindingDB affinity evidence for molecular-context research.
Public Classes
| Class |
Signature |
Summary |
BindingEvidenceResult |
BindingEvidenceResult |
No module docstring. |
Public Functions
query_bindingdb_uniprot(uniprot_accession: str, output_dir: Path, *, cutoff_nm: int = 10000, max_records: int = 5000, timeout_seconds: int = 30, _fetcher: Callable[[str, int], bytes] | None = None) -> BindingEvidenceResult
Public Constants
AFFINITY_PATTERN
BINDINGDB_API_BASE
BINDING_EVIDENCE_SCHEMA_VERSION
MAX_BINDINGDB_RESPONSE_BYTES
UNIPROT_PATTERN
iints.research.calibration_gate
- Source:
src/iints/research/calibration_gate.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ForecastCalibrationGate |
ForecastCalibrationGate |
No module docstring. |
Public Functions
load_calibration_gate_profiles(path: Optional[Path] = None) -> Dict[str, ForecastCalibrationGate]
evaluate_calibration_gate(report: Dict[str, Any], gate: ForecastCalibrationGate) -> Dict[str, Dict[str, Any]]
iints.research.cellml_models
- Source:
src/iints/research/cellml_models.py
- Summary: Static CellML inspection and independent OpenCOR validation.
Public Classes
| Class |
Signature |
Summary |
CellMLModelSummary |
CellMLModelSummary |
No module docstring. |
CellMLValidationResult |
CellMLValidationResult |
No module docstring. |
Public Functions
inspect_cellml_model(model_path: Path) -> CellMLModelSummary
cellml_summary_payload(summary: CellMLModelSummary, *, include_local_path: bool = True) -> dict[str, Any]
opencor_status(*, executable: Path | None = None) -> dict[str, Any]
validate_cellml_model(model_path: Path, output_dir: Path, *, timeout_seconds: int = 120, executable: Path | None = None) -> CellMLValidationResult
Public Constants
CELLML_VALIDATION_SCHEMA_VERSION
MAX_CELLML_BYTES
RECOGNISED_CELLML_NAMESPACES
iints.research.cgm_jepa
- Source:
src/iints/research/cgm_jepa.py
- Summary: No module docstring.
- Explicit exports:
CGMJEPAConfig, CGMJEPAEncoder, load_cgm_jepa_model, extract_cgm_jepa_embeddings
Public Classes
| Class |
Signature |
Summary |
CGMJEPAConfig |
CGMJEPAConfig |
Independent architecture reproduction based on arXiv:2605.00933. |
PatchEmbed1D |
PatchEmbed1D(nn.Module) |
Linear projection of 1D continuous glucose patches into latent embedding space. |
TransformerBlock |
TransformerBlock(nn.Module) |
Standard Pre-LN Transformer Encoder Block with multi-head self-attention. |
CGMJEPAEncoder |
CGMJEPAEncoder(nn.Module) |
IINTS implementation of the published CGM-JEPA context architecture. Processes 288-point 24h CGM windows and produces 96-dimensional latent representations. |
PatchEmbed1D methods
forward(self, x: torch.Tensor) -> torch.Tensor
forward(self, x: torch.Tensor) -> torch.Tensor
CGMJEPAEncoder methods
forward_features(self, x: torch.Tensor) -> torch.Tensor
forward(self, x: torch.Tensor, pool: str = 'mean') -> torch.Tensor
Public Functions
load_cgm_jepa_model(checkpoint_path: Path | str | None = None, device: str = 'cpu', *, allow_untrained: bool = False) -> CGMJEPAEncoder
extract_cgm_jepa_embeddings(glucose_traces: np.ndarray | Sequence[Sequence[float]], model: CGMJEPAEncoder | None = None, device: str = 'cpu', *, checkpoint_path: Path | str | None = None, allow_untrained: bool = False) -> np.ndarray
iints.research.cgm_jepa_bridge
- Source:
src/iints/research/cgm_jepa_bridge.py
- Summary: No module docstring.
- Explicit exports:
SimulationJEPAEmbeddingResult, prepare_cgm_jepa_window, bridge_simulation_to_jepa
Public Classes
| Class |
Signature |
Summary |
SimulationJEPAEmbeddingResult |
SimulationJEPAEmbeddingResult |
Exportable latent representation of a 24h simulation run using CGM-JEPA. |
SimulationJEPAEmbeddingResult methods
to_dict(self) -> dict[str, Any]
Public Functions
prepare_cgm_jepa_window(df: pd.DataFrame, glucose_col: str | None = None, time_col: str | None = None, target_steps: int = 288, step_minutes: float = 5.0) -> np.ndarray
bridge_simulation_to_jepa(simulation_input: Path | str | pd.DataFrame, output_dir: Path | str | None = None, model: CGMJEPAEncoder | None = None, device: str = 'cpu', checkpoint_path: Path | str | None = None, allow_untrained: bool = False) -> SimulationJEPAEmbeddingResult
iints.research.cgm_jepa_confounder
- Source:
src/iints/research/cgm_jepa_confounder.py
- Summary: No module docstring.
- Explicit exports:
ConfounderPairResult, PhysiologicalConfounderStudyResult, generate_confounded_physiological_pair, run_physiological_confounder_experiment
Public Classes
| Class |
Signature |
Summary |
ConfounderPairResult |
ConfounderPairResult |
Evaluation metrics comparing latent representations of confounded physiological scenarios. |
PhysiologicalConfounderStudyResult |
PhysiologicalConfounderStudyResult |
Summary of the systematic physiological confounding experiment across 50 paired cohorts. |
Public Functions
generate_confounded_physiological_pair(seed: int = 42) -> tuple[np.ndarray, np.ndarray, float, float]
run_physiological_confounder_experiment(output_dir: Path | str, num_pairs: int = 50, model: CGMJEPAEncoder | None = None, device: str = 'cpu') -> PhysiologicalConfounderStudyResult
iints.research.cgm_jepa_experiment
- Source:
src/iints/research/cgm_jepa_experiment.py
- Summary: No module docstring.
- Explicit exports:
PhysiologicalSensitivityResult, simulate_physiological_cgm_24h, add_sensor_noise_and_dropouts, run_cgm_jepa_parameter_experiment
Public Classes
| Class |
Signature |
Summary |
PhysiologicalSensitivityResult |
PhysiologicalSensitivityResult |
Held-out metrics for one checkpoint on a simulated parameter sweep. |
Public Functions
simulate_physiological_cgm_24h(insulin_sensitivity_factor: float = 1.0, basal_egp_mgdl_min: float = 1.2, carb_intake_g: float = 50.0, seed: int = 42) -> np.ndarray
add_sensor_noise_and_dropouts(clean_trace: np.ndarray, noise_std_mgdl: float = 12.0, dropout_fraction: float = 0.08, seed: int = 42) -> np.ndarray
run_cgm_jepa_parameter_experiment(output_dir: Path | str, num_simulations: int = 100, sweep_param: str = 'insulin_sensitivity', param_range: tuple[float, float] = (0.4, 2.0), model: CGMJEPAEncoder | None = None, device: str = 'cpu', checkpoint_path: Path | str | None = None, allow_untrained: bool = False, seed: int = 42) -> PhysiologicalSensitivityResult
iints.research.clinvar_engine
- Source:
src/iints/research/clinvar_engine.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ClinVarEngine |
ClinVarEngine |
Read ClinVar classifications through MyVariant.info without effect inference. |
ClinVarEngine methods
lookup_variant(cls, gene: str, variant: str, *, timeout_seconds: float = 10.0) -> dict[str, Any]
Public Functions
normalize_protein_variant(variant: str) -> str | None
Public Constants
iints.research.config
- Source:
src/iints/research/config.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PredictorConfig |
PredictorConfig |
No module docstring. |
TrainingConfig |
TrainingConfig |
No module docstring. |
PredictorConfig methods
history_steps(self) -> int
horizon_steps(self) -> int
iints.research.control
- Source:
src/iints/research/control.py
- Summary: No module docstring.
Public Functions
build_control_dataset_from_runs(run_dirs: Iterable[Tuple[str, Path]], *, output_path: Path, manifest_path: Path | None = None) -> Dict[str, Any]
summarize_control_dataset(df: pd.DataFrame) -> Dict[str, Any]
train_linear_imitation_controller(df: pd.DataFrame, *, ridge_lambda: float = 0.001) -> Dict[str, Any]
predict_linear_controller(model: Dict[str, Any], df: pd.DataFrame) -> np.ndarray
evaluate_controller_predictions(df: pd.DataFrame, predictions: np.ndarray) -> Dict[str, Any]
save_linear_controller(model: Dict[str, Any], path: Path) -> None
load_linear_controller(path: Path) -> Dict[str, Any]
Public Constants
CONTROL_FEATURE_COLUMNS
CONTROL_TARGET_COLUMN
iints.research.control_eval
- Source:
src/iints/research/control_eval.py
- Summary: No module docstring.
Public Functions
evaluate_controller_factories(factories: Dict[str, ControllerFactory], *, output_dir: Path, presets: Iterable[str] = DEFAULT_HELD_OUT_PRESETS, seeds: Iterable[int] = (101, 202, 303), duration_minutes: int = 1440, time_step_minutes: int = 5, sensor_profile: str = 'clinical_cgm') -> Dict[str, Any]
Public Constants
iints.research.copasi_models
- Source:
src/iints/research/copasi_models.py
- Summary: Safe COPASI model inspection and explicit configured-task execution.
Public Classes
| Class |
Signature |
Summary |
COPASIModelSummary |
COPASIModelSummary |
Static summary of a COPASI-ML document. |
COPASIRunResult |
COPASIRunResult |
No module docstring. |
Public Functions
inspect_copasi_model(model_path: Path) -> COPASIModelSummary
copasi_summary_payload(summary: COPASIModelSummary, *, include_local_path: bool = True) -> dict[str, Any]
copasi_status(*, executable: Path | None = None) -> dict[str, Any]
run_copasi_model(model_path: Path, output_dir: Path, *, scheduled_task: str | None = None, timeout_seconds: int = 900, allow_external_execution: bool = False, executable: Path | None = None) -> COPASIRunResult
Public Constants
COPASI_RUN_SCHEMA_VERSION
MAX_COPASI_BYTES
iints.research.data_blend
- Source:
src/iints/research/data_blend.py
- Summary: No module docstring.
Public Functions
blend_predictor_datasets(sources: Iterable[Tuple[str, Path]], *, output_path: Path, manifest_path: Path | None = None) -> Dict[str, Any]
Public Constants
PREDICTOR_OPTIONAL_COLUMNS
PREDICTOR_REQUIRED_COLUMNS
PROVENANCE_COLUMNS
iints.research.dataset
- Source:
src/iints/research/dataset.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
FeatureScaler |
FeatureScaler |
Fit-transform scaler for LSTM feature arrays. |
FeatureScaler methods
fit(self, X: np.ndarray) -> 'FeatureScaler'
transform(self, X: np.ndarray) -> np.ndarray
fit_transform(self, X: np.ndarray) -> np.ndarray
inverse_transform(self, X: np.ndarray) -> np.ndarray
to_dict(self) -> dict
from_dict(cls, d: dict) -> 'FeatureScaler'
Public Functions
build_sequences(df: pd.DataFrame, history_steps: int, horizon_steps: int, feature_columns: List[str], target_column: str, subject_column: Optional[str] = 'subject_id', segment_column: Optional[str] = None, predict_delta: bool = False) -> Tuple[np.ndarray, np.ndarray]
subject_split(df: pd.DataFrame, val_fraction: float = 0.15, test_fraction: float = 0.15, subject_column: str = 'subject_id', seed: int = 42) -> Tuple[pd.DataFrame, pd.DataFrame, pd.DataFrame]
save_parquet(df: pd.DataFrame, path: Path) -> None
save_dataset(df: pd.DataFrame, path: Path) -> None
load_parquet(path: Path) -> pd.DataFrame
load_dataset(path: Path) -> pd.DataFrame
compute_dataset_lineage(df: pd.DataFrame, source_path: Optional[Path] = None, subject_column: str = 'subject_id', time_column: str = 'time_minutes') -> Dict[str, Any]
concat_runs(frames: Iterable[pd.DataFrame]) -> pd.DataFrame
basic_stats(df: pd.DataFrame, columns: List[str]) -> Dict[str, float]
iints.research.dual_stream
- Source:
src/iints/research/dual_stream.py
- Summary: No module docstring.
- Explicit exports:
DualStreamDecomposition, decompose_dual_stream, extract_dual_stream_pre_meal_features
Public Classes
| Class |
Signature |
Summary |
DualStreamDecomposition |
DualStreamDecomposition |
Decomposition of continuous glucose data into multiscale baseline and event streams. |
DualStreamDecomposition methods
length(self) -> int
to_dataframe(self) -> pd.DataFrame
Public Functions
decompose_dual_stream(glucose_values: Sequence[float] | np.ndarray, sampling_interval_minutes: float = 5.0, filter_window_minutes: float = 120.0, filter_type: str = 'gaussian') -> DualStreamDecomposition
extract_dual_stream_pre_meal_features(glucose_pre_meal: Sequence[float] | np.ndarray, sampling_interval_minutes: float = 5.0, filter_window_minutes: float = 120.0, time_of_day_minutes: float = 0.0) -> dict[str, float]
iints.research.eucys_playbook_generator
- Source:
src/iints/research/eucys_playbook_generator.py
- Summary: No module docstring.
- Explicit exports:
EUCYSFigureMetadata, EUCYSJuryPortfolio, plot_clarke_error_grid, plot_glycemic_tir_distribution, plot_sc_islet_gsis_dynamics, plot_regenerative_graft_survival, plot_edge_hardware_latency_budget, plot_quantum_safe_mdmp_security, generate_complete_eucys_jury_portfolio
Public Classes
| Class |
Signature |
Summary |
EUCYSFigureMetadata |
EUCYSFigureMetadata |
Metadata describing a single scientific figure for the jury dossier. |
EUCYSJuryPortfolio |
EUCYSJuryPortfolio |
Complete EUCYS Jury Portfolio with all generated assets. |
to_dict(self) -> dict[str, Any]
EUCYSJuryPortfolio methods
to_dict(self) -> dict[str, Any]
Public Functions
plot_clarke_error_grid(output_path: Path | str, reference = None, predicted = None) -> Path
plot_glycemic_tir_distribution(output_path: Path | str) -> Path
plot_sc_islet_gsis_dynamics(output_path: Path | str) -> Path
plot_regenerative_graft_survival(output_path: Path | str) -> Path
plot_edge_hardware_latency_budget(output_path: Path | str) -> Path
plot_quantum_safe_mdmp_security(output_path: Path | str) -> Path
generate_complete_eucys_jury_portfolio(output_dir: Path | str = 'results/eucys_jury_dossier', ega_pairs: tuple | None = None, arena_evaluation_artifacts: Sequence[Path | str] | None = None, confounder_evidence: Path | str | None = None, dual_sensor_evidence: Path | str | None = None, safety_trace: Path | str | None = None) -> EUCYSJuryPortfolio
iints.research.evaluation
- Source:
src/iints/research/evaluation.py
- Summary: No module docstring.
Public Functions
forecast_error_report(observed: np.ndarray, predicted: np.ndarray, predicted_std: Optional[np.ndarray] = None) -> Dict[str, Any]
hypoglycemia_detection_report(observed: np.ndarray, predicted: np.ndarray, *, threshold_mgdl: float = 70.0) -> Dict[str, Any]
uncertainty_reliability_report(observed: np.ndarray, predicted: np.ndarray, predicted_std: np.ndarray, *, bins: int = 5, confidence: float = 0.95) -> Dict[str, Any]
subgroup_error_report(observed: np.ndarray, predicted: np.ndarray, groups: Sequence[Any] | np.ndarray, *, predicted_std: Optional[np.ndarray] = None) -> Dict[str, Dict[str, Any]]
feature_drift_report(reference_features: np.ndarray, candidate_features: np.ndarray, *, feature_names: Iterable[str]) -> Dict[str, Any]
iints.research.external_models_common
- Source:
src/iints/research/external_models_common.py
- Summary: Shared safety and provenance helpers for optional external research engines.
Public Functions
utc_now() -> str
timestamp_token() -> str
sha256_bytes(payload: bytes) -> str
local_name(tag: str) -> str
namespace(tag: str) -> str
normalised_bool(value: str | None) -> bool | None
read_local_file(path: Path, *, label: str, suffixes: Iterable[str], max_bytes: int, reject_xml_entities: bool = False) -> tuple[Path, bytes]
write_json(path: Path, payload: dict[str, Any]) -> None
safe_stem(value: str, *, fallback: str = 'model') -> str
find_executable(*, environment_variable: str, names: Iterable[str], common_paths: Iterable[Path] = ()) -> Path | None
run_external_command(command: list[str], *, cwd: Path | None = None, timeout_seconds: int = 30, environment: dict[str, str] | None = None) -> subprocess.CompletedProcess[str]
iints.research.fmi_models
- Source:
src/iints/research/fmi_models.py
- Summary: FMI archive inspection and explicitly trusted FMPy execution.
Public Classes
| Class |
Signature |
Summary |
FMUModelSummary |
FMUModelSummary |
No module docstring. |
FMURunResult |
FMURunResult |
No module docstring. |
Public Functions
inspect_fmu_model(model_path: Path) -> FMUModelSummary
fmu_summary_payload(summary: FMUModelSummary, *, include_local_path: bool = True) -> dict[str, Any]
fmpy_status() -> dict[str, Any]
run_fmu_model(model_path: Path, output_dir: Path, *, start: float, end: float, output_interval: float, variables: Iterable[str] = (), timeout_seconds: int = 300, allow_native_execution: bool = False, _engine_module: Any | None = None) -> FMURunResult
Public Constants
FMI_RUN_SCHEMA_VERSION
MAX_FMU_BYTES
MAX_FMU_ENTRIES
MAX_FMU_UNCOMPRESSED_BYTES
MAX_MODEL_DESCRIPTION_BYTES
iints.research.forecasting
- Source:
src/iints/research/forecasting.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ForecastConfig |
ForecastConfig |
Configuration for research-only glucose forecasting helpers. |
PhysiologyAwareBaseline |
PhysiologyAwareBaseline |
Transparent glucose forecast baseline using trend, IOB, COB, stress and activity. |
ForecastConfig methods
history_steps(self) -> int
horizon_steps(self) -> int
PhysiologyAwareBaseline methods
name(self) -> str
predict(self, X: np.ndarray) -> np.ndarray
Public Functions
assess_forecast_risk(predicted_glucose: Sequence[float] | np.ndarray, *, current_glucose: Optional[float] = None, predicted_std: Optional[Sequence[float] | np.ndarray | float] = None, config: ForecastConfig = ForecastConfig()) -> Dict[str, Any]
attach_forecasts_to_frame(df: pd.DataFrame, *, predictor_service: Optional[Any] = None, config: ForecastConfig = ForecastConfig(), feature_columns: Optional[Sequence[str]] = None, feature_overrides: Optional[Mapping[str, float]] = None, mc_samples: int = 30) -> pd.DataFrame
summarize_forecast_frame(frame: pd.DataFrame, *, config: ForecastConfig = ForecastConfig()) -> Dict[str, Any]
resolve_forecast_input(path: Path) -> Path
write_forecast_bundle(input_path: Path, output_dir: Path, *, predictor_service: Optional[Any] = None, config: ForecastConfig = ForecastConfig(), feature_columns: Optional[Sequence[str]] = None, feature_overrides: Optional[Mapping[str, float]] = None, mc_samples: int = 30) -> Dict[str, Any]
Public Constants
DEFAULT_FORECAST_FEATURE_COLUMNS
iints.research.foundation_arena
- Source:
src/iints/research/foundation_arena.py
- Summary: Evidence-backed comparison of CGM representation models.
- Explicit exports:
FOUNDATION_ARENA_SCHEMA, ArenaMetric, ModelArenaMetrics, FoundationArenaReport, load_foundation_evaluation, run_foundation_model_arena
Public Classes
| Class |
Signature |
Summary |
ArenaMetric |
ArenaMetric |
One measured metric with enough metadata to interpret its direction. |
ModelArenaMetrics |
ModelArenaMetrics |
A model evaluation loaded from a traceable benchmark artifact. |
FoundationArenaReport |
FoundationArenaReport |
Aggregate comparison built entirely from supplied evidence artifacts. |
ArenaMetric methods
to_dict(self) -> dict[str, Any]
ModelArenaMetrics methods
to_dict(self) -> dict[str, Any]
FoundationArenaReport methods
to_dict(self) -> dict[str, Any]
Public Functions
load_foundation_evaluation(path: Path | str) -> ModelArenaMetrics
run_foundation_model_arena(output_dir: Path | str = 'results/foundation_arena', evaluation_artifacts: Sequence[Path | str] | None = None, *, n_benchmark_trials: int | None = None) -> FoundationArenaReport
Public Constants
iints.research.genetics
- Source:
src/iints/research/genetics.py
- Summary: ClinVar-backed genotype stressors for educational digital-twin experiments.
Public Classes
| Class |
Signature |
Summary |
ClinVarError |
ClinVarError(RuntimeError) |
Raised when a ClinVar request or response cannot be interpreted. |
ClinVarVariant |
ClinVarVariant |
Small public ClinVar summary suitable for CLI display. |
Public Functions
fetch_clinvar_pathogenic(gene: str, *, retmax: int = 5) -> list[ClinVarVariant]
simulate_mutation(gene: str) -> list[ClinVarVariant]
Public Constants
GENE_EFFECTS
NCBI_EUTILS
USER_AGENT
iints.research.genomics_engine
- Source:
src/iints/research/genomics_engine.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
GenomicsEngine |
GenomicsEngine |
Bridge molecular mutation examples to patient-level glycemic simulations. |
GenomicsEngine methods
evaluate_mutation(gene: str, variant: str) -> dict[str, Any]
run_multi_scale_simulation(gene: str, variant: str, out_dir: Path, *, duration_minutes: int = 360, seed: int = 42) -> Tuple[Path, dict[str, Any]]
Public Constants
iints.research.glucofm
- Source:
src/iints/research/glucofm.py
- Summary: No module docstring.
- Explicit exports:
GLUCOFM_MODEL_FAMILY, GLUCOFM_CHECKPOINT_FORMAT, GLUCOFM_PAPER_REVISION, GLUCOFM_PAPER_URL, GLUCOFM_IMPLEMENTATION_KIND, GlucoFMConfig, AlignedCGMWindow, GlucoFMCheckpointMetadata, GlucoFMEmbeddingResult, CausalMaskAwareGaussianFilter, GlucoFMStreamEncoder, GlucoFMTokenOutput, GlucoFMDualStreamEncoder, GlucoFMDownstreamProbes, GlucoFMPretrainingOutput, GlucoFMPretrainer, align_cgm_window, mask_aware_normalize, nearest_observed_rate_of_change, glucofm_ema_momentum, augment_glucofm_batch, build_glucofm_foundation_model, save_glucofm_checkpoint, load_glucofm_checkpoint, embed_cgm_with_glucofm_result, embed_cgm_with_glucofm, sha256_file
Public Classes
| Class |
Signature |
Summary |
GlucoFMConfig |
GlucoFMConfig |
Paper-aligned defaults for the GlucoFM v2 architecture. |
AlignedCGMWindow |
AlignedCGMWindow |
One 24-hour chronological CGM grid with its physical observation mask. |
GlucoFMCheckpointMetadata |
GlucoFMCheckpointMetadata |
Provenance stored alongside every reusable encoder checkpoint. |
GlucoFMEmbeddingResult |
GlucoFMEmbeddingResult |
No module docstring. |
CausalMaskAwareGaussianFilter |
CausalMaskAwareGaussianFilter(nn.Module) |
Learnable one-sided Gaussian filter from GlucoFM v2 equations 11-13. |
GlucoFMStreamEncoder |
GlucoFMStreamEncoder(nn.Module) |
Paper-aligned state/event patch embedder (pre-Transformer stream encoder). |
GlucoFMTokenOutput |
GlucoFMTokenOutput |
No module docstring. |
GlucoFMDualStreamEncoder |
GlucoFMDualStreamEncoder(nn.Module) |
Independent paper-aligned implementation of the GlucoFM v2 encoder. |
GlucoFMDownstreamProbes |
GlucoFMDownstreamProbes(nn.Module) |
Untrained research heads; callers must fit these on subject-disjoint data. |
GlucoFMPretrainingOutput |
GlucoFMPretrainingOutput |
No module docstring. |
GlucoFMPretrainer |
GlucoFMPretrainer(nn.Module) |
EMA target branch and the two GlucoFM v2 latent objectives. |
GlucoFMConfig methods
patch_count(self) -> int
fused_dim(self) -> int
to_dict(self) -> dict[str, Any]
AlignedCGMWindow methods
observed_count(self) -> int
coverage(self) -> float
to_dict(self) -> dict[str, Any]
from_mapping(cls, payload: Mapping[str, Any]) -> GlucoFMCheckpointMetadata
GlucoFMEmbeddingResult methods
provenance_dict(self) -> dict[str, Any]
CausalMaskAwareGaussianFilter methods
sigma(self) -> torch.Tensor
kernel(self, *, device: torch.device, dtype: torch.dtype) -> torch.Tensor
forward(self, values: torch.Tensor, observation_mask: torch.Tensor) -> torch.Tensor
GlucoFMStreamEncoder methods
forward(self, waveform_patches: torch.Tensor, dynamic_patches: torch.Tensor, statistics: torch.Tensor) -> torch.Tensor
GlucoFMDualStreamEncoder methods
decompose_signal(self, cgm: torch.Tensor, observation_mask: torch.Tensor | None = None) -> tuple[torch.Tensor, torch.Tensor]
encode_patch_tokens(self, cgm_24h: torch.Tensor, observation_mask: torch.Tensor, absolute_grid_indices: torch.Tensor | None = None) -> GlucoFMTokenOutput
encode_context(self, fused_tokens: torch.Tensor) -> torch.Tensor
forward_tokens(self, cgm_24h: torch.Tensor, observation_mask: torch.Tensor | None = None, absolute_grid_indices: torch.Tensor | None = None) -> torch.Tensor
forward(self, cgm_24h: torch.Tensor, observation_mask: torch.Tensor | None = None, absolute_grid_indices: torch.Tensor | None = None) -> torch.Tensor
GlucoFMDownstreamProbes methods
forward(self, representation: torch.Tensor, meal_context: torch.Tensor | None = None) -> dict[str, torch.Tensor]
GlucoFMPretrainer methods
sample_patch_mask(self, batch_size: int, *, device: torch.device, generator: torch.Generator | None = None) -> torch.Tensor
forward(self, cgm_24h: torch.Tensor, observation_mask: torch.Tensor, absolute_grid_indices: torch.Tensor | None = None, patch_mask: torch.Tensor | None = None, generator: torch.Generator | None = None) -> GlucoFMPretrainingOutput
update_target(self, momentum: float) -> None
Public Functions
sha256_file(path: Path | str) -> str
align_cgm_window(glucose_values: Sequence[float] | np.ndarray | pd.Series, timestamps: Sequence[Any] | np.ndarray | pd.Series | None = None, *, start_time_minutes: int = 0, binning: str = 'floor', config: GlucoFMConfig | None = None) -> AlignedCGMWindow
mask_aware_normalize(values: torch.Tensor, observation_mask: torch.Tensor, *, epsilon: float = 1e-06) -> tuple[torch.Tensor, torch.Tensor, torch.Tensor]
nearest_observed_rate_of_change(values: torch.Tensor, observation_mask: torch.Tensor, *, max_backoff: int = 9) -> tuple[torch.Tensor, torch.Tensor]
glucofm_ema_momentum(step: int, total_steps: int, initial: float = 0.997) -> float
augment_glucofm_batch(values: torch.Tensor, observation_mask: torch.Tensor, *, generator: torch.Generator | None = None) -> tuple[torch.Tensor, torch.Tensor]
build_glucofm_foundation_model(config: GlucoFMConfig | None = None) -> tuple[GlucoFMDualStreamEncoder, GlucoFMDownstreamProbes]
save_glucofm_checkpoint(path: Path | str, encoder: GlucoFMDualStreamEncoder, metadata: GlucoFMCheckpointMetadata) -> Path
load_glucofm_checkpoint(path: Path | str, *, device: str | torch.device = 'cpu', require_trained: bool = True) -> tuple[GlucoFMDualStreamEncoder, GlucoFMCheckpointMetadata]
embed_cgm_with_glucofm_result(cgm_series: Sequence[float] | np.ndarray | pd.Series, *, checkpoint: Path | str, timestamps: Sequence[Any] | np.ndarray | pd.Series | None = None, start_time_minutes: int = 0, binning: str = 'floor', device: str | torch.device = 'cpu') -> GlucoFMEmbeddingResult
embed_cgm_with_glucofm(cgm_series: Sequence[float] | np.ndarray | pd.Series, encoder: GlucoFMDualStreamEncoder | None = None, *, checkpoint: Path | str | None = None, timestamps: Sequence[Any] | np.ndarray | pd.Series | None = None, start_time_minutes: int = 0, binning: str = 'floor', allow_untrained: bool = False) -> np.ndarray
Public Constants
GLUCOFM_CHECKPOINT_FORMAT
GLUCOFM_IMPLEMENTATION_KIND
GLUCOFM_MODEL_FAMILY
GLUCOFM_PAPER_REVISION
GLUCOFM_PAPER_URL
iints.research.glucofm_training
- Source:
src/iints/research/glucofm_training.py
- Summary: No module docstring.
- Explicit exports:
PRETRAINING_STATE_FORMAT, GlucoFMWindowCollection, GlucoFMTrainingResult, load_glucofm_windows, pretrain_glucofm
Public Classes
| Class |
Signature |
Summary |
GlucoFMWindowCollection |
GlucoFMWindowCollection |
No module docstring. |
GlucoFMTrainingResult |
GlucoFMTrainingResult |
No module docstring. |
GlucoFMWindowCollection methods
window_count(self) -> int
subject_count(self) -> int
mean_coverage(self) -> float
subset(self, indices: Sequence[int]) -> GlucoFMWindowCollection
GlucoFMTrainingResult methods
to_dict(self) -> dict[str, Any]
Public Functions
load_glucofm_windows(source: Path | str, *, glucose_column: str | None = None, timestamp_column: str | None = None, subject_column: str | None = 'subject_id', label_column: str | None = None, max_gap_minutes: float = 60.0, min_observations: int = 48, binning: str = 'floor', max_windows: int | None = None) -> GlucoFMWindowCollection
pretrain_glucofm(source: Path | str, output_dir: Path | str, *, glucose_column: str | None = None, timestamp_column: str | None = None, subject_column: str | None = 'subject_id', epochs: int = 120, batch_size: int = 128, learning_rate: float = 0.0001, sigma_learning_rate: float = 0.001, weight_decay: float = 0.01, validation_fraction: float = 0.2, min_observations: int = 48, max_gap_minutes: float = 60.0, max_windows: int | None = None, seed: int = 42, device: str = 'auto', allow_single_subject: bool = False, resume_state: Path | str | None = None, config: GlucoFMConfig | None = None) -> GlucoFMTrainingResult
Public Constants
iints.research.glucose_model
- Source:
src/iints/research/glucose_model.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
GlucoseTrainingPack |
GlucoseTrainingPack |
No module docstring. |
GlucoseModelSpec |
GlucoseModelSpec |
No module docstring. |
GlucoseModelComparisonBundle |
GlucoseModelComparisonBundle |
No module docstring. |
GlucoseTrainingPack methods
to_dict(self) -> dict[str, Any]
GlucoseModelComparisonBundle methods
to_dict(self) -> dict[str, Any]
Public Functions
standardize_glucose_forecast_frame(df: pd.DataFrame, *, source_label: str, time_step_minutes: int = 5, subject_prefix: Optional[str] = None, max_gap_multiplier: float = 2.5, glucose_bounds_mgdl: tuple[float, float] = (20.0, 600.0)) -> pd.DataFrame
glucose_model_config_payload(*, profile: str = 'long', history_minutes: int = 360, horizon_minutes: int = 120, time_step_minutes: int = 5, feature_columns: Optional[Sequence[str]] = None) -> dict[str, Any]
write_glucose_model_config(path: Path, **kwargs: Any) -> dict[str, Any]
build_glucose_training_pack(input_paths: Sequence[Path], output_dir: Path, *, labels: Optional[Sequence[str]] = None, output_format: str = 'csv', profile: str = 'long', history_minutes: int = 360, horizon_minutes: int = 120, time_step_minutes: int = 5) -> GlucoseTrainingPack
public_manifest_from_private(manifest: Mapping[str, Any]) -> dict[str, Any]
write_huggingface_export_bundle(*, model_dir: Path, output_dir: Path, repo_id: Optional[str] = None, dataset_manifest: Optional[Path] = None, comparison_dir: Optional[Path] = None, model_name: str = GLUCOSE_MODEL_ID) -> dict[str, str]
render_huggingface_model_card(*, model_name: str, repo_id: Optional[str], training_report: Mapping[str, Any], public_manifest: Optional[Mapping[str, Any]], comparison_metrics: Optional[Mapping[str, Any]] = None, comparison_artifacts: Optional[Mapping[str, str]] = None) -> str
render_hf_privacy_notes(*, public_manifest: Optional[Mapping[str, Any]]) -> str
render_hf_limitations(*, comparison_metrics: Optional[Mapping[str, Any]]) -> str
render_hf_comparison_interpretation(*, comparison_metrics: Optional[Mapping[str, Any]]) -> str
render_hf_inference_example() -> str
render_hf_sample_trace_csv(rows: int = 80) -> str
render_hf_publishing_notes(*, repo_id: Optional[str]) -> str
parse_model_specs(values: Sequence[str]) -> list[GlucoseModelSpec]
horizon_error_rows(*, label: str, observed: np.ndarray, predicted: np.ndarray, time_step_minutes: int) -> list[dict[str, Any]]
physiological_violation_report(X: np.ndarray, predicted: np.ndarray, *, feature_columns: Sequence[str], time_step_minutes: int, absolute_low_mgdl: float = 20.0, absolute_high_mgdl: float = 600.0, display_low_mgdl: float = 35.0, display_high_mgdl: float = 450.0, max_roc_mgdl_min: float = 3.0, suspicious_roc_mgdl_min: float = 2.0) -> dict[str, Any]
compare_glucose_models(*, data_path: Path, output_dir: Path, model_specs: Sequence[GlucoseModelSpec] = (), config_path: Optional[Path] = None, include_baselines: bool = True, mc_samples: int = 0, max_roc_mgdl_min: float = 3.0) -> GlucoseModelComparisonBundle
Public Constants
GLUCOSE_MODEL_CARD_VERSION
GLUCOSE_MODEL_FEATURE_COLUMNS
GLUCOSE_MODEL_ID
iints.research.jetson_hf_trainer
- Source:
src/iints/research/jetson_hf_trainer.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
JetsonHFTrainingResult |
JetsonHFTrainingResult |
No module docstring. |
Public Functions
utc_now() -> str
finite_float(value: Any, default: float = math.inf) -> float
model_score(row: Mapping[str, Any], *, physiology_weight: float = 0.1, hypo_weight: float = 0.2) -> float
append_leaderboard_row(path: Path, row: Mapping[str, Any]) -> None
run_logged(cmd: Sequence[str], *, log_path: Path, env: Optional[Mapping[str, str]] = None, timeout_minutes: Optional[float] = None) -> None
run_jetson_hf_training(*, base_repo_id: Optional[str] = None, target_repo_id: Optional[str] = None, dataset: Path, work_dir: Path, local_base_dir: Optional[Path] = None, revision: Optional[str] = None, profile: str = 'quick', max_trials: int = 1, timeout_minutes: float = 45.0, cooldown_seconds: float = 10.0, epochs: int = 8, batch_size: int = 64, seed: int = 42, min_lr: float = 1e-05, max_lr: float = 0.0005, min_pinn_lambda: float = 0.05, max_pinn_lambda: float = 0.8, weight_decay_choices: Optional[Iterable[float]] = None, min_score_improvement: float = 0.0, physiology_weight: float = 0.1, hypo_weight: float = 0.2, dataset_manifest: Optional[Path] = None, upload_mode: str = 'none', private_upload: bool = True, force_download: bool = False, hf_home: Optional[Path] = None) -> JetsonHFTrainingResult
Public Constants
JETSON_HF_LEADERBOARD_FIELDS
iints.research.local_ai
- Source:
src/iints/research/local_ai.py
- Summary: No module docstring.
Public Functions
build_predictor_dataset_from_runs(run_dirs: Iterable[Tuple[str, Path]], *, output_path: Path, manifest_path: Path | None = None) -> Dict[str, Any]
run_local_ai_lab(run_dirs: Iterable[Tuple[str, Path]], *, output_dir: Path, repo_root: Path, train_predictor: bool = True, predictor_config_path: Path | None = None, train_neural: bool = True, evaluate: bool = True, evaluation_presets: Iterable[str] = DEFAULT_HELD_OUT_PRESETS, evaluation_seeds: Iterable[int] = (101, 202, 303), evaluation_duration_minutes: int = 1440) -> Dict[str, Any]
Public Constants
iints.research.local_ai_gate
- Source:
src/iints/research/local_ai_gate.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
LocalAISafetyProfile |
LocalAISafetyProfile |
No module docstring. |
LocalAIGateResult |
LocalAIGateResult |
No module docstring. |
LocalAIGateResult methods
to_dict(self) -> Dict[str, Any]
Public Functions
review_controller_training_artifacts(controller_summary: Dict[str, Any], *, train_metrics: Dict[str, Any] | None = None, profile: LocalAISafetyProfile = DEFAULT_LOCAL_AI_SAFETY_PROFILE) -> LocalAIGateResult
review_closed_loop_evaluation(algorithms: Dict[str, Dict[str, Any]], *, baseline_name: str = 'clinical_baseline', profile: LocalAISafetyProfile = DEFAULT_LOCAL_AI_SAFETY_PROFILE) -> LocalAIGateResult
Public Constants
DEFAULT_LOCAL_AI_SAFETY_PROFILE
iints.research.losses
- Source:
src/iints/research/losses.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.research.mechanistic_models
- Source:
src/iints/research/mechanistic_models.py
- Summary: Safe inspection and optional execution of external SBML reference models.
Public Classes
| Class |
Signature |
Summary |
SBMLModelSummary |
SBMLModelSummary |
Static, non-executing summary of one local SBML document. |
MechanisticRunResult |
MechanisticRunResult |
Files produced by an isolated libRoadRunner SBML simulation. |
Public Functions
inspect_sbml_model(model_path: Path) -> SBMLModelSummary
sbml_summary_payload(summary: SBMLModelSummary, *, include_local_path: bool = True) -> dict[str, Any]
roadrunner_status() -> dict[str, Any]
run_sbml_model(model_path: Path, output_dir: Path, *, start: float = 0.0, end: float = 1440.0, points: int = 289, variables: Iterable[str] = (), source_url: str | None = None, model_license: str = 'NOASSERTION', _engine_module: Any | None = None) -> MechanisticRunResult
Public Constants
MAX_SBML_BYTES
MECHANISTIC_RUN_SCHEMA_VERSION
SUPPORTED_SBML_SUFFIXES
iints.research.metrics
- Source:
src/iints/research/metrics.py
- Summary: No module docstring.
Public Functions
regression_metrics(y_true: np.ndarray, y_pred: np.ndarray) -> Dict[str, float]
band_regression_metrics(y_true: np.ndarray, y_pred: np.ndarray, low_threshold: float = 70.0, high_threshold: float = 180.0) -> Dict[str, Dict[str, float]]
interval_coverage_metrics(y_true: np.ndarray, mean_pred: np.ndarray, std_pred: np.ndarray, confidence: float = 0.95, low_threshold: float = 70.0, high_threshold: float = 180.0) -> Dict[str, Any]
iints.research.model_registry
- Source:
src/iints/research/model_registry.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PromotionResult |
PromotionResult |
No module docstring. |
to_dict(self) -> Dict[str, Any]
Public Functions
load_registry(path: Path) -> List[Dict[str, Any]]
write_registry(path: Path, rows: List[Dict[str, Any]]) -> None
append_registry_entry(path: Path, entry: Dict[str, Any]) -> None
list_registry(path: Path) -> List[Dict[str, Any]]
promote_registry_run(path: Path, *, run_id: str, stage: ModelStage, force: bool = False) -> PromotionResult
iints.research.neural_control
- Source:
src/iints/research/neural_control.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
NeuralControllerConfig |
NeuralControllerConfig |
No module docstring. |
Public Functions
instantiate_neural_controller_model(payload: Dict[str, Any]) -> Any
train_neural_imitation_controller(df: pd.DataFrame, *, config: NeuralControllerConfig | None = None) -> Dict[str, Any]
predict_neural_controller(payload: Dict[str, Any], df: pd.DataFrame) -> np.ndarray
save_neural_controller(payload: Dict[str, Any], path: Path) -> None
load_neural_controller(path: Path) -> Dict[str, Any]
iints.research.pharmacology
- Source:
src/iints/research/pharmacology.py
- Summary: ChEMBL-backed insulin analogue lookup with deterministic SDK PK mapping.
Public Classes
| Class |
Signature |
Summary |
ChEMBLError |
ChEMBLError(RuntimeError) |
Raised when ChEMBL cannot be queried or parsed safely. |
ChEMBLMolecule |
ChEMBLMolecule |
Small molecule summary from ChEMBL search. |
InsulinPKProfile |
InsulinPKProfile |
Deterministic SDK pharmacokinetic profile for an insulin class. |
Public Functions
fetch_chembl_drug(drug_name: str) -> ChEMBLMolecule | None
sdk_pk_profile(drug_name: str) -> InsulinPKProfile
analyze_insulin(drug_name: str) -> tuple[ChEMBLMolecule | None, InsulinPKProfile]
Public Constants
CHEMBL_SEARCH_URL
INSULIN_PK_PROFILES
USER_AGENT
iints.research.physiology
- Source:
src/iints/research/physiology.py
- Summary: Physiology pathway renders for explanatory research assets.
Public Classes
| Class |
Signature |
Summary |
PhysiologyPathwayError |
PhysiologyPathwayError(RuntimeError) |
Raised when a pathway network cannot be downloaded safely. |
PathwayNetwork |
PathwayNetwork |
One preconfigured physiology network from STRING DB. |
PathwayRenderResult |
PathwayRenderResult |
Image artifact emitted by a successful STRING render. |
Public Functions
fetch_string_network(network_name: str, out_dir: Path = DEFAULT_OUTPUT_DIR) -> PathwayRenderResult
render_pathways(network: str, *, output_dir: Path = DEFAULT_OUTPUT_DIR) -> list[PathwayRenderResult]
Public Constants
DEFAULT_OUTPUT_DIR
NETWORKS
STRING_NETWORK_URL
iints.research.physiology_calibration
- Source:
src/iints/research/physiology_calibration.py
- Summary: Physiology calibration helpers for real CGM datasets.
Public Classes
| Class |
Signature |
Summary |
CalibrationColumns |
CalibrationColumns |
Resolved column names used by the physiology calibration audit. |
Public Functions
resolve_calibration_columns(dataframe: pd.DataFrame, *, time_column: str | None = None, glucose_column: str | None = None, carb_column: str | None = None, insulin_column: str | None = None, exercise_column: str | None = None, subject_column: str | None = None) -> CalibrationColumns
load_calibration_dataframe(path: Path) -> pd.DataFrame
standardize_calibration_dataframe(dataframe: pd.DataFrame, columns: CalibrationColumns | None = None) -> pd.DataFrame
glucose_summary(frame: pd.DataFrame) -> dict[str, Any]
meal_response_summary(frame: pd.DataFrame, *, min_carbs_g: float = 8.0, pre_window_min: float = 30.0, post_window_min: float = 240.0) -> dict[str, Any]
exercise_response_summary(frame: pd.DataFrame, *, pre_window_min: float = 30.0, post_window_min: float = 90.0) -> dict[str, Any]
dawn_summary(frame: pd.DataFrame) -> dict[str, Any]
build_parameter_hints(glucose: Mapping[str, Any], meal: Mapping[str, Any], dawn: Mapping[str, Any]) -> dict[str, Any]
compare_simulation_to_real(real: pd.DataFrame, simulation: pd.DataFrame | None) -> dict[str, Any] | None
physiology_calibration_report(real_dataframe: pd.DataFrame, *, simulation_dataframe: pd.DataFrame | None = None, columns: CalibrationColumns | None = None, simulation_columns: CalibrationColumns | None = None) -> dict[str, Any]
Public Constants
CARB_COLUMN_CANDIDATES
EXERCISE_COLUMN_CANDIDATES
GLUCOSE_COLUMN_CANDIDATES
INSULIN_COLUMN_CANDIDATES
SUBJECT_COLUMN_CANDIDATES
TIME_COLUMN_CANDIDATES
iints.research.ppgr
- Source:
src/iints/research/ppgr.py
- Summary: No module docstring.
- Explicit exports:
PPGRTrajectoryMetrics, PPGRBenchmarkResult, BasePPGRModel, CarbOnlyLinearPPGR, MultiMacroLinearPPGR, ContextFeatureRidgePPGR, DualStreamGlucoFMPPGR, compute_trajectory_metrics, build_ppgr_dataset, run_ppgr_benchmark
Public Classes
| Class |
Signature |
Summary |
PPGRTrajectoryMetrics |
PPGRTrajectoryMetrics |
Evaluation metrics for a 2-hour postprandial glucose trajectory. |
PPGRBenchmarkResult |
PPGRBenchmarkResult |
Summary of model comparison across multiple PPGR architectures. |
BasePPGRModel |
BasePPGRModel |
Base interface for postprandial glucose trajectory predictors. |
CarbOnlyLinearPPGR |
CarbOnlyLinearPPGR(BasePPGRModel) |
Standard carbohydrate-only linear regression model (1 feature: carb_grams). Predicts Delta G(t) for each step t in [1..24]. |
MultiMacroLinearPPGR |
MultiMacroLinearPPGR(BasePPGRModel) |
Biphasic macronutrient model: Carbs, Protein, Fat, Fiber, Calories. Captures delayed gastric emptying and late glucose elevation. |
ContextFeatureRidgePPGR |
ContextFeatureRidgePPGR(BasePPGRModel) |
Ridge model over measured meal, subject, and optional pre-meal features. Combines: - Slower circadian baseline context (x_base_last, x_base_slope, diurnal phase) - Acute event context (x_event_last, x_event_auc, event_velocity) - Full meal macronutrients (carbs, protein, fat, fiber, calories) - Subject metabolic covariates (BMI, HbA1c, fasting glucose) |
PPGRTrajectoryMetrics methods
to_dict(self) -> dict[str, float]
PPGRBenchmarkResult methods
to_dict(self) -> dict[str, Any]
BasePPGRModel methods
fit(self, X: np.ndarray, y: np.ndarray) -> BasePPGRModel
predict(self, X: np.ndarray) -> np.ndarray
CarbOnlyLinearPPGR methods
fit(self, X: np.ndarray, y: np.ndarray) -> CarbOnlyLinearPPGR
predict(self, X: np.ndarray) -> np.ndarray
MultiMacroLinearPPGR methods
fit(self, X: np.ndarray, y: np.ndarray) -> MultiMacroLinearPPGR
predict(self, X: np.ndarray) -> np.ndarray
ContextFeatureRidgePPGR methods
fit(self, X: np.ndarray, y: np.ndarray) -> ContextFeatureRidgePPGR
predict(self, X: np.ndarray) -> np.ndarray
Public Functions
compute_trajectory_metrics(y_true: np.ndarray, y_pred: np.ndarray, step_minutes: int = 5) -> PPGRTrajectoryMetrics
build_ppgr_dataset(meals_df: pd.DataFrame, sensor: str = 'dexcom', subjects_df: pd.DataFrame | None = None) -> tuple[np.ndarray, np.ndarray, list[str]]
run_ppgr_benchmark(meals_path: Path | str, output_dir: Path | str, *, sensor: str = 'dexcom', subjects_path: Path | str | None = None, glucofm_checkpoint: Path | str | None = None, test_split: float = 0.25, seed: int = 42) -> PPGRBenchmarkResult
iints.research.predictor
- Source:
src/iints/research/predictor.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
BaselinePredictor |
BaselinePredictor(Protocol) |
No module docstring. |
LastValueBaseline |
LastValueBaseline |
Naïve last-value (persistence) baseline for glucose forecasting. |
LinearTrendBaseline |
LinearTrendBaseline |
Linear-trend extrapolation baseline. |
PredictorService |
PredictorService |
No module docstring. |
BaselinePredictor methods
predict(self, X: np.ndarray) -> np.ndarray
name(self) -> str
LastValueBaseline methods
predict(self, X: np.ndarray) -> np.ndarray
name(self) -> str
LinearTrendBaseline methods
predict(self, X: np.ndarray) -> np.ndarray
name(self) -> str
PredictorService methods
predict(self, x: np.ndarray) -> np.ndarray
predict_with_uncertainty(self, x: np.ndarray, n_samples: int = 50) -> Tuple[np.ndarray, np.ndarray]
Public Functions
evaluate_baselines(X: np.ndarray, y: np.ndarray, horizon_steps: int, time_step_minutes: float = 5.0, feature_columns: Optional[Sequence[str]] = None) -> dict
load_predictor(model_path: Path) -> Tuple['LSTMPredictor', dict]
load_predictor_service(model_path: Path) -> PredictorService
predict_batch(model: 'LSTMPredictor', x: np.ndarray) -> np.ndarray
iints.research.proteomics_importer
- Source:
src/iints/research/proteomics_importer.py
- Summary: No module docstring.
- Explicit exports:
ProteomicsImportResult, load_sample_metadata, import_maxquant_protein_groups, import_diann_report, import_spectronaut_report, import_wide_proteomics_matrix, import_standard_long_proteomics, detect_proteomics_format, import_and_validate_proteomics
Public Classes
| Class |
Signature |
Summary |
ProteomicsImportResult |
ProteomicsImportResult |
Outcome and metadata from a proteomics dataset standardization. |
Public Functions
load_sample_metadata(path: Path | str) -> dict[str, dict[str, str]]
import_maxquant_protein_groups(protein_groups_path: Path | str, sample_metadata: Path | str | Mapping[str, Mapping[str, Any]], *, intensity_prefix: str = 'LFQ intensity ', gene_column: str = 'Gene names', protein_id_column: str = 'Majority protein IDs', default_source_id: str = 'MaxQuant', default_unit: str = 'LFQ intensity', default_scale: str = 'linear', filter_contaminants: bool = True, filter_reverse: bool = True, filter_only_identified_by_site: bool = True) -> pd.DataFrame
import_diann_report(report_path: Path | str, sample_metadata: Path | str | Mapping[str, Mapping[str, Any]], *, gene_column: str = 'Genes', protein_id_column: str = 'Protein.Group', sample_column: str = 'Run', intensity_column: str = 'PG.MaxLFQ', default_source_id: str = 'DIA-NN', default_unit: str = 'MaxLFQ intensity', default_scale: str = 'linear', qvalue_column: str = 'PG.Q.Value', max_qvalue: float | None = 0.01, require_qvalue: bool = True, format_name: str = 'DIA-NN') -> pd.DataFrame
import_spectronaut_report(report_path: Path | str, sample_metadata: Path | str | Mapping[str, Mapping[str, Any]], *, gene_column: str = 'PG.Genes', protein_id_column: str = 'PG.ProteinGroups', sample_column: str = 'R.FileName', intensity_column: str = 'PG.Quantity', default_source_id: str = 'Spectronaut', default_unit: str = 'protein-group quantity', default_scale: str = 'linear', qvalue_column: str = 'PG.Qvalue', max_qvalue: float | None = 0.01, require_qvalue: bool = True) -> pd.DataFrame
import_wide_proteomics_matrix(matrix_path: Path | str, sample_metadata: Path | str | Mapping[str, Mapping[str, Any]], *, gene_column: str = 'gene_symbol', protein_id_column: str = 'uniprot_id', default_source_id: str = 'PRIDE_matrix', default_unit: str = 'normalized_intensity', default_scale: str = 'linear') -> pd.DataFrame
import_standard_long_proteomics(path: Path | str) -> pd.DataFrame
detect_proteomics_format(path: Path | str, sample_metadata: Path | str | Mapping[str, Mapping[str, Any]], *, intensity_prefix: str = 'LFQ intensity ') -> str
import_and_validate_proteomics(data_path: Path | str, sample_metadata: Path | str | Mapping[str, Mapping[str, Any]], output_path: Path | str, *, input_format: str = 'auto', default_source_id: str = 'PRIDE', default_unit: str = 'normalized_intensity', default_scale: str = 'linear', intensity_prefix: str = 'LFQ intensity ') -> ProteomicsImportResult
iints.research.regenerative_islet
- Source:
src/iints/research/regenerative_islet.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
RegenerativeProteinTarget |
RegenerativeProteinTarget |
One protein target in a research-only evidence panel. |
RegenerativeProteinPanel |
RegenerativeProteinPanel |
A multi-protein panel tied to one explicit biological question. |
RegenerativeEvidencePlan |
RegenerativeEvidencePlan |
Evidence requests for a panel, without automated biological scoring. |
RegenerativeComparisonResult |
RegenerativeComparisonResult |
Paths and high-level status for one descriptive protein comparison. |
RegenerativeProteinTarget methods
to_dict(self) -> dict[str, Any]
RegenerativeProteinPanel methods
to_dict(self) -> dict[str, Any]
RegenerativeEvidencePlan methods
to_dict(self) -> dict[str, Any]
Public Functions
load_regenerative_protein_panels(path: Path | None = None) -> dict[str, RegenerativeProteinPanel]
get_regenerative_protein_panel(key: str, path: Path | None = None) -> RegenerativeProteinPanel
build_regenerative_evidence_plan(panel_key: str, path: Path | None = None) -> RegenerativeEvidencePlan
compare_regenerative_islet_proteomics(data_path: Path, output_dir: Path, *, test_group: str = 'sc_islet', reference_group: str = 'primary_islet', panel_keys: Sequence[str] = (), normalization_note: str = 'not supplied', descriptive_margin_log2: float = 0.5, bootstrap_samples: int = 2000, seed: int = 42) -> RegenerativeComparisonResult
iints.research.results_manager
- Source:
src/iints/research/results_manager.py
- Summary: Scalable result indexing for IINTS research runs.
Public Classes
| Class |
Signature |
Summary |
ResultsIndexBundle |
ResultsIndexBundle |
Paths created by a results-management indexing run. |
Public Functions
summarize_results_csv(results_csv: Path, root: Path | None = None) -> dict[str, Any]
discover_result_csvs(root: Path, output_dir: Path | None = None) -> list[Path]
build_artifact_inventory(root: Path, output_dir: Path | None = None) -> list[dict[str, Any]]
index_results(root: Path, output_dir: Path | None = None, *, include_raw: bool = False) -> ResultsIndexBundle
Public Constants
ARTIFACT_TYPES
CARB_COLUMNS
CATALOG_SCHEMA_VERSION
GLUCOSE_COLUMNS
INSULIN_COLUMNS
TIME_COLUMNS
iints.research.stem_cell_optimizer
- Source:
src/iints/research/stem_cell_optimizer.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StemCellOptimizer |
StemCellOptimizer |
Research optimizer for stem-cell / islet-graft simulation hypotheses. |
StemCellOptimizer methods
evaluate_graft_configuration(self, engraftment_percent: float, subq_fraction: float, immune_decay: float, meal_schedule: Sequence[Mapping[str, Any]], seed: int = 42) -> Dict[str, Any]
evaluate_transplant_configuration(self, *, placement: TransplantPlacement = 'portal', initial_cell_mass: float = 1.0, initial_maturation_fraction: float = 0.3, immunosuppression_effect: float = 0.0, encapsulation_effect: float = 0.0, meal_schedule: Sequence[Mapping[str, Any]] = (), initial_glucose: float = 120.0, basal_insulin_units_per_hour: float = 0.0) -> Dict[str, Any]
iints.research.stem_cell_transplant
- Source:
src/iints/research/stem_cell_transplant.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
PlacementPreset |
PlacementPreset |
Tissue-site preset for a research stem-cell/islet graft simulation. |
StemCellTransplantParameters |
StemCellTransplantParameters |
Deterministic research parameters for a simplified transplant graft. |
StemCellTransplantState |
StemCellTransplantState |
No module docstring. |
StemCellTransplantStep |
StemCellTransplantStep |
No module docstring. |
StemCellTransplantModel |
StemCellTransplantModel |
Multi-compartment graft model for IINTS research simulations. |
StemCellTransplantParameters methods
with_placement_defaults(self) -> 'StemCellTransplantParameters'
StemCellTransplantState methods
to_dict(self) -> dict[str, float]
StemCellTransplantStep methods
to_dict(self) -> dict[str, float]
StemCellTransplantModel methods
initial_state(parameters: StemCellTransplantParameters) -> StemCellTransplantState
step(self, glucose_mgdl: float, dt_minutes: float) -> StemCellTransplantStep
Public Functions
run_stem_cell_transplant_simulation(*, duration_minutes: int = 1440, time_step_minutes: int = 5, initial_glucose: float = 120.0, parameters: StemCellTransplantParameters | None = None, meal_schedule: Sequence[Mapping[str, Any]] = (), basal_insulin_units_per_hour: float = 0.0) -> pd.DataFrame
Public Constants
iints.research.structure
- Source:
src/iints/research/structure.py
- Summary: Optional structural-biology renders for research and educational explanation.
Public Classes
| Class |
Signature |
Summary |
StructuralRenderError |
StructuralRenderError(RuntimeError) |
Raised when a structure cannot be safely downloaded or rendered. |
StructuralRenderResult |
StructuralRenderResult |
Paths emitted by a successful isolated PyMOL render. |
PAEHeatmapResult |
PAEHeatmapResult |
Interactive Predicted Aligned Error artifact emitted by Plotly. |
Public Functions
is_valid_mmcif(path: Path) -> bool
download_alphafold_cif(uniprot_id: str, out_dir: Path = DEFAULT_CACHE_DIR) -> Path
generate_pymol_script(*, target: str, cif_path: Path, png_path: Path, session_path: Path) -> str
render_target(target: str, *, output_dir: Path = DEFAULT_OUTPUT_DIR, cache_dir: Path = DEFAULT_CACHE_DIR, uv_binary: str = 'uv') -> list[StructuralRenderResult]
render_pae(target: str, *, output_dir: Path = DEFAULT_OUTPUT_DIR) -> list[PAEHeatmapResult]
Public Constants
ALPHAFOLD_API_TEMPLATE
DEFAULT_CACHE_DIR
DEFAULT_OUTPUT_DIR
TARGETS
iints.research.tissue_stressor
- Source:
src/iints/research/tissue_stressor.py
- Summary: Engine for testing tissue-specific sensitivity assumptions on algorithms.
Public Classes
| Class |
Signature |
Summary |
TissueStressor |
TissueStressor |
Runs comparative simulations for tissue-specific sensitivity hypotheses. |
TissueStressor methods
run_stress_test(muscle_scalar: float, liver_scalar: float, output_dir: Path, *, seed: int = 42) -> tuple[Path, dict[str, Any]]
iints.research.visualizer
- Source:
src/iints/research/visualizer.py
- Summary: Evidence-backed scientific figures for IINTS-AF.
- Explicit exports:
ScientificVisualizationArtifacts, apply_scientific_plot_style, plot_foundation_arena_radar, plot_confounder_cosine_analysis, plot_glucofm_dual_stream_decomposition, plot_cgmacros_dualsensor_comparison, plot_fda_safety_mitigation_timeline, generate_interactive_dashboard_html, generate_all_scientific_visualizations
Public Classes
| Class |
Signature |
Summary |
ScientificVisualizationArtifacts |
ScientificVisualizationArtifacts |
Files generated by the evidence-aware visualization suite. |
ScientificVisualizationArtifacts methods
to_dict(self) -> dict[str, Any]
Public Functions
apply_scientific_plot_style() -> None
plot_foundation_arena_radar(output_path: Path | str, evaluation_artifacts: Sequence[Path | str] | None = None) -> Path
plot_confounder_cosine_analysis(output_path: Path | str, evidence_path: Path | str | None = None) -> Path
plot_glucofm_dual_stream_decomposition(output_path: Path | str) -> Path
plot_cgmacros_dualsensor_comparison(output_path: Path | str, evidence_path: Path | str | None = None) -> Path
plot_fda_safety_mitigation_timeline(output_path: Path | str, evidence_path: Path | str | None = None) -> Path
generate_interactive_dashboard_html(output_path: Path | str, radar_img_path: Path | None, confounder_img_path: Path | None, glucofm_img_path: Path, cgmacros_img_path: Path | None, fda_img_path: Path | None) -> Path
generate_all_scientific_visualizations(output_dir: Path | str = 'results/scientific_visualizations', *, arena_evaluation_artifacts: Sequence[Path | str] | None = None, confounder_evidence: Path | str | None = None, cgmacros_evidence: Path | str | None = None, safety_trace: Path | str | None = None) -> ScientificVisualizationArtifacts
iints.safety
- Source:
src/iints/safety/__init__.py
- Summary: IINTS-AF Safety and Adversarial Fault Injection Modules.
- Explicit exports:
OpenFDARecallCase, FDA_RECALL_REGISTRY, FDAScenarioExecutionMetrics, FDASafetyBenchmarkReport, simulate_fda_failure_scenario, run_fda_safety_benchmark
No public classes, functions, or all-caps constants are declared directly in this module.
iints.safety.openfda_safety
- Source:
src/iints/safety/openfda_safety.py
- Summary: No module docstring.
- Explicit exports:
OpenFDARecallCase, FDA_RECALL_REGISTRY, FDAScenarioExecutionMetrics, FDASafetyBenchmarkReport, simulate_fda_failure_scenario, run_fda_safety_benchmark
Public Classes
| Class |
Signature |
Summary |
OpenFDARecallCase |
OpenFDARecallCase |
A verified medical device recall/adverse event from the FDA database. |
FDAScenarioExecutionMetrics |
FDAScenarioExecutionMetrics |
Execution telemetry of a real FDA failure scenario under unmitigated vs safety-supervised controllers. |
FDASafetyBenchmarkReport |
FDASafetyBenchmarkReport |
Complete multi-case safety evaluation report grounded in FDA adverse events. |
FDASafetyBenchmarkReport methods
to_dict(self) -> dict[str, Any]
Public Functions
simulate_fda_failure_scenario(case: OpenFDARecallCase, enable_supervisor: bool = False, duration_minutes: float = 720.0, step_minutes: float = 5.0, seed: int = 42) -> tuple[pd.DataFrame, FDAScenarioExecutionMetrics]
run_fda_safety_benchmark(output_dir: Path | str, custom_registry: Sequence[OpenFDARecallCase] | None = None) -> FDASafetyBenchmarkReport
Public Constants
iints.scenarios
- Source:
src/iints/scenarios/__init__.py
- Summary: No module docstring.
- Explicit exports:
ScenarioGeneratorConfig, generate_random_scenario, build_eucys_arm_scenario, build_eucys_study_pack, build_official_study_pack, export_eucys_study_pack, export_official_study_pack
No public classes, functions, or all-caps constants are declared directly in this module.
iints.scenarios.generator
- Source:
src/iints/scenarios/generator.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ScenarioGeneratorConfig |
ScenarioGeneratorConfig |
No module docstring. |
Public Functions
generate_random_scenario(config: ScenarioGeneratorConfig) -> Dict[str, Any]
iints.scenarios.study_pack
- Source:
src/iints/scenarios/study_pack.py
- Summary: No module docstring.
Public Functions
build_official_study_pack(*, seeds: list[int] | None = None) -> dict[str, Any]
build_eucys_study_pack(*, seeds: list[int] | None = None) -> dict[str, Any]
build_eucys_arm_scenario(base_scenario: dict[str, Any], *, arm_id: str) -> tuple[dict[str, Any], dict[str, Any]]
export_official_study_pack(output_dir: str | Path, *, seeds: list[int] | None = None) -> dict[str, str]
export_eucys_study_pack(output_dir: str | Path, *, seeds: list[int] | None = None) -> dict[str, str]
iints.templates
- Source:
src/iints/templates/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.templates.default_algorithm
- Source:
src/iints/templates/default_algorithm.py
- Summary: Source could not be parsed as normal Python.
- Parse note:
invalid syntax at line 4
This file is documented as a source artifact rather than a normal importable Python module.
iints.templates.demos
- Source:
src/iints/templates/demos/__init__.py
- Summary: Bundled demo script templates for installed IINTS users.
No public classes, functions, or all-caps constants are declared directly in this module.
iints.templates.demos.live_stage_demo
- Source:
src/iints/templates/demos/live_stage_demo.py
- Summary: No module docstring.
Public Functions
Public Constants
DURATION_MINUTES
OUTPUT_DIR
PATIENT_CONFIG
PREPARE_AI
SCENARIOS
SDK_SRC
SEED
TIME_STEP_MINUTES
iints.templates.pico_pump.code
- Source:
src/iints/templates/pico_pump/code.py
- Summary: IINTS Pico Pump Bench Firmware.
Public Constants
BOOT_TIME
DEVICE_ID
HARDWARE_ACTUATION_ENABLED
LOCKED
READY_BANNER
iints.templates.scenarios
- Source:
src/iints/templates/scenarios/__init__.py
- Summary: No module docstring.
No public classes, functions, or all-caps constants are declared directly in this module.
- Source:
src/iints/tools/ai_realism_auditor.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
Anomaly |
Anomaly |
No module docstring. |
AIRealismAuditor |
AIRealismAuditor |
Red-team auditor for long IINTS-AF physiological simulation outputs. |
Anomaly methods
AIRealismAuditor methods
find_anomalies(self) -> list[Anomaly]
run_audit(self, report_path: str | Path) -> dict[str, Any]
Public Functions
main(argv: list[str] | None = None) -> int
- Source:
src/iints/tools/digital_twin_calibrator.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
DigitalTwinCalibrator |
DigitalTwinCalibrator |
Fit a limited AdvancedMetabolicModel parameter set to research data. |
DigitalTwinCalibrator methods
- Source:
src/iints/tools/theory_stress_lab.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
TheoryCheckResult |
TheoryCheckResult |
No module docstring. |
TheoryStressReport |
TheoryStressReport |
No module docstring. |
TraceRow |
TraceRow |
No module docstring. |
ScenarioSummary |
ScenarioSummary |
No module docstring. |
TheoryCheckResult methods
to_dict(self) -> Dict[str, Any]
TheoryStressReport methods
to_dict(self) -> Dict[str, Any]
TraceRow methods
to_dict(self) -> Dict[str, Any]
ScenarioSummary methods
values(self, key: str) -> List[float]
Public Functions
check_no_negative_states(seed: int) -> TheoryCheckResult
check_hypo_blocks_insulin(seed: int) -> TheoryCheckResult
check_iob_limits_bolus(seed: int) -> TheoryCheckResult
check_pump_failure_raises_ffa_ketones(seed: int) -> TheoryCheckResult
check_sensor_lag_is_bounded(seed: int) -> TheoryCheckResult
check_exercise_does_not_create_impossible_crash(seed: int) -> TheoryCheckResult
check_meal_response_has_plausible_peak(seed: int) -> TheoryCheckResult
check_illness_increases_insulin_need_without_exploding(seed: int) -> TheoryCheckResult
run_theory_stress_lab(*, output_dir: Optional[Path] = None, profile: str = 'jetson', seed: int = 42, repeats: int = 1, duration_minutes: float = 30.0) -> TheoryStressReport
write_theory_stress_outputs(report: TheoryStressReport, output_dir: Path) -> Dict[str, Path]
main(argv: Optional[Sequence[str]] = None) -> int
Public Constants
iints.utils
- Source:
src/iints/utils/__init__.py
- Summary: No module docstring.
- Explicit exports:
apply_plot_style
No public classes, functions, or all-caps constants are declared directly in this module.
iints.utils.academic_artifacts
- Source:
src/iints/utils/academic_artifacts.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
AcademicTheme |
AcademicTheme |
No module docstring. |
Public Functions
setup_academic_pdf(pdf: Any, *, title: str = 'IINTS-AF Research Report') -> None
add_academic_header(pdf: Any, title: str, *, subtitle: str = 'Pre-clinical research report - not for treatment decisions', metadata: Mapping[str, Any] | None = None) -> None
add_academic_section(pdf: Any, title: str) -> None
add_metric_cards(pdf: Any, cards: Sequence[tuple[str, str]], *, columns: int = 3) -> None
add_key_value_table(pdf: Any, rows: Sequence[tuple[str, str]], *, key_width: float = 62) -> None
add_academic_footer(pdf: Any, *, note: str | None = None) -> None
style_excel_workbook(path: str | Path, *, title: str = 'IINTS-AF Research Workbook') -> Path
Public Constants
iints.utils.csv_safety
- Source:
src/iints/utils/csv_safety.py
- Summary: No module docstring.
Public Functions
sanitize_csv_cell(value: Any) -> Any
sanitize_csv_mapping(row: Mapping[str, Any]) -> dict[str, Any]
sanitize_csv_dataframe(df: pd.DataFrame) -> pd.DataFrame
iints.utils.plotting
- Source:
src/iints/utils/plotting.py
- Summary: No module docstring.
Public Functions
apply_plot_style(dpi: int = 150, font_scale: float = 1.1, palette: Optional[Iterable[str]] = None) -> List[str]
Public Constants
IINTS_BLUE
IINTS_GOLD
IINTS_NAVY
IINTS_ORANGE
IINTS_RED
IINTS_TEAL
iints.utils.run_io
- Source:
src/iints/utils/run_io.py
- Summary: No module docstring.
Public Functions
resolve_seed(seed: Optional[int]) -> int
generate_run_id(seed: int) -> str
resolve_output_dir(output_dir: Optional[Union[str, Path]], run_id: str) -> Path
write_json(path: Path, payload: Dict[str, Any]) -> None
get_sdk_version(package_name: str = 'iints-sdk-python35') -> str
build_run_metadata(run_id: str, seed: int, config: Dict[str, Any], output_dir: Path) -> Dict[str, Any]
compute_sha256(path: Path) -> str
build_run_manifest(output_dir: Path, files: Dict[str, Path]) -> Dict[str, Any]
maybe_sign_manifest(manifest_path: Path) -> Optional[Path]
Public Constants
RESULTS_CSV_FORMAT_VERSION
RUN_MANIFEST_FORMAT_VERSION
RUN_METADATA_FORMAT_VERSION
iints.utils.url_safety
- Source:
src/iints/utils/url_safety.py
- Summary: No module docstring.
Public Functions
validate_service_base_url(raw_url: str, *, label: str) -> str
iints.validation
- Source:
src/iints/validation/__init__.py
- Summary: No module docstring.
- Explicit exports:
StressEventModel, ScenarioModel, PatientConfigModel, LATEST_SCHEMA_VERSION, ValidationRule, ValidationProfile, ValidationCheckResult, RunValidationReport, SafetyContractSpec, SafetyContractViolation, SafetyContractVerificationReport, load_scenario, validate_scenario_dict, scenario_warnings, build_stress_events, scenario_to_payloads, validate_patient_config_dict, load_patient_config, load_patient_config_by_name, load_validation_profiles, compute_run_metrics, evaluate_run, load_contract_spec, apply_contract_to_config, verify_safety_contract, ReplayRunDigest, ReplayCheckResult, run_deterministic_replay_check, GoldenScenarioSpec, GoldenBenchmarkPack, load_golden_benchmark_pack, evaluate_expected_ranges, format_validation_error, migrate_scenario_dict
Public Functions
migrate_scenario_dict(data: Dict[str, Any]) -> Dict[str, Any]
load_scenario(path: Union[str, Path]) -> ScenarioModel
validate_scenario_dict(data: Dict[str, Any]) -> ScenarioModel
scenario_warnings(model: ScenarioModel) -> List[str]
build_stress_events(payloads: List[Dict[str, Any]]) -> List[StressEvent]
scenario_to_payloads(model: ScenarioModel) -> List[Dict[str, Any]]
validate_patient_config_dict(data: Dict[str, Any]) -> PatientConfigModel
load_patient_config(path: Union[str, Path]) -> PatientConfigModel
load_patient_config_by_name(name: str) -> PatientConfigModel
format_validation_error(error: ValidationError) -> List[str]
iints.validation.golden
- Source:
src/iints/validation/golden.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
GoldenScenarioSpec |
GoldenScenarioSpec |
No module docstring. |
GoldenBenchmarkPack |
GoldenBenchmarkPack |
No module docstring. |
Public Functions
load_golden_benchmark_pack(path: Optional[Path] = None) -> GoldenBenchmarkPack
evaluate_expected_ranges(metrics: Dict[str, float], expected: Dict[str, Dict[str, float]]) -> Dict[str, Dict[str, Any]]
iints.validation.replay
- Source:
src/iints/validation/replay.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ReplayRunDigest |
ReplayRunDigest |
No module docstring. |
ReplayCheckResult |
ReplayCheckResult |
No module docstring. |
ReplayRunDigest methods
to_dict(self) -> Dict[str, Any]
ReplayCheckResult methods
to_dict(self) -> Dict[str, Any]
Public Functions
run_deterministic_replay_check(*, algorithm: InsulinAlgorithm, scenario: Optional[Dict[str, Any]], patient_config: Any, duration_minutes: int, time_step: int, seed: int, repeats: int = 2, safety_config: Optional[SafetyConfig] = None, predictor: Optional[object] = None) -> ReplayCheckResult
Public Constants
NON_DETERMINISTIC_COLUMNS
NON_DETERMINISTIC_REPORT_KEYS
iints.validation.run_doctor
- Source:
src/iints/validation/run_doctor.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
RunDoctorCheck |
RunDoctorCheck |
No module docstring. |
RunDoctorReport |
RunDoctorReport |
No module docstring. |
RunDoctorCheck methods
to_dict(self) -> Dict[str, Any]
RunDoctorReport methods
failed(self) -> bool
warned(self) -> bool
to_dict(self) -> Dict[str, Any]
Public Functions
inspect_run_setup(*, algo_path: Optional[Path] = None, patient_config_path: Optional[Path] = None, scenario_path: Optional[Path] = None, duration_minutes: int = 1440, time_step_minutes: int = 5, output_dir: Optional[Path] = None, patient_config_name: Optional[str] = None) -> RunDoctorReport
iints.validation.run_validation
- Source:
src/iints/validation/run_validation.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
ValidationRule |
ValidationRule |
No module docstring. |
ValidationProfile |
ValidationProfile |
No module docstring. |
ValidationCheckResult |
ValidationCheckResult |
No module docstring. |
RunValidationReport |
RunValidationReport |
No module docstring. |
ValidationCheckResult methods
to_dict(self) -> Dict[str, Any]
RunValidationReport methods
to_dict(self) -> Dict[str, Any]
Public Functions
load_validation_profiles(path: Optional[Path] = None) -> Dict[str, ValidationProfile]
compute_run_metrics(results_df: pd.DataFrame, *, safety_report: Optional[Dict[str, Any]] = None, duration_minutes: Optional[int] = None) -> Dict[str, float]
evaluate_run(results_df: pd.DataFrame, *, profile: ValidationProfile, safety_report: Optional[Dict[str, Any]] = None, duration_minutes: Optional[int] = None) -> RunValidationReport
iints.validation.safety_contract
- Source:
src/iints/validation/safety_contract.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
SafetyContractSpec |
SafetyContractSpec |
No module docstring. |
SafetyContractViolation |
SafetyContractViolation |
No module docstring. |
SafetyContractVerificationReport |
SafetyContractVerificationReport |
No module docstring. |
SafetyContractVerificationReport methods
passed(self) -> bool
to_dict(self) -> Dict[str, Any]
Public Functions
load_contract_spec(path: Optional[Path] = None) -> SafetyContractSpec
apply_contract_to_config(spec: SafetyContractSpec, base: Optional[SafetyConfig] = None) -> SafetyConfig
verify_safety_contract(spec: SafetyContractSpec, *, glucose_values: List[float], trend_values: List[float], proposed_doses: List[float], iob_values: Optional[List[float]] = None) -> SafetyContractVerificationReport
iints.validation.schemas
- Source:
src/iints/validation/schemas.py
- Summary: No module docstring.
Public Classes
| Class |
Signature |
Summary |
StressEventModel |
StressEventModel(BaseModel) |
No module docstring. |
ScenarioModel |
ScenarioModel(BaseModel) |
No module docstring. |
PatientConfigModel |
PatientConfigModel(BaseModel) |
No module docstring. |
Public Constants
iints.versioning
- Source:
src/iints/versioning.py
- Summary: Shared, network-bounded version inspection for the CLI and desktop app.
- Explicit exports:
APP_RELEASE_URL, APP_RELEASES_API_URL, ComponentVersionStatus, SDK_DISTRIBUTION, SDK_PYPI_JSON_URL, SDK_RELEASE_URL, check_app_version, check_sdk_version, clear_version_cache, installed_sdk_environment, installed_sdk_version, version_is_newer, version_report
Public Classes
| Class |
Signature |
Summary |
ComponentVersionStatus |
ComponentVersionStatus |
No module docstring. |
ComponentVersionStatus methods
to_dict(self) -> dict[str, Any]
Public Functions
version_is_newer(candidate: str, reference: str) -> bool
clear_version_cache(path: Path | None = None) -> None
installed_sdk_version() -> str
installed_sdk_environment() -> dict[str, Any]
check_sdk_version(*, installed: str | None = None, refresh: bool = False, offline: bool = False, cache_path: Path | None = None, cache_ttl: timedelta = DEFAULT_CACHE_TTL, timeout: float = DEFAULT_NETWORK_TIMEOUT_SECONDS, fetch_json: JsonFetcher = _fetch_json) -> ComponentVersionStatus
check_app_version(installed: str, *, refresh: bool = False, offline: bool = False, cache_path: Path | None = None, cache_ttl: timedelta = DEFAULT_CACHE_TTL, timeout: float = DEFAULT_NETWORK_TIMEOUT_SECONDS, fetch_json: JsonFetcher = _fetch_json) -> ComponentVersionStatus
version_report(*, app_version: str | None = None, refresh: bool = False, offline: bool = False) -> dict[str, Any]
Public Constants
APP_RELEASES_API_URL
APP_RELEASE_URL
APP_TAG_PREFIX
DEFAULT_CACHE_TTL
DEFAULT_NETWORK_TIMEOUT_SECONDS
SDK_DISTRIBUTION
SDK_PYPI_JSON_URL
SDK_RELEASE_URL
VERSION_CHECK_SCHEMA
iints.visualization
- Source:
src/iints/visualization/__init__.py
- Summary: IINTS-AF Visualization Module Professional medical visualizations for diabetes algorithm research.
- Explicit exports:
UncertaintyCloud, UncertaintyData, VisualizationConfig, ClinicalCockpit, CockpitConfig, DashboardState
No public classes, functions, or all-caps constants are declared directly in this module.
iints.visualization.cockpit
- Source:
src/iints/visualization/cockpit.py
- Summary: Clinical Control Center - IINTS-AF Professional medical dashboard for diabetes algorithm research.
Public Classes
| Class |
Signature |
Summary |
CockpitConfig |
CockpitConfig |
Configuration for the clinical cockpit |
DashboardState |
DashboardState |
Current state of the dashboard |
ClinicalCockpit |
ClinicalCockpit |
Professional clinical dashboard for diabetes algorithm research. |
DashboardState methods
ClinicalCockpit methods
visualize_results(self, simulation_data: pd.DataFrame, predictions: Optional[np.ndarray] = None, reasoning_logs: Optional[List[Dict]] = None, metrics: Optional[Dict] = None, personality: Optional[Dict] = None, save_path: Optional[str] = None) -> plt.Figure
compare_battle(self, battle_report, save_path: Optional[str] = None) -> plt.Figure
update(self, state: DashboardState)
export_state(self) -> Dict
Public Functions
iints.visualization.uncertainty_cloud
- Source:
src/iints/visualization/uncertainty_cloud.py
- Summary: Uncertainty Cloud Visualizer - IINTS-AF Creates visualization of AI confidence as shadow around glucose predictions.
Public Classes
| Class |
Signature |
Summary |
UncertaintyData |
UncertaintyData |
Data structure for uncertainty visualization |
VisualizationConfig |
VisualizationConfig |
Configuration for uncertainty cloud visualization |
UncertaintyCloud |
UncertaintyCloud |
Creates uncertainty cloud visualizations for glucose predictions. |
UncertaintyCloud methods
plot(self, data: UncertaintyData, time_range: Optional[Tuple[float, float]] = None, save_path: Optional[str] = None) -> plt.Figure
plot_comparison(self, data_list: List[Tuple[str, UncertaintyData]], save_path: Optional[str] = None) -> plt.Figure
create_dashboard_widget(self, data: UncertaintyData, width: int = 400, height: int = 200) -> plt.Figure
Public Functions
generate_sample_data() -> UncertaintyData
demo_uncertainty_cloud()