Skip to content

Commit

Permalink
update test stats benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Bodi Yang committed Mar 18, 2024
2 parents cf077d7 + 9f7f095 commit d15d05b
Show file tree
Hide file tree
Showing 23 changed files with 681 additions and 191 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ puf.csv
*.ipynb_checkpoints*

# Built documentation
docs/_build/
docs/_build/

# Validation files
taxcalc/validation/taxsim35/actual_differences/
76 changes: 27 additions & 49 deletions PSL_catalog.json
Original file line number Diff line number Diff line change
@@ -1,51 +1,29 @@
{
"project_one_line": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<p>Tax-Calculator is an open-source microsimulation model for static analysis of USA federal income and payroll taxes.</p>"
},
"project_overview": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://PSLmodels.github.io/Tax-Calculator/\">What is Tax-Calculator?</a>"
},
"core_maintainers": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<ul><li>Jason DeBacker</li><li>Henry Doupe</li><li>Anderson Frailey</li><li>Matt Jensen</li></ul>"
},
"user_documentation": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"http://PSLmodels.github.io/Tax-Calculator/\"></a>"
},
"contributor_overview": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://pslmodels.github.io/Tax-Calculator/contributing/contributor_guide.html\"></a>"
},
"user_changelog_recent": {
"start_header": null,
"end_header": null,
"source": null,
"type": "html",
"data": "<a href=\"https://pslmodels.github.io/Tax-Calculator/about/changes.html\"></a>"
},
"link_to_webapp": {
"start_header": null,
"end_header": null,
"source": null,
"type": null,
"data": null
"name": "Tax-Calculator",
"img": "",
"banner_title": "Tax-Calculator",
"banner_subtitle": "USA Federal Individual Income and Payroll Tax Microsimulation Model",
"detailed_description": "Tax-Calculator is an open-source microsimulation model for static analysis of USA federal income and payroll taxes.",
"policy_area": "Tax Microsimulation, Revenue Estimation, Distributional Analysis",
"geography": "United States",
"language": "Python",
"maintainers": [
{
"name": "Jason DeBacker",
"image": "https://github.com/jdebacker.png",
"link": "https://github.com/jdebacker"
},
{
"name": "Matthew Jensen",
"image": "https://avatars.githubusercontent.com/u/8301092?v=4",
"link": "https://github.com/MattHJensen/"
},
],
"links": {
"code_repository": "https://github.com/PSLmodels/Tax-Calculator",
"user_documentation": "https://taxcalc.pslmodels.org/",
"contributor_documentation": "https://taxcalc.pslmodels.org/contributing/contributor_guide.html",
"webapp": "",
"recent_changes": "https://taxcalc.pslmodels.org/about/releases.html"
}
}
}
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ comment:

ignore:
- "setup.py"
- "new_json.py"
- "ppp.py"
19 changes: 18 additions & 1 deletion docs/about/releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ Release history
Go [here](https://github.com/PSLmodels/Tax-Calculator/pulls?q=is%3Apr+is%3Aclosed)
for a complete commit history.

2024-02-27 Release 3.5.1
------------------------
(last merged pull request is
[#2722](https://github.com/PSLmodels/Tax-Calculator/pull/2722))

**This is an enhancement and bug-fix release.**

**API Changes**

**New Features**


**Bug Fixes**
- Includes `paramtools` in required packages for installation [[#2721](https://github.com/PSLmodels/Tax-Calculator/pull/2721) by Jason DeBacker]



2024-02-10 Release 3.5.0
------------------------
(last merged pull request is
Expand All @@ -14,7 +31,7 @@ for a complete commit history.

**New Features**
- Add baseline table output to `cli` command [[#2714](https://github.com/PSLmodels/Tax-Calculator/pull/2714) by Martin Holmer]
- Additional TAXSIM-35 validation tools, serveral PRS by Bodi Yang and Jason DeBacker
- Additional TAXSIM-35 validation tools, several PRS by Bodi Yang and Jason DeBacker

**Bug Fixes**
- Avoid Pandas deprecation warnings[[#2715](https://github.com/PSLmodels/Tax-Calculator/pull/2785) by Martin Holmer]
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The cross-model validation work with NBER's TAXSIM-27 model is described

## Latest release

{doc}`3.5.0 (2024-02-10) <about/releases>`
{doc}`3.5.1 (2024-02-27) <about/releases>`

If you are already using Tax-Calculator, upgrade using the following command:

Expand Down
70 changes: 0 additions & 70 deletions new_json.py

This file was deleted.

44 changes: 24 additions & 20 deletions ppp.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
USAGE: $ python ppp.py
Note: running this script will write the new 2026 parameter values
directly to policy_current_law.json.
directly to policy_current_law.json. So, if you want to compare
the new 2026 parameter values with the old 2026 parameter values,
be sure to copy policy_current_law.json before running this script.
"""
from taxcalc import *
import json
import collections
from taxcalc import Policy

params = Policy()

Expand All @@ -27,29 +30,30 @@

# calculate the inflation factor used to calculate the
# inflation-adjusted 2026 parameter values
final_ifactor = 1.0
pyear = 2017 # prior year before TCJA first implemented
fyear = 2026 # final year in which parameter values revert to
FINAL_IFACTOR = 1.0
PYEAR = 2017 # prior year before TCJA first implemented
FYEAR = 2026 # final year in which parameter values revert to
# pre-TCJA values
# construct final-year inflation factor from prior year
# NOTE: pvalue[t+1] = pvalue[t] * ( 1 + irate[t] )
for year in range(pyear, fyear):
final_ifactor *= 1 + \
params._inflation_rates[year - params.start_year]
for year in range(PYEAR, FYEAR):
yindex = year - params.start_year
rate = params._inflation_rates[yindex] # pylint: disable=protected-access
FINAL_IFACTOR *= 1 + rate

long_param_vals = defaultdict(list)
long_param_vals = collections.defaultdict(list)

for param in long_params:
vos = params.select_eq(param, year=pyear)
# use final_ifactor to inflate from 2017 to 2026
vos = params.select_eq(param, year=PYEAR)
# use FINAL_IFACTOR to inflate from 2017 to 2026
for vo in vos:
long_param_vals[param].append(
# Create new dict to avoid modifying the original
# create new dict to avoid modifying the original
dict(
vo,
value=min(9e99, round(
vo["value"] * final_ifactor, 0)),
year=fyear,
vo["value"] * FINAL_IFACTOR, 0)),
year=FYEAR,
)
)

Expand All @@ -60,13 +64,13 @@
meta_data=False, serializable=True, use_state=False, _auto=False)

# read existing policy_current_law.json
with open('taxcalc/policy_current_law.json', 'r') as f:
pcl = json.load(f)
with open('taxcalc/policy_current_law.json', 'r', encoding='utf-8') as pcl_old:
pcl = json.load(pcl_old)

# replace 2026 values in policy_current_law.json
# replace 2026 values in the pcl dictionary
for param in param_data:
pcl[param]["value"] = param_data[param]

# write new policy_current_law.json
with open('taxcalc/policy_current_law.json', 'w') as pcl_old:
json.dump(pcl, pcl_old, indent=4)
# write new pcl dictionary to policy_current_law.json
with open('taxcalc/policy_current_law.json', 'w', encoding='utf-8') as pcl_new:
json.dump(pcl, pcl_new, indent=4)
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
with open("README.md") as f:
longdesc = f.read()

version = "3.5.0"
version = "3.5.1"

config = {
"description": "Tax Calculator",
"url": "https://github.com/PSLmodels/Tax-Calculator",
"download_url": "https://github.com/PSLmodels/Tax-Calculator",
"description": "taxcalc",
"long_description_content_type": "text/markdown",
"long_description": longdesc,
"version": version,
"license": "CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
Expand Down
3 changes: 2 additions & 1 deletion taxcalc.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: taxcalc
Version: 3.5.0
Version: 3.5.1
Summary: taxcalc
Home-page: https://github.com/PSLmodels/Tax-Calculator
Download-URL: https://github.com/PSLmodels/Tax-Calculator
Expand All @@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: setuptools
Requires-Dist: numpy
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
from taxcalc.utils import *
from taxcalc.cli import *

__version__ = '3.5.0'
__version__ = '3.5.1'
10 changes: 5 additions & 5 deletions taxcalc/policy_current_law.json
Original file line number Diff line number Diff line change
Expand Up @@ -7081,27 +7081,27 @@
{
"year": 2013,
"MARS": "single",
"value": 3000
"value": 3000.0
},
{
"year": 2013,
"MARS": "mjoint",
"value": 3000
"value": 3000.0
},
{
"year": 2013,
"MARS": "mseparate",
"value": 3000
"value": 3000.0
},
{
"year": 2013,
"MARS": "headhh",
"value": 3000
"value": 3000.0
},
{
"year": 2013,
"MARS": "widow",
"value": 3000
"value": 3000.0
}
],
"validators": {
Expand Down
Loading

0 comments on commit d15d05b

Please sign in to comment.