Skip to content

Commit

Permalink
Rename to lowercase and adjust variable structure
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilwoodruff committed Sep 16, 2024
1 parent 0fe8115 commit 00c2b5f
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 15 deletions.
3 changes: 2 additions & 1 deletion policyengine_uk/variables/gov/dwp/AFCS.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class afcs(Variable):
label = "Armed Forces Compensation Scheme"
definition_period = YEAR
unit = GBP
uprating = "calibration.uprating.september_cpi"
uprating = "gov.benefit_uprating_cpi"

adds = ["afcs_reported"]

Expand All @@ -18,3 +18,4 @@ class afcs_reported(Variable):
label = "Armed Forces Compensation Scheme (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/BSP.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ class bsp_reported(Variable):
label = "Bereavement Support Payment (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/ESA_contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class esa_contrib_reported(Variable):
label = "Employment and Support Allowance (contribution-based) (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class esa(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/ESA_income.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class esa_income_reported(Variable):
label = "ESA (income-based) (reported amount)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class esa_income(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/IIDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ class iidb_reported(Variable):
label = "Industrial Injuries Disablement Benefit (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/JSA_contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ class jsa_contrib_reported(Variable):
label = "Job Seeker's Allowance (contribution-based) (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/JSA_income.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class jsa_income_reported(Variable):
label = "JSA (income-based) (reported amount)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class jsa_income(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/WFA.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class winter_fuel_allowance_reported(Variable):
label = "Winter fuel allowance"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class winter_fuel_allowance(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/attendance_allowance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class attendance_allowance_reported(Variable):
label = "Attendance Allowance (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class aa_category(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/carers_allowance.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ class carers_allowance_reported(Variable):
label = "Carer's Allowance (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/dla/mobility.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class dla_m_reported(Variable):
label = "DLA (mobility) (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class dla_m(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/dla/self_care.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class dla_sc_reported(Variable):
label = "DLA (self-care) (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class dla_sc(Variable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ class housing_benefit_reported(Variable):
label = "reported Housing Benefit amount"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/incapacity_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ class incapacity_benefit_reported(Variable):
label = "Incapacity Benefit (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/income_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class income_support_reported(Variable):
label = "Income Support (reported amount)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class would_claim_IS(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/maternity_allowance.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class ssmg_reported(Variable):
definition_period = YEAR
value_type = float
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class ssmg(Variable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ class pension_credit_reported(Variable):
definition_period = YEAR
value_type = float
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/pip/daily_living.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class pip_dl_reported(Variable):
label = "PIP (daily living) (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class pip_dl(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/pip/mobility.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class pip_m_reported(Variable):
label = "PIP (mobility) (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class pip_m(Variable):
Expand Down
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/sda.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ class sda_reported(Variable):
label = "Severe Disablement Allowance (reported)"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/dwp/state_pension.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class state_pension_reported(Variable):
label = "Reported income from the State Pension"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"

def formula_2022(person, period, parameters):
return person("state_pension_reported", period.last_year)
2 changes: 2 additions & 0 deletions policyengine_uk/variables/gov/dwp/tax_credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class working_tax_credit_reported(Variable):
label = "Working Tax Credit"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class child_tax_credit_reported(Variable):
Expand All @@ -15,6 +16,7 @@ class child_tax_credit_reported(Variable):
label = "Working Tax Credit"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class tax_credits_applicable_income(Variable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ class universal_credit_reported(Variable):
documentation = "Reported amount of Universal Credit"
definition_period = YEAR
unit = GBP
uprating = "gov.benefit_uprating_cpi"
1 change: 1 addition & 0 deletions policyengine_uk/variables/gov/hmrc/child_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class child_benefit_reported(Variable):
definition_period = YEAR
value_type = float
unit = GBP
uprating = "gov.benefit_uprating_cpi"


class would_claim_child_benefit(Variable):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def formula_2018_06_01(person, period, parameters):
scottish_band = select(
[
income < threshold
for threshold in rates.scotland.post_starter_rate.thresholds[
for threshold in rates.scotland.rates.thresholds[
:5
]
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ class earned_income_tax(Variable):

def formula(person, period, parameters):
rates = parameters(period).gov.hmrc.income_tax.rates
# return rates.uk.calc(person("earned_taxable_income", period))

return where(
person("pays_scottish_income_tax", period),
rates.scotland.post_starter_rate.calc(
rates.scotland.rates.calc(
person("earned_taxable_income", period)
),
rates.uk.calc(person("earned_taxable_income", period)),
Expand Down
11 changes: 0 additions & 11 deletions policyengine_uk/variables/input/income.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ class private_pension_income(Variable):
quantity_type = FLOW
uprating = "gov.obr.non_labour_income"

def formula(person, period, parameters):
# Don't have data, use the old pension income
pension_income = person("pension_income", period)
if pension_income.sum() != 0:
logging.warn(
"`pension_income` is deprecated and will be removed- use `private_pension_income` instead"
)
return pension_income
else:
return 0


class pension_income(Variable):
value_type = float
Expand Down

0 comments on commit 00c2b5f

Please sign in to comment.