From 52953fbb35ad7db84b23d3219675f78ae192f4f5 Mon Sep 17 00:00:00 2001 From: martinholmer Date: Sat, 23 May 2026 11:05:16 -0400 Subject: [PATCH 1/3] Always specify taxcalc soi_iitax==True --- README.md | 3 +-- tests/test_imputed_variables.py | 4 +++- tests/test_revenue_levels_cbo.py | 3 ++- tests/test_soi_sanity_2022.py | 3 ++- tmd/create_taxcalc_cached_files.py | 3 ++- tmd/datasets/cps.py | 2 ++ tmd/imputation_assumptions.py | 3 +++ tmd/utils/soi_replication.py | 3 ++- tmd/utils/taxcalc_output.py | 3 ++- 9 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 172702f1..aed41743 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,7 @@ slightly in the national weights (all the `WT*` columns in the unchanged. When using version 2.1.0 to generate **sub-national weights**, there will be (presumably small) differences from the sub-national weights generated using version 2.0.0; however, the -sub-national weights fingerprints have not been updated in this pull -request. +sub-national weights fingerprints have not yet been updated. The prior TMD 2.0.0 version included the following significant improvements: diff --git a/tests/test_imputed_variables.py b/tests/test_imputed_variables.py index 25674657..4aa2a2f5 100644 --- a/tests/test_imputed_variables.py +++ b/tests/test_imputed_variables.py @@ -7,7 +7,7 @@ import numpy as np import pytest import taxcalc -from tmd.imputation_assumptions import TAXYEAR, CREDIT_CLAIMING +from tmd.imputation_assumptions import TAXYEAR, SOI_IITAX_SPEC, CREDIT_CLAIMING from tests.conftest import create_tmd_records @@ -124,6 +124,7 @@ def actual_results(rdf, bdf): ) # create baseline_sim Calculator object for simyear and get its output pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) baseline_sim = taxcalc.Calculator(policy=pol, records=recs) baseline_sim.advance_to_year(simyear) @@ -141,6 +142,7 @@ def actual_results(rdf, bdf): for ded, info in deductions.items(): # create reform Calculator object for simyear reform_policy = taxcalc.Policy() + reform_policy.implement_reform(SOI_IITAX_SPEC) reform_policy.implement_reform(CREDIT_CLAIMING) reform_policy.implement_reform(info["reform_dict"]) reform_sim = taxcalc.Calculator(policy=reform_policy, records=recs) diff --git a/tests/test_revenue_levels_cbo.py b/tests/test_revenue_levels_cbo.py index 88bdd48b..bca39bf5 100644 --- a/tests/test_revenue_levels_cbo.py +++ b/tests/test_revenue_levels_cbo.py @@ -18,7 +18,7 @@ import pytest import taxcalc -from tmd.imputation_assumptions import TAXYEAR, CREDIT_CLAIMING +from tmd.imputation_assumptions import TAXYEAR, SOI_IITAX_SPEC, CREDIT_CLAIMING # Per-year relative tolerance for all three aggregates. RELTOL = { @@ -45,6 +45,7 @@ def test_revenue_levels_cbo( exp = yaml.safe_load(f) pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) rec = taxcalc.Records( data=tmd_variables, diff --git a/tests/test_soi_sanity_2022.py b/tests/test_soi_sanity_2022.py index 6c8fbd89..74c971c7 100644 --- a/tests/test_soi_sanity_2022.py +++ b/tests/test_soi_sanity_2022.py @@ -49,7 +49,7 @@ import taxcalc from tmd.storage import STORAGE_FOLDER -from tmd.imputation_assumptions import TAXYEAR, CREDIT_CLAIMING +from tmd.imputation_assumptions import TAXYEAR, SOI_IITAX_SPEC, CREDIT_CLAIMING SOI_YEAR = 2022 RELATIVE_TOLERANCE = 0.01 @@ -90,6 +90,7 @@ def test_soi_sanity_2022( # using the post-calc_all arrays keeps one consistent source for # all five aggregates. pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) recs = taxcalc.Records( data=tmd_variables, diff --git a/tmd/create_taxcalc_cached_files.py b/tmd/create_taxcalc_cached_files.py index 2f23d648..0cd4a313 100644 --- a/tmd/create_taxcalc_cached_files.py +++ b/tmd/create_taxcalc_cached_files.py @@ -6,7 +6,7 @@ import pandas as pd import taxcalc from tmd.storage import STORAGE_FOLDER, CACHED_TAXCALC_VARIABLES -from tmd.imputation_assumptions import TAXYEAR, CREDIT_CLAIMING +from tmd.imputation_assumptions import TAXYEAR, SOI_IITAX_SPEC, CREDIT_CLAIMING INFILE_PATH = STORAGE_FOLDER / "output" / "tmd.csv.gz" WTFILE_PATH = STORAGE_FOLDER / "output" / "tmd_weights.csv.gz" @@ -22,6 +22,7 @@ def create_cached_files(): # Construct Records directly (bypassing tmd_constructor which # hardcodes start_year=2021 in the taxcalc library). pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) rec = taxcalc.Records( data=pd.read_csv(INFILE_PATH), diff --git a/tmd/datasets/cps.py b/tmd/datasets/cps.py index b5965629..700cf3fb 100644 --- a/tmd/datasets/cps.py +++ b/tmd/datasets/cps.py @@ -10,6 +10,7 @@ import taxcalc from tmd.storage import STORAGE_FOLDER from tmd.imputation_assumptions import ( + SOI_IITAX_SPEC, CREDIT_CLAIMING, CPS_FILER_MIN_INCOME, CPS_TAXABLE_INTEREST_FRACTION, @@ -357,6 +358,7 @@ def _is_tax_filer(tcdf: pd.DataFrame, taxyear: int) -> pd.Series: weights_scale=1.0, ) pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) calc = taxcalc.Calculator(records=rec, policy=pol) calc.advance_to_year(taxyear) diff --git a/tmd/imputation_assumptions.py b/tmd/imputation_assumptions.py index 20af3ada..66916bf7 100644 --- a/tmd/imputation_assumptions.py +++ b/tmd/imputation_assumptions.py @@ -76,3 +76,6 @@ 2022: "cbo26_population.yaml", } POPULATION_FILE = POP_FILE[TAXYEAR] + +# Tax-Calculator reform dictionary to produce SOI statistics +SOI_IITAX_SPEC = {"soi_iitax": {2013: True}} diff --git a/tmd/utils/soi_replication.py b/tmd/utils/soi_replication.py index 5ab7b8f9..10b5d960 100644 --- a/tmd/utils/soi_replication.py +++ b/tmd/utils/soi_replication.py @@ -1,10 +1,11 @@ import pandas as pd import taxcalc -from tmd.imputation_assumptions import CREDIT_CLAIMING +from tmd.imputation_assumptions import SOI_IITAX_SPEC, CREDIT_CLAIMING def taxcalc_to_soi(puf: pd.DataFrame, year: int) -> pd.DataFrame: pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) rec = taxcalc.Records( data=puf, diff --git a/tmd/utils/taxcalc_output.py b/tmd/utils/taxcalc_output.py index 636cc995..1f7b9934 100644 --- a/tmd/utils/taxcalc_output.py +++ b/tmd/utils/taxcalc_output.py @@ -7,7 +7,7 @@ import numpy as np import pandas as pd import taxcalc -from tmd.imputation_assumptions import CREDIT_CLAIMING +from tmd.imputation_assumptions import SOI_IITAX_SPEC, CREDIT_CLAIMING def add_taxcalc_outputs( @@ -47,6 +47,7 @@ def add_taxcalc_outputs( weights_scale=1.0, ) pol = taxcalc.Policy() + pol.implement_reform(SOI_IITAX_SPEC) pol.implement_reform(CREDIT_CLAIMING) if reform: pol.implement_reform(reform) From b5634d6049a620c83da24c5e9a7f1962b0360e40 Mon Sep 17 00:00:00 2001 From: martinholmer Date: Sat, 23 May 2026 17:01:59 -0400 Subject: [PATCH 2/3] Update to 2.1.1 version that requires taxcalc==6.6.1 --- README.md | 8 ++++---- setup.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aed41743..b4bb48ea 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,16 @@ For Tax-Calculator results generated when using these TMD input files, see [this folder](https://github.com/PSLmodels/Tax-Calculator/tree/master/taxcalc/cli/input_data_tests). -The **current TMD version is 2.1.0**, which was released on May 22, +The **current TMD version is 2.1.1**, which was released on May 24, 2026, and is the same as TMD version 2.0.0 except that Tax-Calculator -version 6.6.0 (instead of 6.5.3) is used to generate the TMD files. +version 6.6.1 (instead of 6.5.3) is used to generate the TMD files. -The current TMD 2.1.0 version differs from the 2.0.0 version only +The current TMD 2.1.1 version differs from the 2.0.0 version only slightly in the national weights (all the `WT*` columns in the `tmd_weights.csv.gz` file and just the `s006` variable in the `tmd.csv.gz` file); the non-weights input variables in the `tmd.csv.gz` file and the contents of `tmd_growfactors.csv` file are -unchanged. When using version 2.1.0 to generate **sub-national +unchanged. When using version 2.1.1 to generate **sub-national weights**, there will be (presumably small) differences from the sub-national weights generated using version 2.0.0; however, the sub-national weights fingerprints have not yet been updated. diff --git a/setup.py b/setup.py index 07fa71cc..b2b0ae4a 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,11 @@ setup( name="tmd", - version="2.1.0", + version="2.1.1", packages=find_packages(), python_requires=">=3.11,<3.14", install_requires=[ - "taxcalc==6.6.0", + "taxcalc==6.6.1", "numpy", "pandas>=3.0.2", "clarabel", From 8b7b6908cadbec87155439b82f159f414a8d2b63 Mon Sep 17 00:00:00 2001 From: martinholmer Date: Thu, 28 May 2026 10:35:06 -0400 Subject: [PATCH 3/3] Set date of version 2.1.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4bb48ea..fdecb4d7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ For Tax-Calculator results generated when using these TMD input files, see [this folder](https://github.com/PSLmodels/Tax-Calculator/tree/master/taxcalc/cli/input_data_tests). -The **current TMD version is 2.1.1**, which was released on May 24, +The **current TMD version is 2.1.1**, which was released on May 28, 2026, and is the same as TMD version 2.0.0 except that Tax-Calculator version 6.6.1 (instead of 6.5.3) is used to generate the TMD files.