Map disability benefit categories in UK data#383
Conversation
6c7aef8 to
c766af1
Compare
|
Addressed cross-PR review findings:
|
c766af1 to
c750776
Compare
|
Small follow-up after checking DLA aggregate preservation: category assignment now uses the same baseline DWP thresholds that the removed PE-UK category formulas used. The disability flag recomputation still uses the current-law DWP rates, matching the existing UK-data FRS derivation. This should keep DLA/PIP/AA category assignment behavior aligned with the pre-PR model while still publishing concrete category inputs instead of reported amount intermediates. |
|
Verified aggregate preservation on the cached private enhanced FRS. I converted the old reported-amount dataset into category inputs with this PR's mapper, then compared current PE-UK on the old dataset against PE-UK #1656 on the converted dataset. Totals are exactly identical for the affected disability benefits: DLA £4.449897bn, DLA self-care £2.936218bn, DLA mobility £1.513680bn, PIP £25.045953bn, AA £7.966628bn. |
Summary
Companion to PolicyEngine/policyengine-uk#1656.
Tests
uv run ruff check policyengine_uk_data/datasets/disability_benefits.py policyengine_uk_data/datasets/frs.py policyengine_uk_data/datasets/create_datasets.py policyengine_uk_data/datasets/enhanced_cps.py policyengine_uk_data/datasets/imputations/frs_only.py policyengine_uk_data/datasets/imputations/income.py policyengine_uk_data/tests/test_disability_benefits.py policyengine_uk_data/tests/test_policybench_transfer.pyuv run pytest -q policyengine_uk_data/tests/test_disability_benefits.py policyengine_uk_data/tests/test_frs_only_imputation.py policyengine_uk_data/tests/test_policybench_transfer.py::test_policybench_transfer_writes_only_valid_leaf_inputs policyengine_uk_data/tests/test_policybench_transfer.py::test_policybench_transfer_runs_uk_microsimulationPYTHONPATH=/private/tmp/pe-uk-pr1656 uv run pytest -q policyengine_uk_data/tests/test_disability_benefits.py policyengine_uk_data/tests/test_policybench_transfer.py::test_policybench_transfer_writes_only_valid_leaf_inputs policyengine_uk_data/tests/test_policybench_transfer.py::test_policybench_transfer_runs_uk_microsimulationuv run pytest -q policyengine_uk_data/tests/test_policybench_transfer.py