Add optional mortality and ageing population graph - #420
Draft
MaxGhenis wants to merge 2 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new optional population graph reuses the existing M6 mortality fitter and mortality/ageing steps through typed model artifacts. It fits a historical exposure panel, applies the model to a separate starting population with stable person-ID random draws, and retains both the original and next-period observations with explicit lineage and mass accounting.
The synthetic engineering report separates execution/accounting checks from held-out fixture checks. Source declarations keep future holdout outcomes out of fitting and application. Validated JSON models preserve the fit boundary and external vintage; the all-dead case adds neither observations nor an orphan period group. Household accounting is explicitly unsupported in this first slice.
Depends on PolicyEngine/microcosm#873. The optional
graphextra pins graph and Frame to core commit3ff92b0aea14407d09479bff5623dc7d1a92d008; it requires Python 3.13+. Default Dynamics imports remain usable on Python 3.10–3.14. CI installs the pinned extra, requires the typed interfaces, and runs the graph plus existing mortality regressions on Python 3.13 and 3.14.Validation: 49 targeted tests passed, including 25 new graph tests and 24 existing refit/step tests, in development, against installed Dynamics/core wheels, and with a fresh installation of the pinned Git extra. The historical birth-evidence identity check excludes the six new graph files by exact path, following its existing treatment of later additions. Import-reachability coverage proves those graph modules stay outside the historical reducer and its registered production roots. All nine birth-evidence tests plus the 49 graph/mortality regressions pass. Full test collection verifies the ordinary inventory at 5,783 tests. Ruff, Black, actionlint and Python 3.10/3.12 optional-import checks passed. Cold/warm CLI runs pass with all seven nodes reusable.
GitHub CI passed at
19a80e0c097a3c878de432bf0586e9aa3cf6e259: all four legacy shards, graph integration on Python 3.13 and 3.14, build, lint and the aggregate test gate are green. Both graph jobs ran all 49 tests with no skips.The existing simulation loop, Q5 campaign, candidate registries, locked scientific gates and historical evidence artifacts are unchanged. Core interface review precedes release of this dependent integration.