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

Allow compound reforms when using tc tool --reform option #1842

Merged
merged 3 commits into from
Jan 27, 2018
Merged

Allow compound reforms when using tc tool --reform option #1842

merged 3 commits into from
Jan 27, 2018

Conversation

martinholmer
Copy link
Collaborator

@martinholmer martinholmer commented Jan 24, 2018

This pull request enhances the existing tc --reform REFORM option so that it can handle a compound reform.
A compound reform is a reform that is composed of two (or more) individual reforms. For an example of a compound reform, see the section entitled A Round-Trip Compound Reform at the bottom of this FAQ.

So, for example, if a user has specified reformA.json and reformB.json and is interested in analyzing the joint effect of the two reforms (that is, first implementing reformA relative to current-law policy and then implementing reformB relative to reformA policy), the user simply executes a command like this:

$ tc cps.csv 2020 --reform reformA.json+reformB.json

The above command will generate two output files with the following names:

cps-20-reformA+reformB-#-doc.text    <==== compound reform documentation
cps-20-reformA+reformB-#.csv         <==== minimal output file

As one would expect, using this new feature produces the following results:

$ cp ../tax-calculator/taxcalc/reforms/2017_law.json .
$ cp ../tax-calculator/taxcalc/reforms/TCJA_Reconciliation.json ./TCJA.json
$ ls *json
2017_law.json   TCJA.json

$ tc cps.csv 2020 --tables
You loaded data for 2014.
Tax-Calculator startup automatically extrapolated your data to 2020.
$ ls cps-20-*
cps-20-#-#-doc.text	cps-20-#-#-tab.text	cps-20-#-#.csv

$ tc cps.csv 2020 --tables --reform 2017_law.json+TCJA.json
You loaded data for 2014.
Tax-Calculator startup automatically extrapolated your data to 2020.
$ ls cps-20-*
cps-20-#-#-doc.text		cps-20-2017_law+TCJA-#-doc.text
cps-20-#-#-tab.text		cps-20-2017_law+TCJA-#-tab.text
cps-20-#-#.csv			cps-20-2017_law+TCJA-#.csv

$ diff  cps-20-#-#-tab.text  cps-20-2017_law+TCJA-#-tab.text 
$

As with the Python programming in #1830, the round-trip compound reform (of implementing 2017_law.json and then TCJA.json) produces exactly the same results as does current-law policy.

The need for this enhancement was discussed as part of merged pull request 1803 beginning with this comment.

@codecov-io
Copy link

codecov-io commented Jan 24, 2018

Codecov Report

Merging #1842 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1842   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          37      37           
  Lines        3103    3141   +38     
======================================
+ Hits         3103    3141   +38
Impacted Files Coverage Δ
taxcalc/calculate.py 100% <100%> (ø) ⬆️
taxcalc/taxcalcio.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f69b78a...b8da81a. Read the comment docs.

@martinholmer martinholmer added ready and removed WIP labels Jan 24, 2018
@martinholmer martinholmer merged commit 215ce15 into PSLmodels:master Jan 27, 2018
@martinholmer martinholmer deleted the tc-compound-reform branch January 27, 2018 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants