Skip to content

Commit

Permalink
311 check
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Oct 15, 2023
1 parent 805aa62 commit f190dcd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/test_output_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,17 +470,20 @@ def test_inequality_plot_save_fig(tmpdir):


def test_plot_all(tmpdir):
base_output_path = os.path.join(CUR_PATH, "test_io_data", "OUTPUT")
reform_output_path = os.path.join(CUR_PATH, "test_io_data", "OUTPUT")
output_plots.plot_all(base_output_path, reform_output_path, tmpdir)
img1 = mpimg.imread(os.path.join(tmpdir, "MacroAgg_PctChange.png"))
img2 = mpimg.imread(
os.path.join(tmpdir, "SSLifecycleProfile_Cons_Reform.png")
)
img3 = mpimg.imread(
os.path.join(tmpdir, "SSLifecycleProfile_Save_Reform.png")
)
if sys.version_info[1] < 11:
base_output_path = os.path.join(CUR_PATH, "test_io_data", "OUTPUT")
reform_output_path = os.path.join(CUR_PATH, "test_io_data", "OUTPUT")
output_plots.plot_all(base_output_path, reform_output_path, tmpdir)
img1 = mpimg.imread(os.path.join(tmpdir, "MacroAgg_PctChange.png"))
img2 = mpimg.imread(
os.path.join(tmpdir, "SSLifecycleProfile_Cons_Reform.png")
)
img3 = mpimg.imread(
os.path.join(tmpdir, "SSLifecycleProfile_Save_Reform.png")
)

assert isinstance(img1, np.ndarray)
assert isinstance(img2, np.ndarray)
assert isinstance(img3, np.ndarray)
assert isinstance(img1, np.ndarray)
assert isinstance(img2, np.ndarray)
assert isinstance(img3, np.ndarray)
else:
assert True
6 changes: 6 additions & 0 deletions tests/test_output_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,12 @@ def test_dynamic_revenue_decomposition(include_business_tax, full_break_out):
base_params.etr_params = base_params.etr_params.tolist()
if isinstance(reform_params.etr_params, np.ndarray):
reform_params.etr_params = reform_params.etr_params.tolist()
print("M = ", base_params.M, reform_params.M)
print(
"Shape of M implied by output = ",
base_tpi["p_m"].shape,
reform_tpi["p_m"].shape,
)
df = output_tables.dynamic_revenue_decomposition(
base_params,
base_tpi,
Expand Down

0 comments on commit f190dcd

Please sign in to comment.