Skip to content

Add canonical time-dependent gains rendering - #378

Merged
uriahf merged 10 commits into
mainfrom
feature/time-gains-v2
Aug 23, 2026
Merged

Add canonical time-dependent gains rendering#378
uriahf merged 10 commits into
mainfrom
feature/time-gains-v2

Conversation

@uriahf

@uriahf uriahf commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an internal canonical v2 builder for time-dependent gains from existing production performance quantities
  • add renderer= selection to create_gains_curve_times() while preserving Plotly as the unchanged default production path
  • represent one evaluation per semantic input evaluation and one geometric series per evaluation × horizon
  • emit one global Random identity and one Perfect Model path per semantic population × horizon
  • render Matplotlib horizons as separate panels
  • cover shared-population multi-model, multiple-horizon, equal-valued distinct-owner, censoring, competing-risk, browser, Matplotlib, and unchanged-default scenarios

Statistical boundary

The Perfect Model bend is the already-calculated horizon-specific target-event risk:

real_positives / n at cutoff 0.

Those counts originate in the production Aalen–Johansen pipeline (polarstate.predict_aj_estimates and the performance-data transforms). The canonical builder copies that calculated quantity and does not recompute AJ/CIF, censoring, competing risks, or prevalence.

Ownership

  • shared population + shared horizon → one shared Perfect Model reference
  • different population or horizon → distinct population_horizon owner
  • equal numerical geometry never collapses distinct semantic owners
  • reference_group is used only as the compatibility join into explicit evaluation metadata

Contract

No schema change is required. Existing evaluation identity, series horizon, seriesId, path geometry, and population_horizon reference ownership are sufficient and language-neutral for future R adoption.

Browser dependency

The immutable rtichoke_viz v0.3.1 release is vendored in this PR. Provenance is pinned to source commit 5ccde928a0bf9fa6ece2b7572687b442c57a98a9 and release SHA-256 121aa8eb8d0f8427ecfb2c01dab0fb05668eaedf47ddcfc0cd282a7ecf1ce448. The shipped browser bundle includes the horizon selector from uriahf/rtichoke_viz#30.

Verification

  • focused pytest: 11 passed across time-gains builder/renderers and vendored browser assets
  • targeted Ruff check/format: passed
  • uv build: passed; wheel contains v0.3.1 and excludes v0.3.0
  • full rtichoke_viz tests: 71 passed; TypeScript typecheck passed
  • full-project ty check src tests continues to report pre-existing test diagnostics outside this diff

@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-23 06:15 UTC

@uriahf
uriahf marked this pull request as ready for review August 23, 2026 06:15
@uriahf
uriahf merged commit a9009bf into main Aug 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant