Skip to content

Commit

Permalink
Added a new test for the reweight logic
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Jul 22, 2024
1 parent b4d3bc9 commit 132a004
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions reweight/tests/test_uk_prototype.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,25 @@ def test_uk_microsimulation():

# Create a Microsimulation instance
sim = Microsimulation()

def test_uk_prototype():
from policyengine_uk import Microsimulation
from reweight.logic import reweight
import torch
sim = Microsimulation()

from policyengine_uk.data import RawFRS_2021_22
RawFRS_2021_22().download()

from policyengine_uk.data.datasets.frs.calibration.calibrate import generate_model_variables
(
household_weights,
weight_adjustment,
values_df,
targets,
targets_array,
equivalisation_factors_array
) = generate_model_variables("frs_2021", 2025)

sim_matrix = torch.tensor(values_df.to_numpy(), dtype=torch.float32)
reweight.reweight(household_weights, sim_matrix, targets, targets_array)

0 comments on commit 132a004

Please sign in to comment.