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

Updates to TC tables in Tax-Calculator PR 1917 #846

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 1 addition & 1 deletion conda-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nomkl
taxcalc==0.15.2
taxcalc==0.17.0
btax==0.2.2
ogusa==0.5.8
numba>=0.33.0
Expand Down
2 changes: 1 addition & 1 deletion deploy/fab/dropq_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies:
- python<=2.7.14,>=2.7.12
- numpy >=1.12.1
- pandas >=0.22.0
- taxcalc =0.15.2
- taxcalc =0.17.0
- btax =0.2.2
- ogusa =0.5.8
- numba
Expand Down
17 changes: 12 additions & 5 deletions static/js/taxbrain-tablebuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ $(function() {

rowLabels: function() {
if (this.get('grouping') == 'bin') {
// TODO: retrieve labels from the context and display them instead of hardcode labels here
return [
'<$10K',
'<$0K',
'=$0K',
'$0-10K',
'$10-20K',
'$20-30K',
'$30-40K',
Expand All @@ -116,11 +119,13 @@ $(function() {
'$200-500K',
'$500-1000K',
'>$1000K',
'All'
'ALL'
];
} else if (this.get('grouping') == 'dec') {
return [
'0-10',
'0-10: <$0',
'0-10: =$0',
'0-10: >$0',
'10-20',
'20-30',
'30-40',
Expand All @@ -130,8 +135,10 @@ $(function() {
'70-80',
'80-90',
'90-100',
'All'
];
'ALL',
'90-95',
'95-99',
'Top 1%' ];
}
}
});
Expand Down
35 changes: 8 additions & 27 deletions webapp/apps/taxbrain/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,22 +245,16 @@ def default_taxcalc_data(cls, start_year, metadata=False):
[1000000000, 'Dollars', 1], # "Total Tax Difference",
[ 1, '%', 1], # "Share of Overall Change"
]
TAXCALC_RESULTS_BIN_ROW_KEYS = taxcalc.WEBBIN_ROW_NAMES
#TODO: apply these labels to the rows displayed on the output page
TAXCALC_RESULTS_BIN_ROW_KEYS = taxcalc.STANDARD_ROW_NAMES
TAXCALC_RESULTS_BIN_ROW_KEY_LABELS = {
'<$10K':'Less than 10',
'$10-20K':'10-20',
'$20-30K':'20-30',
'$30-40K':'30-40',
'$40-50K':'40-50',
'$50-75K':'50-75',
'$75-100K':'75-100',
'$100-200K':'100-200',
'$200-500K':'200-500',
'$500-1000K':'500-1000',
'>$1000K':'1000+',
'all':'All'
k: k for k in taxcalc.STANDARD_ROW_NAMES
}
TAXCALC_RESULTS_DEC_ROW_KEYS = taxcalc.DECILE_ROW_NAMES[:-3]
# TODO:
TAXCALC_RESULTS_DEC_ROW_KEYS = taxcalc.DECILE_ROW_NAMES
# use our own PolicyBrain names for the first three items
POLICYBRAIN_DEC_ROW_LABELS = taxcalc.DECILE_ROW_NAMES
TAXCALC_RESULTS_DEC_ROW_KEY_LABELS = {k: k for k in taxcalc.DECILE_ROW_NAMES}
# -DEC_ROW_NAMES = ['perc0-10', 'perc10-20', 'perc20-30', 'perc30-40',
# - 'perc40-50', 'perc50-60', 'perc60-70', 'perc70-80',
# - 'perc80-90', 'perc90-100', 'all']
Expand Down Expand Up @@ -316,19 +310,6 @@ def default_taxcalc_data(cls, start_year, metadata=False):
'fiscal_tot_ref': 'aggr_2'
}

TAXCALC_RESULTS_DEC_ROW_KEY_LABELS = {
'0-10':'0-10%',
'10-20':'10-20%',
'20-30':'20-30%',
'30-40':'30-40%',
'40-50':'40-50%',
'50-60':'50-60%',
'60-70':'60-70%',
'70-80':'70-80%',
'80-90':'80-90%',
'90-100':'90-100%',
'all':'All'
}
TAXCALC_RESULTS_TABLE_LABELS = {
'diff_comb_xbin': 'Combined Payroll and Individual Income Tax: Difference between Base and User plans by expanded income bin',
'diff_comb_xdec': 'Combined Payroll and Individual Income Tax: Difference between Base and User plans by expanded income decile',
Expand Down
3 changes: 2 additions & 1 deletion webapp/apps/taxbrain/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,8 @@ def get_result_context(model, request, url):
tables['cdf_bin'] = tables.pop('diff_comb_xbin')

json_table = json.dumps(tables)

# TODO: Add row labels for decile and income bin tables to the context here
# and display these instead of hardcode in the javascript
context = {
'locals':locals(),
'unique_url':url,
Expand Down