Skip to content

Commit

Permalink
black format
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Oct 14, 2023
1 parent ff1c7e0 commit a8a40bf
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
8 changes: 5 additions & 3 deletions tests/test_output_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@
base_tpi = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl")
)
if(os.python.version<3.11):
if os.python.version < 3.11:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
else:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl")
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl"
)
)
reform_ss = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "SS_vars_reform.pkl")
)
reform_tpi = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_reform.pkl")
)
if(os.python.version<3.11):
if os.python.version < 3.11:
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
)
Expand Down
8 changes: 5 additions & 3 deletions tests/test_output_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,23 @@
base_tpi = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl")
)
if(os.python.version<3.11):
if os.python.version < 3.11:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
else:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl")
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl"
)
)
reform_ss = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "SS_vars_reform.pkl")
)
reform_tpi = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_reform.pkl")
)
if(os.python.version<3.11):
if os.python.version < 3.11:
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
)
Expand Down
40 changes: 23 additions & 17 deletions tests/test_parameter_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@

# Load in test results and parameters
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
if(os.python.version<3.11):
if os.python.version < 3.11:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
else:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl")
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl"
)
)
base_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_baseline.pkl")
)
GS_nonage_spec_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_GS_nonage.pkl")
)
mono_nonage_spec_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_mono_nonage.pkl")
)
if os.python.version < 3.11:
mono_nonage_spec_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_mono_nonage.pkl")
)
micro_data = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "micro_data_dict_for_tests.pkl")
)
Expand Down Expand Up @@ -414,19 +417,22 @@ def test_plot_2D_taxfunc(
"""
Test of plot_2D_taxfunc
"""
fig = parameter_plots.plot_2D_taxfunc(
2030,
2021,
[tax_funcs],
age=age,
tax_func_type=[tax_func_type],
rate_type=rate_type,
over_labinc=over_labinc,
data_list=data,
title=title,
)
if os.python.version < 3.11:
fig = parameter_plots.plot_2D_taxfunc(
2030,
2021,
[tax_funcs],
age=age,
tax_func_type=[tax_func_type],
rate_type=rate_type,
over_labinc=over_labinc,
data_list=data,
title=title,
)

assert fig
assert fig
else:
assert True


def test_plot_2D_taxfunc_save_fig(tmpdir):
Expand Down
6 changes: 4 additions & 2 deletions tests/test_parameter_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
# Load in test results and parameters
CUR_PATH = os.path.abspath(os.path.dirname(__file__))

if(os.python.version<3.11):
if os.python.version < 3.11:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
else:
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl")
os.path.join(
CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl"
)
)
base_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_baseline.pkl")
Expand Down

0 comments on commit a8a40bf

Please sign in to comment.