diff --git a/changelog.d/fix-uc-standard-allowance-reform.fixed.md b/changelog.d/fix-uc-standard-allowance-reform.fixed.md new file mode 100644 index 000000000..bd2726b23 --- /dev/null +++ b/changelog.d/fix-uc-standard-allowance-reform.fixed.md @@ -0,0 +1 @@ +Fix UC standard allowance reforms being ignored due to rebalancing set_input. diff --git a/policyengine_uk/scenarios/uc_reform.py b/policyengine_uk/scenarios/uc_reform.py index 1b91c0d1c..293574278 100644 --- a/policyengine_uk/scenarios/uc_reform.py +++ b/policyengine_uk/scenarios/uc_reform.py @@ -33,16 +33,9 @@ def add_universal_credit_reform(sim: Microsimulation): ) # Monthly amount * 12 sim.set_input("uc_LCWRA_element", year, current_health_element) - # https://bills.parliament.uk/publications/62123/documents/6889#page=14 - - uc_uplift = rebalancing.standard_allowance_uplift - - for year in range(2026, 2030): - if not rebalancing.active(year): - continue - previous_value = sim.calculate("uc_standard_allowance", year - 1) - new_value = previous_value * (1 + uc_uplift(year)) - sim.set_input("uc_standard_allowance", year, new_value) + # Standard allowance uplift is now handled in the uc_standard_allowance + # formula itself, so that user reforms to the base amount are respected. + # See: https://github.com/PolicyEngine/policyengine-uk/issues/1472 universal_credit_july_2025_reform = Scenario( diff --git a/policyengine_uk/tests/microsimulation/reforms_config.yaml b/policyengine_uk/tests/microsimulation/reforms_config.yaml index af9f1a57a..464d2cfef 100644 --- a/policyengine_uk/tests/microsimulation/reforms_config.yaml +++ b/policyengine_uk/tests/microsimulation/reforms_config.yaml @@ -16,7 +16,7 @@ reforms: parameters: gov.hmrc.child_benefit.amount.additional: 25 - name: Reduce Universal Credit taper rate to 20% - expected_impact: -43.2 + expected_impact: -42.0 parameters: gov.dwp.universal_credit.means_test.reduction_rate: 0.2 - name: Raise Class 1 main employee NICs rate to 10% diff --git a/policyengine_uk/tests/microsimulation/test_uc_standard_allowance_reform.py b/policyengine_uk/tests/microsimulation/test_uc_standard_allowance_reform.py new file mode 100644 index 000000000..38edff881 --- /dev/null +++ b/policyengine_uk/tests/microsimulation/test_uc_standard_allowance_reform.py @@ -0,0 +1,25 @@ +"""Test UC standard allowance reforms are respected (#1472).""" + +from policyengine_uk import Simulation + +YEAR = 2026 + +SITUATION = { + "people": {"person": {"age": {YEAR: 30}}}, + "benunits": {"benunit": {"members": ["person"]}}, + "households": {"household": {"members": ["person"]}}, +} + +REFORM = { + "gov.dwp.universal_credit.standard_allowance.amount.SINGLE_OLD": { + "2025-01-01.2100-12-31": 800, + }, +} + + +def test_uc_standard_allowance_responds_to_reform(): + baseline = Simulation(situation=SITUATION) + b = baseline.calculate("uc_standard_allowance", YEAR)[0] + reformed = Simulation(situation=SITUATION, reform=REFORM) + r = reformed.calculate("uc_standard_allowance", YEAR)[0] + assert r / b > 1.5 diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/standard_allowance/uc_standard_allowance.py b/policyengine_uk/variables/gov/dwp/universal_credit/standard_allowance/uc_standard_allowance.py index 3d173c357..9dd1f748f 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/standard_allowance/uc_standard_allowance.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/standard_allowance/uc_standard_allowance.py @@ -11,4 +11,8 @@ class uc_standard_allowance(Variable): def formula(benunit, period, parameters): p = parameters(period).gov.dwp.universal_credit.standard_allowance claimant_type = benunit("uc_standard_allowance_claimant_type", period) - return p.amount[claimant_type] * MONTHS_IN_YEAR + value = p.amount[claimant_type] * MONTHS_IN_YEAR + rebalancing = parameters(period).gov.dwp.universal_credit.rebalancing + if rebalancing.active: + value = value * (1 + rebalancing.standard_allowance_uplift) + return value