Skip to content

Commit b2c399d

Browse files
committed
Remove uprating metadata from formula variables
1 parent 7802f54 commit b2c399d

14 files changed

Lines changed: 308 additions & 296 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove redundant uprating metadata and class-level aggregation metadata from variables that already define their computation explicitly.

policyengine_uk/variables/contrib/policyengine/pre_budget_change_household_benefits.py

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,53 @@
11
from policyengine_uk.model_api import *
22

33

4+
PRE_BUDGET_CHANGE_HOUSEHOLD_BENEFIT_VARIABLES = [
5+
"child_benefit",
6+
"council_tax_benefit",
7+
"esa_income",
8+
"housing_benefit",
9+
"income_support",
10+
"jsa_income",
11+
"pension_credit",
12+
"universal_credit",
13+
"working_tax_credit",
14+
"child_tax_credit",
15+
"attendance_allowance",
16+
"afcs",
17+
"bsp",
18+
"carers_allowance",
19+
"dla",
20+
"esa_contrib",
21+
"iidb",
22+
"incapacity_benefit",
23+
"jsa_contrib",
24+
"pip",
25+
"sda",
26+
"state_pension",
27+
"maternity_allowance",
28+
"statutory_sick_pay",
29+
"statutory_maternity_pay",
30+
"ssmg",
31+
"basic_income",
32+
"epg_subsidy",
33+
"cost_of_living_support_payment",
34+
"energy_bills_rebate",
35+
"carer_support_payment",
36+
]
37+
38+
439
class pre_budget_change_household_benefits(Variable):
540
value_type = float
641
entity = Household
742
label = "household benefits"
843
documentation = "Total value of benefits received by household"
944
definition_period = YEAR
1045
unit = GBP
11-
adds = [
12-
"child_benefit",
13-
"council_tax_benefit",
14-
"esa_income",
15-
"housing_benefit",
16-
"income_support",
17-
"jsa_income",
18-
"pension_credit",
19-
"universal_credit",
20-
"working_tax_credit",
21-
"child_tax_credit",
22-
"attendance_allowance",
23-
"afcs",
24-
"bsp",
25-
"carers_allowance",
26-
"dla",
27-
"esa_contrib",
28-
"iidb",
29-
"incapacity_benefit",
30-
"jsa_contrib",
31-
"pip",
32-
"sda",
33-
"state_pension",
34-
"maternity_allowance",
35-
"statutory_sick_pay",
36-
"statutory_maternity_pay",
37-
"ssmg",
38-
"basic_income",
39-
"epg_subsidy",
40-
"cost_of_living_support_payment",
41-
"energy_bills_rebate",
42-
"carer_support_payment",
43-
]
4446

4547
def formula(household, period, parameters):
4648
contrib = parameters(period).gov.contrib
4749
uprating = contrib.benefit_uprating
48-
benefits = pre_budget_change_household_benefits.adds
50+
benefits = PRE_BUDGET_CHANGE_HOUSEHOLD_BENEFIT_VARIABLES
4951
if contrib.abolish_council_tax:
5052
benefits = [
5153
benefit for benefit in benefits if benefit != "council_tax_benefit"
Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
from policyengine_uk.model_api import *
22

33

4+
PRE_BUDGET_CHANGE_HOUSEHOLD_TAX_VARIABLES = [
5+
"expected_sdlt",
6+
"expected_ltt",
7+
"expected_lbtt",
8+
"corporate_sdlt",
9+
"business_rates",
10+
"council_tax",
11+
"domestic_rates",
12+
"fuel_duty",
13+
"tv_licence",
14+
"wealth_tax",
15+
"non_primary_residence_wealth_tax",
16+
"income_tax",
17+
"national_insurance",
18+
"LVT",
19+
"carbon_tax",
20+
"vat_change",
21+
"capital_gains_tax",
22+
]
23+
24+
425
class pre_budget_change_household_tax(Variable):
526
value_type = float
627
entity = Household
728
label = "household taxes"
829
documentation = "Total taxes owed by the household"
930
definition_period = YEAR
1031
unit = GBP
11-
adds = [
12-
"expected_sdlt",
13-
"expected_ltt",
14-
"expected_lbtt",
15-
"corporate_sdlt",
16-
"business_rates",
17-
"council_tax",
18-
"domestic_rates",
19-
"fuel_duty",
20-
"tv_licence",
21-
"wealth_tax",
22-
"non_primary_residence_wealth_tax",
23-
"income_tax",
24-
"national_insurance",
25-
"LVT",
26-
"carbon_tax",
27-
"vat_change",
28-
"capital_gains_tax",
29-
]
3032

3133
def formula(household, period, parameters):
3234
abolish_council_tax = parameters.gov.contrib.abolish_council_tax(period)
@@ -36,9 +38,9 @@ def formula(household, period, parameters):
3638
period,
3739
[
3840
tax
39-
for tax in pre_budget_change_household_tax.adds
41+
for tax in PRE_BUDGET_CHANGE_HOUSEHOLD_TAX_VARIABLES
4042
if tax not in ["council_tax"]
4143
],
4244
)
4345
else:
44-
return add(household, period, pre_budget_change_household_tax.adds)
46+
return add(household, period, PRE_BUDGET_CHANGE_HOUSEHOLD_TAX_VARIABLES)

policyengine_uk/variables/gov/dwp/state_pension_reported.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ class state_pension_reported(Variable):
77
label = "Reported income from the State Pension"
88
definition_period = YEAR
99
unit = GBP
10-
uprating = "gov.economic_assumptions.indices.obr.consumer_price_index"
1110

1211
def formula_2022(person, period, parameters):
1312
return person("state_pension_reported", period.last_year)

policyengine_uk/variables/gov/gov_spending.py

Lines changed: 53 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,68 @@
11
from policyengine_uk.model_api import *
22

33

4+
GOV_SPENDING_VARIABLES = [
5+
"child_benefit",
6+
"council_tax_benefit",
7+
"esa_income",
8+
"esa_contrib",
9+
"housing_benefit",
10+
"income_support",
11+
"jsa_income",
12+
"jsa_contrib",
13+
"pension_credit",
14+
"universal_credit",
15+
"working_tax_credit",
16+
"child_tax_credit",
17+
"attendance_allowance",
18+
"afcs",
19+
"bsp",
20+
"carers_allowance",
21+
"dla",
22+
"iidb",
23+
"incapacity_benefit",
24+
"pip",
25+
"sda",
26+
"state_pension",
27+
"maternity_allowance",
28+
"statutory_sick_pay",
29+
"statutory_maternity_pay",
30+
"ssmg",
31+
"basic_income",
32+
"epg_subsidy",
33+
"cost_of_living_support_payment",
34+
"energy_bills_rebate",
35+
"winter_fuel_allowance",
36+
"pawhp",
37+
"other_public_spending_budget_change",
38+
"tax_free_childcare",
39+
"extended_childcare_entitlement",
40+
"universal_childcare_entitlement",
41+
"targeted_childcare_entitlement",
42+
"care_to_learn",
43+
"childcare_grant",
44+
"parents_learning_allowance",
45+
"adult_dependants_grant",
46+
"travel_grant",
47+
"disabled_students_allowance",
48+
"bursary_fund_16_to_19",
49+
"dfe_education_spending",
50+
"dft_subsidy_spending",
51+
"nhs_spending",
52+
"carer_support_payment",
53+
]
54+
55+
456
class gov_spending(Variable):
557
label = "government spending"
658
documentation = "Government spending impact in respect of this household."
759
entity = Household
860
definition_period = YEAR
961
value_type = float
1062
unit = GBP
11-
adds = [
12-
"child_benefit",
13-
"council_tax_benefit",
14-
"esa_income",
15-
"esa_contrib",
16-
"housing_benefit",
17-
"income_support",
18-
"jsa_income",
19-
"jsa_contrib",
20-
"pension_credit",
21-
"universal_credit",
22-
"working_tax_credit",
23-
"child_tax_credit",
24-
"attendance_allowance",
25-
"afcs",
26-
"bsp",
27-
"carers_allowance",
28-
"dla",
29-
"iidb",
30-
"incapacity_benefit",
31-
"pip",
32-
"sda",
33-
"state_pension",
34-
"maternity_allowance",
35-
"statutory_sick_pay",
36-
"statutory_maternity_pay",
37-
"ssmg",
38-
"basic_income",
39-
"epg_subsidy",
40-
"cost_of_living_support_payment",
41-
"energy_bills_rebate",
42-
"winter_fuel_allowance",
43-
"pawhp",
44-
"other_public_spending_budget_change",
45-
"tax_free_childcare",
46-
"extended_childcare_entitlement",
47-
"universal_childcare_entitlement",
48-
"targeted_childcare_entitlement",
49-
"care_to_learn",
50-
"childcare_grant",
51-
"parents_learning_allowance",
52-
"adult_dependants_grant",
53-
"travel_grant",
54-
"disabled_students_allowance",
55-
"bursary_fund_16_to_19",
56-
"dfe_education_spending",
57-
"dft_subsidy_spending",
58-
"nhs_spending",
59-
"carer_support_payment",
60-
]
6163

6264
def formula(household, period, parameters):
63-
variables = list(gov_spending.adds)
65+
variables = list(GOV_SPENDING_VARIABLES)
6466
abolish_council_tax = parameters.gov.contrib.abolish_council_tax(period)
6567
if abolish_council_tax:
6668
variables = [v for v in variables if v != "council_tax_benefit"]

policyengine_uk/variables/gov/gov_tax.py

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,43 @@
11
from policyengine_uk.model_api import *
22

33

4+
GOV_TAX_VARIABLES = [
5+
"expected_sdlt",
6+
"expected_ltt",
7+
"expected_lbtt",
8+
"corporate_sdlt",
9+
"business_rates",
10+
"council_tax",
11+
"high_value_council_tax_surcharge",
12+
"domestic_rates",
13+
"fuel_duty",
14+
"tv_licence",
15+
"wealth_tax",
16+
"non_primary_residence_wealth_tax",
17+
"income_tax",
18+
"national_insurance",
19+
"LVT",
20+
"carbon_tax",
21+
"capital_gains_tax",
22+
"private_school_vat",
23+
"corporate_incident_tax_revenue_change",
24+
"consumer_incident_tax_revenue_change",
25+
"ni_employer",
26+
"student_loan_repayments",
27+
"vat",
28+
]
29+
30+
431
class gov_tax(Variable):
532
label = "government tax revenue"
633
documentation = "Government tax revenue impact in respect of this household."
734
entity = Household
835
definition_period = YEAR
936
value_type = float
1037
unit = GBP
11-
adds = [
12-
"expected_sdlt",
13-
"expected_ltt",
14-
"expected_lbtt",
15-
"corporate_sdlt",
16-
"business_rates",
17-
"council_tax",
18-
"high_value_council_tax_surcharge",
19-
"domestic_rates",
20-
"fuel_duty",
21-
"tv_licence",
22-
"wealth_tax",
23-
"non_primary_residence_wealth_tax",
24-
"income_tax",
25-
"national_insurance",
26-
"LVT",
27-
"carbon_tax",
28-
"capital_gains_tax",
29-
"private_school_vat",
30-
"corporate_incident_tax_revenue_change",
31-
"consumer_incident_tax_revenue_change",
32-
"ni_employer",
33-
"student_loan_repayments",
34-
"vat",
35-
]
3638

3739
def formula(household, period, parameters):
38-
variables = list(gov_tax.adds)
40+
variables = list(GOV_TAX_VARIABLES)
3941
abolish_council_tax = parameters.gov.contrib.abolish_council_tax(period)
4042
if abolish_council_tax:
4143
variables = [

0 commit comments

Comments
 (0)