Skip to content

Commit 626b246

Browse files
committed
create rather than read in params
1 parent c4d84ce commit 626b246

1 file changed

Lines changed: 25 additions & 30 deletions

File tree

tests/test_output_tables.py

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pandas as pd
99
import numpy as np
1010
from ogcore import utils, output_tables
11+
from ogcore.parameters import Specifications
1112

1213

1314
# Load in test results and parameters
@@ -18,42 +19,36 @@
1819
base_tpi = utils.safe_read_pickle(
1920
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_baseline.pkl")
2021
)
21-
if sys.version_info[1] < 11:
22-
base_params = utils.safe_read_pickle(
23-
os.path.join(CUR_PATH, "test_io_data", "model_params_baseline.pkl")
24-
)
25-
elif sys.version_info[1] == 11:
26-
base_params = utils.safe_read_pickle(
27-
os.path.join(
28-
CUR_PATH, "test_io_data", "model_params_baseline_v311.pkl"
29-
)
30-
)
31-
else:
32-
base_params = utils.safe_read_pickle(
33-
os.path.join(
34-
CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl"
35-
)
36-
)
22+
base_params = Specifications()
23+
base_params.update_specifications(
24+
{
25+
"M": 3,
26+
"gamma": [0.5, 0.5, 0.5],
27+
"gamma_g": [0.0, 0.0, 0.0],
28+
"epsilon": [0.5, 0.5, 0.5],
29+
"I": 3,
30+
"alpha_c": [0.3, 0.4, 0.3],
31+
"io_matrix": np.eye(3)
32+
}
33+
)
3734
reform_ss = utils.safe_read_pickle(
3835
os.path.join(CUR_PATH, "test_io_data", "SS_vars_reform.pkl")
3936
)
4037
reform_tpi = utils.safe_read_pickle(
4138
os.path.join(CUR_PATH, "test_io_data", "TPI_vars_reform.pkl")
4239
)
43-
if sys.version_info[1] < 11:
44-
reform_params = utils.safe_read_pickle(
45-
os.path.join(CUR_PATH, "test_io_data", "model_params_reform.pkl")
46-
)
47-
elif sys.version_info[1] == 11:
48-
reform_params = utils.safe_read_pickle(
49-
os.path.join(CUR_PATH, "test_io_data", "model_params_reform_v311.pkl")
50-
)
51-
else:
52-
reform_params = utils.safe_read_pickle(
53-
os.path.join(
54-
CUR_PATH, "test_io_data", "model_params_baseline_v312.pkl"
55-
)
56-
)
40+
reform_params = Specifications()
41+
reform_params.update_specifications(
42+
{
43+
"M": 3,
44+
"gamma": [0.5, 0.5, 0.5],
45+
"gamma_g": [0.0, 0.0, 0.0],
46+
"epsilon": [0.5, 0.5, 0.5],
47+
"I": 3,
48+
"alpha_c": [0.3, 0.4, 0.3],
49+
"io_matrix": np.eye(3)
50+
}
51+
)
5752
# add investment tax credit parameter that not in cached parameters
5853
base_params.inv_tax_credit = np.zeros(
5954
(base_params.T + base_params.S, base_params.M)

0 commit comments

Comments
 (0)