Indexing: the first invasive biopsy reads the scenario's event grades and keeps its rules #15

Open
edgar wants to merge 1 commits from fix/cacu-survival-index-event-grades into dev
Member

What changes

The whole-frame version of the primera_biopsia_invasora index (models/steps/indexing.py) looked for the single code CARCINOMA_INVASOR, CaMa's. CaCu's survival indexes on event_grades = ["CIS", "CARCINOMA"], so it found no biopsies, the indexed cohort had 0 members and training failed with zero-size array to reduction operation maximum. It also dropped what the per-patient version did for this kind: the two rules (no birth date; a death on or before the biopsy) and the prior observation threshold.

It now:

  • takes the grades from index["event_grades"], with invasive_code (default CARCINOMA_INVASOR) as the fallback, so CaMa, whose config lists CARCINOMA_INVASOR, is unchanged;
  • applies the rules and the threshold in the same order and with the same attrition as the per-patient version.

Tests

  • tests/test_indexing.py: a new test pins the grades, the fallback, each rule and the attrition; it fails without the change. 11 pass.
  • tests/cacu/test_cacu_survival.py: 9 of 10 pass (7 failed on dev). The tenth expects the pipeline diagram files, which need the graphviz module, absent in this environment.
  • tests/cama/test_survival.py and tests/cama/test_recurrence.py: 22 pass. Five tests of the live figure (live.monthly missing, curves() signature) fail the same way on dev without this change.
## What changes The whole-frame version of the `primera_biopsia_invasora` index (`models/steps/indexing.py`) looked for the single code `CARCINOMA_INVASOR`, CaMa's. CaCu's survival indexes on `event_grades = ["CIS", "CARCINOMA"]`, so it found no biopsies, the indexed cohort had 0 members and training failed with `zero-size array to reduction operation maximum`. It also dropped what the per-patient version did for this kind: the two rules (no birth date; a death on or before the biopsy) and the prior observation threshold. It now: - takes the grades from `index["event_grades"]`, with `invasive_code` (default `CARCINOMA_INVASOR`) as the fallback, so CaMa, whose config lists `CARCINOMA_INVASOR`, is unchanged; - applies the rules and the threshold in the same order and with the same attrition as the per-patient version. ## Tests - `tests/test_indexing.py`: a new test pins the grades, the fallback, each rule and the attrition; it fails without the change. 11 pass. - `tests/cacu/test_cacu_survival.py`: 9 of 10 pass (7 failed on `dev`). The tenth expects the pipeline diagram files, which need the `graphviz` module, absent in this environment. - `tests/cama/test_survival.py` and `tests/cama/test_recurrence.py`: 22 pass. Five tests of the live figure (`live.monthly` missing, `curves()` signature) fail the same way on `dev` without this change.
edgar added 1 commit 2026-11-23 02:06:50 -06:00
The whole-frame version of primera_biopsia_invasora looked for the single code CARCINOMA_INVASOR, so CaCu's survival,
which indexes on CIS and CARCINOMA, had no members and could not train. It also dropped the two rules the per-patient
version applied (no birth date, a death on or before the biopsy) and the prior observation threshold. It now takes the
grades from event_grades (invasive_code stays the fallback) and applies the rules in the same order, with the same
attrition.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin fix/cacu-survival-index-event-grades:fix/cacu-survival-index-event-grades
git checkout fix/cacu-survival-index-event-grades
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ISSSTELEON/models#15