Recurrence figures for a patient; governance trains scenarios with external data; lifelines in the lock

This commit is contained in:
rockdrigo
2026-11-21 13:34:56 -06:00
parent a53179aa2e
commit 2c4bfa5691
6 changed files with 153 additions and 6 deletions
+15
View File
@@ -50,6 +50,7 @@ def test_the_catalog_lists_the_trainable_scenarios_and_not_the_pipeline_settings
assert ("cama", "survival") in entries and ("cacu", "cin2_logistic") in entries
assert entries[("tea", "eeg")]["kind"] == "referencia" and entries[("cama", "survival")]["kind"] == "cohorte"
assert ("cama", "seer_survival") not in entries
assert entries[("cama", "recurrence")]["kind"] == "referencia" # trained on its external files, not on a dbt cohort
@pytest.mark.parametrize("code,estado", [
@@ -115,3 +116,17 @@ def test_tea_trains_on_a_local_reference_folder_when_one_is_configured(monkeypat
assert tea[tea.index("--reference-dir") + 1] == "/referencia" and tea[tea.index("--reference-ages") + 1] == "/referencia/edades.csv"
assert "--manifest" not in tea and "--reference-dir" not in cama
def test_a_scenario_with_external_data_trains_without_a_dbt_export_or_manifest(monkeypatch):
"""Pins down: CaMa's recurrence scenario, whose training data are files, is started with no `--export`, `--manifest` or dbt
manifest, while CaMa's survival scenario still is. Fails if an external scenario is refused for want of a manifest or run
through the cohort export, which would train it on the wrong data."""
monkeypatch.delenv("DBT_MANIFEST", raising=False)
recurrence = training_jobs._command("cama", "recurrence")
monkeypatch.setenv("DBT_MANIFEST", "m.json")
survival = training_jobs._command("cama", "survival")
assert "--export" not in recurrence and "--manifest" not in recurrence
assert "--export" in survival and survival[survival.index("--manifest") + 1] == "m.json"