-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Add stage 3 adjustment ratios #1193
Conversation
…stment # Conflicts: # taxcalc/comparison/reform_results.txt # taxcalc/tests/pufcsv_agg_expect.txt # taxcalc/tests/pufcsv_mtr_expect.txt
…stment # Conflicts: # taxcalc/comparison/reform_results.txt # taxcalc/tests/pufcsv_agg_expect.txt # taxcalc/tests/pufcsv_mtr_expect.txt
…stment # Conflicts: # taxcalc/comparison/reform_results.txt # taxcalc/records.py # taxcalc/tests/pufcsv_agg_expect.txt # taxcalc/tests/pufcsv_mtr_expect.txt
…stment # Conflicts: # taxcalc/comparison/reform_results.txt # taxcalc/tests/pufcsv_agg_expect.txt
Codecov Report
@@ Coverage Diff @@
## master #1193 +/- ##
==========================================
- Coverage 98.87% 98.85% -0.03%
==========================================
Files 38 38
Lines 3023 3054 +31
==========================================
+ Hits 2989 3019 +30
- Misses 34 35 +1
Continue to review full report at Codecov.
|
@andersonfrailey, All the unit tests (other than the Use this page to see exactly which statements need to have new/expanded unit tests. Covering these eight statements will require enhancements to the |
@martinholmer, thanks for the tips. I worked on some enhancements to the two tests mentioned, but I'm not totally sure I got it right. Would you mind reviewing my latest commit? |
@andersonfrailey said:
Your test enhancements covered seven of the eight previously new uncovered statements. When I looked at the one remaining new uncovered statement, which was in the
The one remaining uncovered statement in this function is the However, in looking at this code there is one thing that must be changed. My understanding of the "egg magic" is that the egg contains the exact same Does that make sense? If so, then fix it and then I'll be happy to merge #1193. Question about test coverage: |
@martinholmer In the quoted code above:
ADJ should be the same whether loaded locally with A test of |
@martinholmer, thanks for the clarification. I've added @PeterDSteinberg, are you suggesting something like this in adj = pd.read_csv(Records.ADJUST_RATIOS_PATH)
adj = adj.transpose()
adj_egg = Records._read_egg_csv('adjust_ratios', Records.ADJUST_RATIOS_FILENAME)
adj_egg = adj_egg.transpose()
assert adj == adj_egg ? |
@andersonfrailey changed the code to be this way:
I'm sorry I wasn't more clear. There is no need for code duplication. I meant to suggest this:
|
@PeterDSteinberg said:
Thanks for the suggestion. Are you saying the the code below is going to execute just fine in our unit tests? If I have just the Tax-Calculator source code and no EGG, what's going to happen when I try to "grab vname data from EGG distribution"?
|
@andersonfrailey, taxcalc pull request #1193 -- and associated taxdata pull request 58 -- are substantial contributions that open up the possibility of more accurate distributions of income types other than taxable interest. Thank you for all this work. I'm merging #1193 now, so from now on the new @MattHJensen @feenberg @Amy-Xu @GoFroggyRun @codykallen @PeterDSteinberg |
Thanks @andersonfrailey! |
This PR adds a "stage 3" to the extrapolation/blowup process. This has been discussed extensively in TaxData PR #58 and TaxCalc issue #1110. Results of adding this step can be seen in this notebook.
Key changes are:
puf_ratios.csv
. This file contains the adjustment ratiosrecords.py
to read and apply the adjustment ratiospufcsv_xxx_expect.txt
files andreform_results.txt
--adjust
argument toinctax.py
and modifyincometaxio.py
to accept that inputThe implementation of stage 3 required adding a new variable to the PUF that indicates what adjustment ratio needs to be applied to each record, so a new PUF file must be issued that contains this. More information on this variable can be found in TaxData issue #58.
@martinholmer @MattHJensen @codykallen