Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ 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 28,
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 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:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion tests/test_imputed_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_revenue_levels_cbo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_soi_sanity_2022.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tmd/create_taxcalc_cached_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions tmd/datasets/cps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions tmd/imputation_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
3 changes: 2 additions & 1 deletion tmd/utils/soi_replication.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tmd/utils/taxcalc_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
Loading