No servir los riesgos ni listar los modelos ocultos

This commit is contained in:
2026-12-04 12:47:07 -06:00
parent adf66161e1
commit 7ddb3df4d9
3 changed files with 12 additions and 4 deletions
+4 -1
View File
@@ -32,12 +32,14 @@ from fhir_checks import follow_up, pages, served, unscored, validate
from test_conectar import ok, wait_for
from conftest import put_concept_map
from core.cacu import visibility
ROOT = Path(__file__).parents[2]
HOSPITAL = ROOT / "tests" / "fixtures" / "hospital"
REFERENCE = ROOT / "tests" / "fixtures" / "reference" / "cacu"
PIPELINE = ROOT / "tests" / "fixtures" / "pipelines" / "hospital_cacu.json"
REFERENCE_CUTOFF = "2026-11-23" # the current platform's cohort cut-off (follow-up ends)
CAPTURED_ON = "2026-11-25" # the day the indicators were captured: durations counted to it
PERIODS = [f"{y}-S{s}" for y in range(2021, 2027) for s in (1, 2)]
COHORTS = {
@@ -189,7 +191,8 @@ def test_cacu_from_the_hospital_to_indicators_and_risks(api, platform, tmp_path)
# none is promoted without the clinical validation.
wait_for(api, ok(api.post("/models/cacu/train", json={"as_of": REFERENCE_CUTOFF}))["run_id"])
names = [m["name"] for m in ok(api.get("/models/cacu"))]
assert set(names) == set(current)
# the hidden models (core.models.HIDDEN) are neither trained nor listed
assert set(names) == {n for n in current if visibility.model(f"cacu.{n}")}
for name in names:
(version,) = ok(api.get(f"/models/cacu/{name}/versions"))
assert version["reports"] == ["interpretability", "technical_validation"]