Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update code to use Tax-Calculator 4.3.5 #322

Merged
merged 3 commits into from
Dec 16, 2024
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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

setup(
name="tmd",
version="0.6.1",
version="0.6.2",
packages=find_packages(),
python_requires=">=3.10,<3.13",
install_requires=[
"policyengine_us==1.55.0",
"tables", # required by policyengine_us
"taxcalc>=4.3.4",
"taxcalc>=4.3.5",
"scikit-learn",
"torch",
"tensorboard",
Expand Down
8 changes: 4 additions & 4 deletions tests/expected_tax_expenditures
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ YR,KIND,EST= 2023 cgqd_tax_preference 219.7
YR,KIND,EST= 2023 qbid 52.1
YR,KIND,EST= 2023 salt 21.1
YR,KIND,EST= 2026 paytax 1832.8
YR,KIND,EST= 2026 iitax 3188.6
YR,KIND,EST= 2026 iitax 3164.6
YR,KIND,EST= 2026 ctc 43.9
YR,KIND,EST= 2026 eitc 77.1
YR,KIND,EST= 2026 social_security_partial_taxability 47.5
YR,KIND,EST= 2026 social_security_partial_taxability 46.8
YR,KIND,EST= 2026 niit -52.1
YR,KIND,EST= 2026 cgqd_tax_preference 222.2
YR,KIND,EST= 2026 cgqd_tax_preference 221.3
YR,KIND,EST= 2026 qbid -0.0
YR,KIND,EST= 2026 salt 165.0
YR,KIND,EST= 2026 salt 163.3
4 changes: 2 additions & 2 deletions tests/test_area_weights.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ def test_area_xx(tests_folder):
# compare actual vs expected results for faux area xx
# ... instantiate Tax-Calculator object for area
pol = tc.Policy.tmd_constructor(
growfactors_path=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
growfactors=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
)
rec = tc.Records.tmd_constructor(
data_path=(STORAGE_FOLDER / "output" / "tmd.csv.gz"),
weights_path=(AREAS_FOLDER / "weights" / "xx_tmd_weights.csv.gz"),
growfactors_path=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
growfactors=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
exact_calculations=True,
)
sim = tc.Calculator(policy=pol, records=rec)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def compare(name, act, exp, tol):

# use national tmd files to compute various 2021 income tax statistics
pol = tc.Policy.tmd_constructor(
growfactors_path=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
growfactors=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
)
rec = tc.Records.tmd_constructor(
data_path=(STORAGE_FOLDER / "output" / "tmd.csv.gz"),
weights_path=(STORAGE_FOLDER / "output" / "tmd_weights.csv.gz"),
growfactors_path=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
growfactors=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
exact_calculations=True,
)
sim = tc.Calculator(policy=pol, records=rec)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_tax_revenue.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_tax_revenue(
exp_ptax[year] = round(fy2cy(fy_ptax[year], fy_ptax[year + 1]), 3)
# calculate actual tax revenues for each calendar year
pol = tc.Policy.tmd_constructor(
growfactors_path=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
growfactors=(STORAGE_FOLDER / "output" / "tmd_growfactors.csv"),
)
wghts = str(tmd_weights_path)
growf = tc.GrowFactors(growfactors_filename=str(tmd_growfactors_path))
Expand Down
4 changes: 2 additions & 2 deletions tmd/create_taxcalc_cached_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ def create_cached_files():
for each variable in the CACHED_TAXCALC_VARIABLES list.
"""
# calculate all Tax-Calculator variables for TAX_YEAR
pol = tc.Policy.tmd_constructor(growfactors_path=GFFILE_PATH)
pol = tc.Policy.tmd_constructor(growfactors=GFFILE_PATH)
rec = tc.Records.tmd_constructor(
data_path=INFILE_PATH,
weights_path=WTFILE_PATH,
growfactors_path=GFFILE_PATH,
growfactors=GFFILE_PATH,
exact_calculations=True,
)
calc = tc.Calculator(policy=pol, records=rec)
Expand Down
12 changes: 6 additions & 6 deletions tmd/examination/results4.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Phase 4+ National Data Examination Results
==========================================

**RESULTS AS OF 2024-11-30**
**RESULTS AS OF 2024-12-16**

This project is developing a new dataset for use by income and payroll
tax microsimulation models. The project is progressing in several
Expand All @@ -19,7 +19,7 @@ For more on the source of the federal agency estimates and on how the
model-plus-dataset estimates are generated, see the [examination
methods](./methods.md) document. The model used to generate the
following Phase 6 estimates is [Tax-Calculator
4.3.4](https://github.com/PSLmodels/Tax-Calculator/blob/master/docs/about/releases.md)).
4.3.5](https://github.com/PSLmodels/Tax-Calculator/blob/master/docs/about/releases.md)).

<br>

Expand All @@ -37,7 +37,7 @@ following Phase 6 estimates is [Tax-Calculator
| CY23 Amount | CY26 Amount | Estimate Source |
| ---: | ---: | :--- |
| 2512.3 | 2849.4 | CBO |
| 2527.0 | 3188.6 | Tax-Calculator + phase 6 dataset |
| 2527.0 | 3164.6 | Tax-Calculator + phase 6 dataset |

<br>

Expand Down Expand Up @@ -67,7 +67,7 @@ following Phase 6 estimates is [Tax-Calculator
| ---: | ---: | :--- |
| 45.9 | 56.4 | JCT |
| 31.4 | 38.4 | TSY |
| 35.8 | 47.5 | Tax-Calculator + phase 6 dataset |
| 35.8 | 46.8 | Tax-Calculator + phase 6 dataset |

<br>

Expand All @@ -87,7 +87,7 @@ following Phase 6 estimates is [Tax-Calculator
| ---: | ---: | :--- |
| 259.3 | 239.8 | JCT |
| 153.9 | 182.4 | TSY |
| 219.7 | 222.2 | Tax-Calculator + phase 6 dataset |
| 219.7 | 221.3 | Tax-Calculator + phase 6 dataset |

<br>

Expand All @@ -107,4 +107,4 @@ following Phase 6 estimates is [Tax-Calculator
| ---: | ---: | :--- |
| 21.2 | 151.3 | JCT |
| 26.5 | 149.0 | TSY |
| 21.1 | 165.0 | Tax-Calculator + phase 6 dataset |
| 21.1 | 163.3 | Tax-Calculator + phase 6 dataset |
2 changes: 1 addition & 1 deletion tmd/utils/taxcalc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def add_taxcalc_outputs(
weights_scale=1.0,
)
if isinstance(growfactors, pathlib.PosixPath):
policy = tc.Policy.tmd_constructor(growfactors_path=growfactors)
policy = tc.Policy.tmd_constructor(growfactors=growfactors)
else:
policy = tc.Policy()
if reform:
Expand Down
Loading