Skip to content

Commit

Permalink
add dyn revenue table to tpi output
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Feb 24, 2024
1 parent b528184 commit 0b28937
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions cs-config/cs_config/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,8 +386,10 @@ def comp_output(
Function to create output for the COMP platform
"""
if time_path:
table_title = "Percentage Changes in Economic Aggregates Between"
table_title += " Baseline and Reform Policy"
macro_table_title = "Percentage Changes in Economic Aggregates Between"
macro_table_title += " Baseline and Reform Policy"
dynamic_rev_table_title = "Dynamic Revenue Estimate Decomposition"
download_table_title = "Economic variables over the time path"
plot1_title = "Pct Changes in Economic Aggregates Between"
plot1_title += " Baseline and Reform Policy"
plot2_title = "Pct Changes in Interest Rates and Wages"
Expand All @@ -401,7 +403,7 @@ def comp_output(
reform_tpi,
table_format="csv",
)
html_table = ot.macro_table(
macro_table = ot.macro_table(
base_tpi,
base_params,
reform_tpi,
Expand All @@ -414,6 +416,21 @@ def comp_output(
start_year=base_params.start_year,
table_format="html",
)
dynamic_rev_table = ot.dynamic_revenue_decomposition(
base_params,
base_tpi,
base_ss,
reform_params,
reform_tpi,
reform_ss,
num_years=10,
include_SS=True,
include_overall=True,
include_business_tax=True,
full_break_out=False,
start_year=base_params.start_year,
table_format="html",
)
fig1 = op.plot_aggregates(
base_tpi,
base_params,
Expand Down Expand Up @@ -491,21 +508,26 @@ def comp_output(
},
{
"media_type": "table",
"title": table_title,
"data": html_table,
"title": macro_table_title,
"data": macro_table,
},
{
"media_type": "table",
"title": dynamic_rev_table_title,
"data": dynamic_rev_table,
},
],
"downloadable": [
{
"media_type": "CSV",
"title": table_title,
"title": download_table_title,
"data": out_table.to_csv(),
}
],
}
else:
table_title = "Percentage Changes in Economic Aggregates Between"
table_title += " Baseline and Reform Policy"
macro_table_title = "Percentage Changes in Economic Aggregates Between"
macro_table_title += " Baseline and Reform Policy"
plot_title = "Percentage Changes in Consumption by Lifetime Income"
plot_title += " Percentile Group"
out_table = ot.macro_table_SS(
Expand All @@ -523,7 +545,7 @@ def comp_output(
],
table_format="csv",
)
html_table = ot.macro_table_SS(
macro_table_SS = ot.macro_table_SS(
base_ss,
reform_ss,
var_list=[
Expand Down Expand Up @@ -554,14 +576,14 @@ def comp_output(
},
{
"media_type": "table",
"title": table_title,
"data": html_table,
"title": macro_table_title,
"data": macro_table_SS,
},
],
"downloadable": [
{
"media_type": "CSV",
"title": table_title,
"title": macro_table_title,
"data": out_table.to_csv(),
}
],
Expand Down

0 comments on commit 0b28937

Please sign in to comment.