diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..bc8421dbe 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Switch for benefit uprating. diff --git a/policyengine_uk/parameters/gov/contrib/benefit_uprating/inflation_adjustment.yaml b/policyengine_uk/parameters/gov/contrib/benefit_uprating/inflation_adjustment.yaml new file mode 100644 index 000000000..fd8fdf510 --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/benefit_uprating/inflation_adjustment.yaml @@ -0,0 +1,6 @@ +description: Increase benefits subject to inflation uprating maximum amounts by this amount. This takes place over 2024. +values: + 2000-01-01: 0 +metadata: + unit: /1 + label: Benefit inflation adjustment \ No newline at end of file diff --git a/policyengine_uk/parameters/gov/contrib/benefit_uprating/non_sp.yaml b/policyengine_uk/parameters/gov/contrib/benefit_uprating/non_sp.yaml index 41a5029e3..94817e134 100644 --- a/policyengine_uk/parameters/gov/contrib/benefit_uprating/non_sp.yaml +++ b/policyengine_uk/parameters/gov/contrib/benefit_uprating/non_sp.yaml @@ -1,4 +1,4 @@ -description: Increase all non-State Pension benefits by this amount. +description: Increase all non-State Pension benefits by this amount (this multiplies the end value, not the maximum amount). values: 2000-01-01: 0 metadata: diff --git a/policyengine_uk/reforms/benefit_inflation_uprating.py b/policyengine_uk/reforms/benefit_inflation_uprating.py new file mode 100644 index 000000000..dd06d3192 --- /dev/null +++ b/policyengine_uk/reforms/benefit_inflation_uprating.py @@ -0,0 +1,102 @@ +from policyengine_uk.model_api import * +from typing import Union, Optional + + +def benefit_uprating_reform( + rate: float, +) -> Reform: + # Applies an increase to actual benefit amounts. + def modify_parameters(parameters): + dwp = parameters.gov.dwp + uc = dwp.universal_credit + sa = uc.standard_allowance.amount + pc = dwp.pension_credit + aa = dwp.attendance_allowance + pip = dwp.pip + dla = dwp.dla + hmrc = parameters.gov.hmrc + esa = dwp.ESA + jsa = dwp.JSA + tc = dwp.tax_credits + wtc = tc.working_tax_credit + ctc = tc.child_tax_credit + benefit_parameters = [ + sa.SINGLE_YOUNG, + sa.SINGLE_OLD, + sa.COUPLE_YOUNG, + sa.COUPLE_OLD, + uc.elements.child.amount, + uc.elements.child.first.higher_amount, + uc.elements.child.disabled.amount, + uc.elements.child.severely_disabled.amount, + uc.elements.carer.amount, + uc.elements.childcare.maximum.children["1"], + uc.elements.childcare.maximum.children["2"], + uc.means_test.work_allowance_with_housing, + uc.means_test.work_allowance_without_housing, + pc.guarantee_credit.minimum_guarantee.SINGLE, + pc.guarantee_credit.minimum_guarantee.COUPLE, + pc.savings_credit.threshold.SINGLE, + pc.savings_credit.threshold.COUPLE, + aa.higher, + aa.lower, + pip.daily_living.standard, + pip.daily_living.enhanced, + pip.mobility.standard, + pip.mobility.enhanced, + dla.mobility.lower, + dla.mobility.higher, + dla.self_care.lower, + dla.self_care.higher, + dla.self_care.middle, + dwp.carers_allowance.rate, + dwp.carer_premium.single, + dwp.carer_premium.couple, + dwp.sda.maximum, + dwp.IIDB.maximum, + hmrc.child_benefit.amount.eldest, + hmrc.child_benefit.amount.additional, + esa.income.amount_18_24, + esa.income.amount_over_25, + esa.income.couple, + jsa.income.amount_18_24, + jsa.income.amount_over_25, + jsa.income.couple, + wtc.elements.basic, + wtc.elements.couple, + wtc.elements.lone_parent, + wtc.elements.worker, + wtc.elements.disabled, + wtc.elements.severely_disabled, + ctc.elements.child_element, + ctc.elements.dis_child_element, + ctc.elements.severe_dis_child_element, + tc.means_test.income_threshold, + tc.means_test.income_threshold_CTC_only, + ] + for parameter in benefit_parameters: + print(parameter.name) + for parameter_at_instant in parameter.values_list: + parameter_at_instant.value *= rate + + for parameter in parameters.get_descendants(): + if isinstance(parameter, ParameterNode): + parameter._at_instant_cache = {} + parameters._at_instant_cache = {} + return parameters + + class reform(Reform): + def apply(self): + self.modify_parameters(modify_parameters) + + return reform + + +def create_benefit_inflation_uprating_reform(parameters, period): + uprating_amount = ( + parameters.gov.contrib.benefit_uprating.inflation_adjustment(period) + ) + if uprating_amount != 0: + return benefit_uprating_reform( + rate=1 + uprating_amount, + ) diff --git a/policyengine_uk/reforms/reforms.py b/policyengine_uk/reforms/reforms.py index 9a5fd7d3c..c035ef0c0 100644 --- a/policyengine_uk/reforms/reforms.py +++ b/policyengine_uk/reforms/reforms.py @@ -1,5 +1,22 @@ from .cps import create_marriage_tax_reform +from .benefit_inflation_uprating import ( + create_benefit_inflation_uprating_reform, +) +from policyengine_core.model_api import * +from policyengine_core import periods def create_structural_reforms_from_parameters(parameters, period): - return create_marriage_tax_reform(parameters, period) + period = periods.period(period) + reforms = [ + create_benefit_inflation_uprating_reform(parameters, period), + create_marriage_tax_reform(parameters, period), + ] + reforms = tuple(filter(lambda x: x is not None, reforms)) + + class combined_reform(Reform): + def apply(self): + for reform in reforms: + reform.apply(self) + + return combined_reform