Skip to content

Commit 896b2be

Browse files
authored
Merge pull request #1547 from PolicyEngine/codex/fix-uc-standard-allowance
Fix UC standard allowance reforms being ignored
2 parents 32cbac6 + fb86b9f commit 896b2be

3 files changed

Lines changed: 34 additions & 11 deletions

File tree

policyengine_uk/scenarios/uc_reform.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,8 @@ def add_universal_credit_reform(sim: Microsimulation):
2929
) # Monthly amount * 12
3030
sim.set_input("uc_LCWRA_element", year, current_health_element)
3131

32-
# https://bills.parliament.uk/publications/62123/documents/6889#page=14
33-
34-
uc_uplift = rebalancing.standard_allowance_uplift
35-
36-
for year in range(2026, 2030):
37-
if not rebalancing.active(year):
38-
continue
39-
previous_value = sim.calculate("uc_standard_allowance", year - 1)
40-
new_value = previous_value * (1 + uc_uplift(year))
41-
sim.set_input("uc_standard_allowance", year, new_value)
32+
# Standard allowance uplift is handled in the formula itself so user
33+
# reforms to the base amount are applied before the uplift.
4234

4335

4436
universal_credit_july_2025_reform = Scenario(
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""Test UC standard allowance reforms are respected (#1472)."""
2+
3+
from policyengine_uk import Simulation
4+
5+
YEAR = 2026
6+
7+
SITUATION = {
8+
"people": {"person": {"age": {YEAR: 30}}},
9+
"benunits": {"benunit": {"members": ["person"]}},
10+
"households": {"household": {"members": ["person"]}},
11+
}
12+
13+
REFORM = {
14+
"gov.dwp.universal_credit.standard_allowance.amount.SINGLE_OLD": {
15+
"2025-01-01.2100-12-31": 800,
16+
},
17+
}
18+
19+
20+
def test_uc_standard_allowance_responds_to_reform():
21+
baseline = Simulation(situation=SITUATION)
22+
baseline_amount = baseline.calculate("uc_standard_allowance", YEAR)[0]
23+
24+
reformed = Simulation(situation=SITUATION, reform=REFORM)
25+
reform_amount = reformed.calculate("uc_standard_allowance", YEAR)[0]
26+
27+
assert reform_amount / baseline_amount > 1.5

policyengine_uk/variables/gov/dwp/universal_credit/standard_allowance/uc_standard_allowance.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ class uc_standard_allowance(Variable):
1111
def formula(benunit, period, parameters):
1212
p = parameters(period).gov.dwp.universal_credit.standard_allowance
1313
claimant_type = benunit("uc_standard_allowance_claimant_type", period)
14-
return p.amount[claimant_type] * MONTHS_IN_YEAR
14+
value = p.amount[claimant_type] * MONTHS_IN_YEAR
15+
rebalancing = parameters(period).gov.dwp.universal_credit.rebalancing
16+
if rebalancing.active:
17+
value = value * (1 + rebalancing.standard_allowance_uplift)
18+
return value

0 commit comments

Comments
 (0)