diff --git a/cs-config/cs_config/constants.py b/cs-config/cs_config/constants.py index e99a535..68c710f 100644 --- a/cs-config/cs_config/constants.py +++ b/cs-config/cs_config/constants.py @@ -12,7 +12,7 @@ "choice": { "choices": [ yr for yr in range(TaxBrain.FIRST_BUDGET_YEAR, - TaxBrain.LAST_BUDGET_YEAR) + TaxBrain.LAST_BUDGET_YEAR + 1) ] } } @@ -135,7 +135,7 @@ class MetaParameters(paramtools.Parameters): "choice": { "choices": [ yr for yr in range(TaxBrain.FIRST_BUDGET_YEAR, - TaxBrain.LAST_BUDGET_YEAR) + TaxBrain.LAST_BUDGET_YEAR + 1) ] } } diff --git a/cs-config/cs_config/helpers.py b/cs-config/cs_config/helpers.py index f997adc..d5bcbfc 100644 --- a/cs-config/cs_config/helpers.py +++ b/cs-config/cs_config/helpers.py @@ -55,9 +55,9 @@ def handle_data_source(param_data): new_pcl = defaultdict(dict) new_pcl["schema"] = POLICY_SCHEMA - LAST_YEAR = 2026 + LAST_YEAR = 2030 pol = Policy() - pol.set_year(2026) + pol.set_year(2030) for param, item in pcl.items(): values = [] pol_val = getattr(pol, f"_{param}").tolist() diff --git a/cs-config/cs_config/outputs.py b/cs-config/cs_config/outputs.py index bfb86a4..ab5dd47 100644 --- a/cs-config/cs_config/outputs.py +++ b/cs-config/cs_config/outputs.py @@ -34,22 +34,22 @@ def aggregate_plot(tb): fig = figure(title="Aggregate Tax Liability by Year", width=700, height=500, tools="save") ii_base = fig.line(x="index", y="iitax", line_width=4, - line_color="#12719e", legend="Income Tax - Base", + line_color="#12719e", legend_label="Income Tax - Base", source=base_cds) ii_reform = fig.line(x="index", y="iitax", line_width=4, - line_color="#73bfe2", legend="Income Tax - Reform", + line_color="#73bfe2", legend_label="Income Tax - Reform", source=reform_cds) proll_base = fig.line(x="index", y="payrolltax", line_width=4, - line_color="#408941", legend="Payroll Tax - Base", + line_color="#408941", legend_label="Payroll Tax - Base", source=base_cds) proll_reform = fig.line(x="index", y="payrolltax", line_width=4, - line_color="#98cf90", legend="Payroll Tax - Reform", + line_color="#98cf90", legend_label="Payroll Tax - Reform", source=reform_cds) comb_base = fig.line(x="index", y="combined", line_width=4, - line_color="#a4201d", legend="Combined - Base", + line_color="#a4201d", legend_label="Combined - Base", source=base_cds) comb_reform = fig.line(x="index", y="combined", line_width=4, - line_color="#e9807d", legend="Combined - Reform", + line_color="#e9807d", legend_label="Combined - Reform", source=reform_cds) # format figure @@ -84,18 +84,20 @@ def aggregate_plot(tb): object2.visible = toggle.active object3.visible = toggle.active """ - base_callback = CustomJS.from_coffeescript(code=plot_js, args={}) + base_callback = CustomJS(code=plot_js, args={}) base_toggle = Toggle(label="Base", button_type="primary", - callback=base_callback, active=True) + active=True) base_callback.args = {"toggle": base_toggle, "object1": ii_base, "object2": proll_base, "object3": comb_base} + base_toggle.js_on_change('active', base_callback) - reform_callback = CustomJS.from_coffeescript(code=plot_js, args={}) + reform_callback = CustomJS(code=plot_js, args={}) reform_toggle = Toggle(label="Reform", button_type="primary", - callback=reform_callback, active=True) + active=True) reform_callback.args = {"toggle": reform_toggle, "object1": ii_reform, "object2": proll_reform, "object3": comb_reform} fig_layout = layout([fig], [base_toggle, reform_toggle]) + reform_toggle.js_on_change('active', reform_callback) # Components needed to embed the figure data = json_item(fig_layout) diff --git a/cs-config/cs_config/tests/test_functions.py b/cs-config/cs_config/tests/test_functions.py index 1f7d1b8..e3d4458 100644 --- a/cs-config/cs_config/tests/test_functions.py +++ b/cs-config/cs_config/tests/test_functions.py @@ -96,11 +96,11 @@ def test_convert_adj(): assert res == { "STD": { - 2019: [0, 1, 12268.8, 18403.2, 24537.6], - 2022: [0.0, 10, 13081.03, 19621.54, 26162.06] + 2019: [0, 1, 12200.0, 18350.0, 24400.0], + 2022: [0.0, 10, 12950.37, 19478.63, 25900.74] }, "CPI_offset": {2019: -0.001}, - "EITC_c": {2019: [1000.0, 3538.53, 5844.04, 6575.05]}, + "EITC_c": {2019: [1000.0, 3526.0, 5828.0, 6557.0]}, "BEN_ssi_repeal": {2019: True} } @@ -125,8 +125,8 @@ def test_convert_adj_w_index(): }, "ACTC_c": {2019: 2000.0, 2026: 1000.0}, "STD": { - 2019: [2000.0, 24537.6, 12268.8, 18403.2, 24537.6], - 2020: [2000.0, 12345, 12268.8, 18403.2, 24537.6], - 2026: [1000.0, 12345.0, 12268.8, 18403.2, 24537.6] + 2019: [2000.0, 24400.0, 12200.0, 18350.0, 24400.0], + 2020: [2000.0, 12345, 12200.0, 18350.0, 24400.0], + 2026: [1000.0, 12345.0, 12200.0, 18350.0, 24400.0] } } \ No newline at end of file diff --git a/cs-config/install.sh b/cs-config/install.sh index 02f50a7..15e7070 100644 --- a/cs-config/install.sh +++ b/cs-config/install.sh @@ -1,2 +1,2 @@ # bash commands for installing your package -conda install -c pslmodels -c conda-forge nodejs "taxbrain>=2.3.2" "taxcalc>=2.5.0" "paramtools>=0.10.2" pypandoc +conda install -c pslmodels -c conda-forge nodejs "taxbrain>=2.3.2" "taxcalc>=2.5.0" "paramtools>=0.10.2" bokeh pypandoc diff --git a/taxbrain/report.py b/taxbrain/report.py index d34ba06..6cea1a0 100644 --- a/taxbrain/report.py +++ b/taxbrain/report.py @@ -58,7 +58,7 @@ def export_plot(plot, graph): else: filename = f"{graph}_graph.svg" full_filename = Path(output_path, filename) - export_svgs(plot, full_filename) + export_svgs(plot, filename=full_filename) return filename diff --git a/taxbrain/tests/expected_weighted_table.csv b/taxbrain/tests/expected_weighted_table.csv index a7269ab..e03788b 100644 --- a/taxbrain/tests/expected_weighted_table.csv +++ b/taxbrain/tests/expected_weighted_table.csv @@ -1,4 +1,4 @@ ,2018,2019 -Base,2469977377368.852,2615396291735.824 -Reform,2469977377368.852,2643836717370.0815 -Difference,0.0,28440425634.257324 +Base,2481877857290.395,2626559393875.8115 +Reform,2481877857290.395,2651607151121.6987 +Difference,0.0,25047757245.887207