diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/calibrate_tranches.py | 2 | ||||
| -rw-r--r-- | python/calibrate_tranches_BC.py | 4 | ||||
| -rw-r--r-- | python/intex/intex_scenarios.py | 2 | ||||
| -rw-r--r-- | python/load_cf.py | 2 | ||||
| -rw-r--r-- | python/risk_insight/views.py | 1 |
5 files changed, 5 insertions, 6 deletions
diff --git a/python/calibrate_tranches.py b/python/calibrate_tranches.py index 0c4f1099..c9e64e5f 100644 --- a/python/calibrate_tranches.py +++ b/python/calibrate_tranches.py @@ -12,7 +12,7 @@ n_credit = 100 Z, w = GHquad(n_int) with open("../R/index_definitions.yml") as fh: - indices = yaml.load(fh) + indices = yaml.load(fh, Loader=yaml.FullLoader) indices['hy21']['maturity'] = datetime.date(1970, 1, 1) + datetime.timedelta(indices['hy21']['maturity']) hy21 = indices['hy21'] hy21["startdate"] = datetime.date(2013, 9, 20) diff --git a/python/calibrate_tranches_BC.py b/python/calibrate_tranches_BC.py index 8fde82e9..1e1b2512 100644 --- a/python/calibrate_tranches_BC.py +++ b/python/calibrate_tranches_BC.py @@ -6,7 +6,7 @@ import logging import os import pandas as pd from pathlib import Path -from yaml import load +from yaml import full_load import argparse @@ -115,7 +115,7 @@ if __name__ == "__main__": config = {"runs": [(args.index, args.tenor)]} else: with (CODE_DIR / "etc" / args.config).open("r") as fh: - config = load(fh) + config = full_load(fh) for index, tenor in config["runs"]: begin_date = None diff --git a/python/intex/intex_scenarios.py b/python/intex/intex_scenarios.py index 79b50639..ea0166b2 100644 --- a/python/intex/intex_scenarios.py +++ b/python/intex/intex_scenarios.py @@ -80,7 +80,7 @@ def generate_scenarios(workdate, dealname, conn): replace = "\g<a>{0:.3f}".format(defaultedprice) try: with open(os.path.join(basedir, "csv", dealname + ".config")) as fh: - config = yaml.load(fh) + config = yaml.load(fh, Loader=yaml.FullLoader) except IOError: logger.error("{0}: config file doesn't exist".format(dealname)) return diff --git a/python/load_cf.py b/python/load_cf.py index ce4c18c2..3f4949b9 100644 --- a/python/load_cf.py +++ b/python/load_cf.py @@ -53,7 +53,7 @@ def get_configfile(dealname, tradedate): "csv", dealname + ".config")
try:
with open(configfile) as fh:
- config = yaml.load(fh)
+ config = yaml.load(fh, Loader=yaml.FullLoader)
except FileNotFoundError:
config = {"reinvflag": True}
return config
diff --git a/python/risk_insight/views.py b/python/risk_insight/views.py index d0a1f7df..9256aeda 100644 --- a/python/risk_insight/views.py +++ b/python/risk_insight/views.py @@ -2,7 +2,6 @@ import csv import datetime import os import psycopg2 -import yaml from risk_insight import app from flask import render_template, jsonify, request, g |
