diff options
| -rw-r--r-- | python/populate_risk_numbers.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/populate_risk_numbers.py b/python/populate_risk_numbers.py index 4e8c3f3d..73d4de7c 100644 --- a/python/populate_risk_numbers.py +++ b/python/populate_risk_numbers.py @@ -14,16 +14,16 @@ sqlstr = "INSERT INTO risk_numbers VALUES({0},{1})".format(",".join(["%s"] * 10) ",".join(["%s::float[]"]*9)) def get_attach_from_name(index_type, series): - if index_type.lower() == "ig": + if index_type == "ig": if series == 9: attach = [0, 3, 7, 10, 15, 30, 100] else: attach = [0, 3, 7, 15, 100] - elif index_type.lower() == "hy": + elif index_type == "hy": attach = [0, 15, 25, 35, 100] - elif index_type.lower() == "xo": + elif index_type == "xo": attach = [0, 10, 20, 35, 100] - elif index_type.lower() == 'eu': + elif index_type == 'eu': if series >= 21: attach = [0, 3, 6, 12, 100] else: @@ -38,9 +38,9 @@ def populate_risk(basedir, db): c.execute("DELETE FROM risk_numbers") db.commit() for index_type, series, tenor in get_index_list(basedir): - attach = get_attach_from_name(index_type, series) + attach = get_attach_from_name(index_type.lower(), series) with open(os.path.join(basedir, "Tranche_data", "Runs", - "{0}{1}.{2}.csv".format(index_type, series, tenor))) as fh: + "{0}{1}.{2}.csv".format(index_type.lower(), series, tenor))) as fh: csvreader = csv.DictReader(fh) with db.cursor() as c: toinsert = [] |
