A model whose cohort is empty at a site is skipped, not a failed train run
This commit is contained in:
@@ -112,3 +112,14 @@ def test_survival_matches_the_current_model_with_its_index_fixed():
|
||||
for ours, theirs in [("probability", "probabilidad"), ("ci_low", "ic_bajo"),
|
||||
("ci_high", "ic_alto")]: # fmt: skip
|
||||
np.testing.assert_allclose(both[ours], both[theirs], rtol=RTOL, equal_nan=True)
|
||||
|
||||
|
||||
def test_a_cohort_the_site_lacks_is_reported_not_trained(monkeypatch):
|
||||
"""A site with no colposcopies has nobody in the post-colposcopy cohort: training that
|
||||
model says so (and the train job goes on with the others) instead of failing inside it."""
|
||||
from models import jobs
|
||||
from models.cacu.jobs import JOBS
|
||||
|
||||
monkeypatch.setattr(jobs.gold, "timelines", lambda *a: pd.DataFrame())
|
||||
with pytest.raises(jobs.EmptyCohort, match="cacu_cohort_post_colposcopy"):
|
||||
JOBS.train("cin2_pim_post_colposcopy")
|
||||
|
||||
Reference in New Issue
Block a user