Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Aug 17, 2024
1 parent a3652ab commit a00db08
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
15 changes: 12 additions & 3 deletions tests/test_output_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
)
else:
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl")
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl"
)
)
reform_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_reform.pkl")
Expand Down Expand Up @@ -228,7 +230,11 @@ def test_plot_industry_aggregates(
def test_plot_aggregates_save_fig(tmpdir):
path = os.path.join(tmpdir, "test_plot.png")
output_plots.plot_aggregates(
base_tpi, base_params, start_year=int(base_params.start_year), plot_type="levels", path=path
base_tpi,
base_params,
start_year=int(base_params.start_year),
plot_type="levels",
path=path,
)
img = mpimg.imread(path)

Expand All @@ -238,7 +244,10 @@ def test_plot_aggregates_save_fig(tmpdir):
def test_plot_aggregates_not_a_type(tmpdir):
with pytest.raises(AssertionError):
output_plots.plot_aggregates(
base_tpi, base_params, start_year=int(base_params.start_year), plot_type="levels2"
base_tpi,
base_params,
start_year=int(base_params.start_year),
plot_type="levels2",
)


Expand Down
4 changes: 3 additions & 1 deletion tests/test_output_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
)
else:
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl")
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl"
)
)
# add investment tax credit parameter that not in cached parameters
base_params.inv_tax_credit = np.zeros(
Expand Down
10 changes: 6 additions & 4 deletions tests/test_parameter_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
)
if base_params.rho.ndim == 1:
base_params.rho = np.tile(
base_params.rho.reshape(1, base_params.S),
(base_params.T + base_params.S, 1),
)
base_params.rho.reshape(1, base_params.S),
(base_params.T + base_params.S, 1),
)


def test_plot_imm_rates():
Expand Down Expand Up @@ -107,7 +107,9 @@ def test_plot_pop_growth():


def test_plot_pop_growth_rates_save_fig(tmpdir):
parameter_plots.plot_pop_growth(base_params, start_year=int(base_params.start_year), path=tmpdir)
parameter_plots.plot_pop_growth(
base_params, start_year=int(base_params.start_year), path=tmpdir
)
img = mpimg.imread(os.path.join(tmpdir, "pop_growth_rates.png"))

assert isinstance(img, np.ndarray)
Expand Down

0 comments on commit a00db08

Please sign in to comment.