Add stock-flow accounting to annual mortality trajectories - #440
Draft
MaxGhenis wants to merge 2 commits into
Draft
Add stock-flow accounting to annual mortality trajectories#440MaxGhenis wants to merge 2 commits into
MaxGhenis wants to merge 2 commits into
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.
Adds optional annual accounting to the synthetic mortality trajectory. Each new graph node reconciles frozen opening/closing populations against deaths explicitly declared by the mortality transition, with separate count, weight, and revaluation summaries. Failed or blocked transitions retain their diagnostics and do not turn stale snapshots into inferred deaths.
The existing mortality nodes, population results, cache keys, scientific evaluations, and historical projection engine remain unchanged. Accounting failures remain separate from mortality outcomes. Raw snapshot types and IDs are validated before pandas conversion, and malformed diagnostics produce inspectable refusals.
This draft stacks on #436 and includes the unchanged stock-flow accountant from #439. It adds no native population inputs or scientific acceptance claim. Household location and membership transport remains a separate documented contract extension; unsupported fields are rejected.
Validation: 221 focused tests pass, with four platform-conditional long-double cases skipped on this Mac; 40 new integration cases cover cache reuse, holdout isolation, extinction, failed/blocked transitions, malformed inputs, and accounting refusals. Independent source review is clean. Black79, Ruff, historical source-identity checks, an executed synthetic documentation example, and standalone Quarto rendering pass. The two Python-version graph CI jobs include the new exact test file.