Repository navigation
Warn when datasets omit take-up inputs - #2967
juaristi22 wants to merge 1 commit into
Conversation
Aggregate impact on certified data: passBase Checks: 0 broken by this change, 1 failing on both sides, 0 fixed. Moves flagged for review: 0 (thresholds in Notes
Moves flagged for reviewNone. Spending by benefit and service
Caseloads
Household net income by decileNo household's net income changes in any year. No change in any year: receipts by tax head; government balance, each component counted once; model totals; household income totals; population; poverty rates; people in poverty; inequality; mean household net income in each side's own deciles; standard reform costings (change in gov_balance); standard reforms: change in each reform's target. Checks failing on both base and head (1)
Counted-once checkThe check raised each of 92 components by £1 per unit in 2026-27 and read every head of its totals household by household: its own head must rise by exactly £1, no other tax head may move, no other benefit may rise, and the model's own total must move by what its heads moved. A response that is not finite breaks every rule. The check measures a head that breaks a rule twice more: once holding every other head at its baseline value, and once holding every other head at its value after the first £1 while the component rises again. The head fails where either measurement still shows the response. The check cannot hold a head at a value that is not finite. In each unit where another head is not finite after the first £1, it holds that head at its baseline value, and the second measurement judges no household the unit belongs to. There a head fails wherever it first broke a rule, or wherever the check could not confirm whether its response contains the component. 0 failed and the check skipped 0.
Provenance
Dataset: Receipts by tax head: head levels
Spending by benefit and service: head levels
Caseloads: head levels
Government balance, each component counted once: head levels
Model totals: head levels
Household income totals: head levels
Population: head levels
Poverty rates: head levels
People in poverty: head levels
Inequality: head levels
Mean household net income in each side's own deciles: head levels
Standard reform costings (change in gov_balance): head levels
Standard reforms: change in each reform's target: head levels
|
Fixes #2916
Dataset-built
Microsimulationnow emits oneUserWarningnaming omitted formula-less Booleanwould_claim_*inputs that default toTrue. Setwarn_on_missing_takeup_inputs=Falseto opt out. PlainSimulationand situation-builtMicrosimulationstay quiet.A supplied period, including a scenario override or DataFrame period replay, counts as supplied; calculated caches do not. The diagnostic checks omission by variable, rather than completeness for every year or household. Input defaults and calculation results remain unchanged. Both the usage guide and dataset engineering guidance document the option.
Validation: 51 focused Python cases passed with no failures, errors or skips: 16 new warning cases and 35 existing provenance, constructor/scenario, dataset-route and method-layout regressions.
uv run --frozen --extra dev --offline --no-sync make formatpassed. An independent code-onlyreview-programreview completed with no findings or material gaps.The wider generic Simulation/dataframe run did not complete locally. The full repository/private-data suites and documentation build were not run locally; hosted CI remains to run at this head.
Reproducer: policyengine_uk/tests/test_missing_takeup_inputs.py::test_single_year_dataset_emits_one_aggregated_named_warning
axiom: n/a: constructor diagnostics and documentation only; no policy formulas, parameters, defaults or calculation results change.