From 3bd2d79fc986411b25968b2d1f956feaf275a2d1 Mon Sep 17 00:00:00 2001 From: "md.abdullah.noman" Date: Tue, 22 Oct 2024 19:06:24 +0800 Subject: [PATCH 1/2] Map state code of 0 to Alaska Fixes #22 --- .gitignore | 2 ++ policyengine_taxsim/core/input_mapper.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index 1bf0872..d087db4 100644 --- a/.gitignore +++ b/.gitignore @@ -167,3 +167,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ input/* +output.csv +taxsim_input.csv diff --git a/policyengine_taxsim/core/input_mapper.py b/policyengine_taxsim/core/input_mapper.py index f5b3151..199739e 100644 --- a/policyengine_taxsim/core/input_mapper.py +++ b/policyengine_taxsim/core/input_mapper.py @@ -17,6 +17,10 @@ def import_single_household(taxsim_vars): mappings = load_variable_mappings()["taxsim_to_policyengine"] year = str(int(taxsim_vars["year"])) # Ensure year is an integer string + + if "state" not in taxsim_vars: # If state is not provided set it to AL as default calculation + taxsim_vars["state"] = 1 + state = get_state_code(taxsim_vars["state"]) situation = { From b62594626cd0596f42efa6130e8cc1b396e26e06 Mon Sep 17 00:00:00 2001 From: noman404 Date: Wed, 23 Oct 2024 12:04:46 +0800 Subject: [PATCH 2/2] issue fix #22 - added Alaska (AL) as default state if state is not passed --- policyengine_taxsim/core/input_mapper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policyengine_taxsim/core/input_mapper.py b/policyengine_taxsim/core/input_mapper.py index 199739e..a19e7b9 100644 --- a/policyengine_taxsim/core/input_mapper.py +++ b/policyengine_taxsim/core/input_mapper.py @@ -18,7 +18,7 @@ def import_single_household(taxsim_vars): year = str(int(taxsim_vars["year"])) # Ensure year is an integer string - if "state" not in taxsim_vars: # If state is not provided set it to AL as default calculation + if "state" not in taxsim_vars: # If state is not provided set it to AL as default state taxsim_vars["state"] = 1 state = get_state_code(taxsim_vars["state"])