diff options
Diffstat (limited to 'python/intex_scenarios.py')
| -rw-r--r-- | python/intex_scenarios.py | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/python/intex_scenarios.py b/python/intex_scenarios.py index da1fdfb8..eec0ec42 100644 --- a/python/intex_scenarios.py +++ b/python/intex_scenarios.py @@ -37,15 +37,16 @@ conn = psycopg2.connect(database="ET", host="192.168.1.108")
cursor = conn.cursor()
-maturity = "20141017"
for dealname in ["oceant2", "atr4cdo"]:
- cursor.execute('SELECT "Reinv End Date" from latest_clo_universe where dealname=%s', dealname)
+ cursor.execute('SELECT \"Reinv End Date\" from latest_clo_universe where dealname=%s', (dealname,))
reinvenddate = cursor.fetchone()[0]
- if not reinvenddate:
+ if reinvenddate:
+ reinvenddate = reinvenddate.strftime("%Y%m%d")
+ else:
print "missing reinvstment end date"
pdb.set_trace()
- with open(reinvprices, "r") as fhreinv:
+ with open(os.path.join(root, "Intex curves", "csv", dealname + "-reinvprices.csv"), "r") as fhreinv:
floatreinvprices = fhreinv.readline().rstrip("\n").split(",")
fixedreinvprices = fhreinv.readline().rstrip("\n").split(",")
@@ -115,13 +116,6 @@ for dealname in ["oceant2", "atr4cdo"]: recoveryline = "\t".join(["{0:.3f}".format(float(recovery)) \
for recovery in recoveryline]) + "\n"
continue
- # if "REINV_GLOBAL" in line:
- # jsondict = line.split("=")[1]
- # reinvdict = json.loads(jsondict)
- # reinvdict['STANDARD_VAR[REINVEST_PRICE]']['value'] = \
- # ' '.join(["{0:.3f}".format(float(price)) for price in reinvprices])
- # fh2.write("=".join(["REINV_GLOBAL", json.dumps(reinvdict)]) + "\n")
- # continue
fh2.write(line)
fh2.close()
fhrecovery.close()
|
