1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-13 07:46:53 +08:00

yml afe load

This commit is contained in:
Young
2021-02-17 05:17:18 +00:00
parent 04b916c8ae
commit 83237ba4ed
6 changed files with 7 additions and 7 deletions

View File

@@ -110,7 +110,7 @@ class UserManager:
raise ValueError("User data for {} already exists".format(user_id))
with config_file.open("r") as fp:
config = yaml.load(fp)
config = yaml.safe_load(fp)
# load model
model = init_instance_by_config(config["model"])

View File

@@ -88,7 +88,7 @@ def prepare(um, today, user_id, exchange_config=None):
dates.append(get_next_trading_date(dates[-1], future=True))
if exchange_config:
with pathlib.Path(exchange_config).open("r") as fp:
exchange_paras = yaml.load(fp)
exchange_paras = yaml.safe_load(fp)
else:
exchange_paras = {}
trade_exchange = Exchange(trade_dates=dates, **exchange_paras)

View File

@@ -14,7 +14,7 @@ class TunerConfigManager:
self.config_path = config_path
with open(config_path) as fp:
config = yaml.load(fp)
config = yaml.safe_load(fp)
self.config = copy.deepcopy(config)
self.pipeline_ex_config = PipelineExperimentConfig(config.get("experiment", dict()), self)