From 3fc0938b8f40dc23b7b87bf8a664af052aa698eb Mon Sep 17 00:00:00 2001 From: Nikhil Woodruff Date: Wed, 18 Sep 2024 00:34:08 +0100 Subject: [PATCH] Format --- policyengine_uk_data/utils/imputations/capital_gains.py | 1 + policyengine_uk_data/utils/loss.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/policyengine_uk_data/utils/imputations/capital_gains.py b/policyengine_uk_data/utils/imputations/capital_gains.py index 5af3e0a..fcfec08 100644 --- a/policyengine_uk_data/utils/imputations/capital_gains.py +++ b/policyengine_uk_data/utils/imputations/capital_gains.py @@ -24,6 +24,7 @@ def impute_capital_gains(dataset, time_period: int): from policyengine_uk import Microsimulation from policyengine_uk.system import system + sim = Microsimulation(dataset=dataset) ti = sim.calculate("total_income", time_period) household_weight = sim.calculate("household_weight", time_period).values diff --git a/policyengine_uk_data/utils/loss.py b/policyengine_uk_data/utils/loss.py index 26036bb..163cc7b 100644 --- a/policyengine_uk_data/utils/loss.py +++ b/policyengine_uk_data/utils/loss.py @@ -39,6 +39,7 @@ def create_target_matrix( # First- tax-benefit outcomes from the DWP and OBR. from policyengine_uk import Microsimulation + sim = Microsimulation(dataset=dataset, reform=reform) sim.default_calculation_period = time_period @@ -248,6 +249,7 @@ def pe_count(*variables): def get_loss_results(dataset, time_period, reform=None): matrix, targets = create_target_matrix(dataset, time_period, reform) from policyengine_uk import Microsimulation + weights = ( Microsimulation(dataset=dataset, reform=reform) .calculate("household_weight", time_period)