From 401c35ad39c9534c5f6bd31ba414055b24ce6088 Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Mon, 16 Sep 2024 11:42:04 +0100 Subject: [PATCH] Remove unused variables --- .../tests/code_health/test_variables.py | 2 +- .../tests/microsimulation/test_uprating.py | 26 ------------------ .../variables/household/income/income.py | 27 ------------------- 3 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 policyengine_uk/tests/microsimulation/test_uprating.py diff --git a/policyengine_uk/tests/code_health/test_variables.py b/policyengine_uk/tests/code_health/test_variables.py index 456d344b2..1cda05ae0 100644 --- a/policyengine_uk/tests/code_health/test_variables.py +++ b/policyengine_uk/tests/code_health/test_variables.py @@ -1,5 +1,5 @@ -from policyengine_uk import BASELINE_VARIABLES from policyengine_core.model_api import Enum +from policyengine_uk.system import variables as BASELINE_VARIABLES def test_variable_names_match_return_types(): diff --git a/policyengine_uk/tests/microsimulation/test_uprating.py b/policyengine_uk/tests/microsimulation/test_uprating.py deleted file mode 100644 index ae32d600a..000000000 --- a/policyengine_uk/tests/microsimulation/test_uprating.py +++ /dev/null @@ -1,26 +0,0 @@ -from policyengine_uk import Microsimulation -from policyengine_uk.data import EnhancedFRS -import pytest -from itertools import product - -UPRATED_VARIABLES = ( - "council_tax", - "employment_income", - "private_pension_income", - "self_employment_income", - "property_income", - "savings_interest_income", - "dividend_income", -) - -sim = Microsimulation(dataset=EnhancedFRS) - - -@pytest.mark.parametrize( - "variable,year", product(UPRATED_VARIABLES, range(2023, 2026)) -) -def test_uprating(variable: str, year: int): - assert any( - sim.calc(variable, period=year).values - != sim.calc(variable, period=2022).values - ) diff --git a/policyengine_uk/variables/household/income/income.py b/policyengine_uk/variables/household/income/income.py index c47e7ea9a..75bd28eb3 100644 --- a/policyengine_uk/variables/household/income/income.py +++ b/policyengine_uk/variables/household/income/income.py @@ -42,21 +42,6 @@ def formula(person, period, parameters): return income - person("maintenance_expenses", period) -class gross_income(Variable): - value_type = float - entity = Person - label = "Gross income, including benefits" - definition_period = YEAR - unit = GBP - - def formula(person, period, parameters): - COMPONENTS = [ - "market_income", - "benefits", - ] - return add(person, period, COMPONENTS) - - class household_gross_income(Variable): value_type = float entity = Household @@ -73,18 +58,6 @@ def formula(household, period, parameters): ) -class net_income(Variable): - value_type = float - entity = Person - label = "Net income" - documentation = "Market income, minus taxes, plus benefits" - unit = GBP - definition_period = YEAR - - def formula(person, period, parameters): - return person("gross_income", period) - person("tax", period) - - class hours_worked(Variable): value_type = float entity = Person