Repository navigation
Preserve missing UC advance repayments in mixed populations - #2581
Conversation
|
UC advance missingness fix is pushed as draft #2581, stacked on #2574's
Workspace-local |
juaristi22
left a comment
There was a problem hiding this comment.
Reviewed at 52201202239dfb73ddb5224ceff0753cdc2e4787. No actionable findings.
The fallback is now resolved separately for each benefit unit, preserving explicit zero and cash inputs while retaining the existing estimate for missing values. All 19 focused tests passed, including peer/permutation invariance and final UC outcomes of £6,000 and £5,519.832 for explicit-zero and missing-input units. Existing estimation, caps, abolition and award floors remain consistent.
Fixes #2578
Stacked on #2574 (
fix-uc-advance-cash-2410, reviewed base41daefdd1671b029b8c2c650d30787f586cdd69f). Please keep both PRs together for adoption. This branch does not modify the parent branch.When one benefit unit supplies an advance repayment amount, Core fills every omitted unit with the variable default and bypasses the amount formula. A default of zero silently removes another claimant's fallback: the 2025 age-30
ADVANCE_ONLYcase with latent rate 0.1 loses £480.168/year when a neighbour supplies zero.Use the existing cash-input convention (
uc_reported_capital,benunit_reported_capital): the default -1 preserves missingness per unit, and the deduction formula resolves negative amounts through the shared legacy cash estimate. Explicit zero and positive cash keep their precedence. Fully supplied, partially supplied and unsupplied populations are covered. The existing same-year baseline allowance, caps, abolition switches, penny floor, supplied-rate precedence and protected-floor allocation retain their behavior.Validation:
uvx ruff format --check .: passed (1937 files); fullruff check .andgit diff --check: passed.-n 2and BLAS/OpenMP threads of 2, covering both deduction YAML files,test_uc_deductions.py, the new seven population cases and Hypothesis peer-independence property, and allowance-rebalancing tests. The retry command and helpers are in workspace.job/HANDOFF.md.Reproducer: policyengine_uk/tests/test_uc_advance_repayment_properties.py::test_each_unit_resolves_its_own_advance_amount
axiom: n/a: per-unit missing-input handling only; the cash recovery policy encoded by #2574 is unchanged
No full-population microsimulation, data build or documentation build is required for this input-handling fix. Independent final-head review remains with the UK hub. Keep draft; do not merge or mark ready.