Skip to content

Commit

Permalink
read 311 pickle when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jdebacker committed Oct 14, 2023
1 parent 3fa9d50 commit 1bec7ed
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
22 changes: 16 additions & 6 deletions tests/test_output_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,28 @@
base_tpi = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl")
)
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
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")
)
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")
)
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
)
if(os.python.version<3.11):
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
)
else:
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl")
)
reform_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_reform.pkl")
)
Expand Down
22 changes: 16 additions & 6 deletions tests/test_output_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,28 @@
base_tpi = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl")
)
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
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")
)
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")
)
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
)
if(os.python.version<3.11):
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
)
else:
reform_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl")
)
# add investment tax credit parameter that not in cached parameters
base_params.inv_tax_credit = np.zeros(
(base_params.T + base_params.S, base_params.M)
Expand Down
11 changes: 8 additions & 3 deletions tests/test_parameter_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@

# Load in test results and parameters
CUR_PATH = os.path.abspath(os.path.dirname(__file__))
base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
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")
)
base_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_baseline.pkl")
)
Expand Down
11 changes: 8 additions & 3 deletions tests/test_parameter_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@
# Load in test results and parameters
CUR_PATH = os.path.abspath(os.path.dirname(__file__))

base_params = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
)
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")
)
base_taxfunctions = utils.safe_read_pickle(
os.path.join(CUR_PATH, "test_io_data", "TxFuncEst_baseline.pkl")
)
Expand Down

0 comments on commit 1bec7ed

Please sign in to comment.