aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/import_quotes.py2
-rw-r--r--python/load_cf.py2
-rw-r--r--python/task_server/globeop.py2
-rw-r--r--python/yieldcurve.py6
4 files changed, 6 insertions, 6 deletions
diff --git a/python/import_quotes.py b/python/import_quotes.py
index 589e9033..73250691 100644
--- a/python/import_quotes.py
+++ b/python/import_quotes.py
@@ -70,7 +70,7 @@ def get_current_tickers(database, workdate):
def insert_cds(database, workdate):
all_tickers, markit_bbg_mapping = get_current_tickers(database, workdate)
- filename = "cds eod {%Y%m%d}.csv".format(workdate)
+ filename = "cds eod {0:%Y%m%d}.csv".format(workdate)
colnames = ['Upfront'+tenor for tenor in ['6m', '1y', '2y', '3y', '4y', '5y', '7y', '10y']]
sqlstr = "INSERT INTO cds_quotes(date, curve_ticker, upfrontbid, upfrontask," \
"runningbid, runningask, source, recovery) VALUES(%s, %s, %s, %s, %s, %s, %s, %s)"
diff --git a/python/load_cf.py b/python/load_cf.py
index 0b998863..3eb5a20f 100644
--- a/python/load_cf.py
+++ b/python/load_cf.py
@@ -65,7 +65,7 @@ def get_configfile(dealname, tradedate):
def get_dist(date):
distfile = os.path.join(root, "Scenarios", "Calibration",
- "marketdata-{%Y-%m-%d}.RData".format(date))
+ "marketdata-{0:%Y-%m-%d}.RData".format(date))
dist = ro.r.load(distfile)
return {"L": np.array(dist[0]),"R": np.array(dist[1])}
diff --git a/python/task_server/globeop.py b/python/task_server/globeop.py
index 0c5a82a9..7d0d3f39 100644
--- a/python/task_server/globeop.py
+++ b/python/task_server/globeop.py
@@ -113,7 +113,7 @@ def upload_data(startdate):
file_to_upload = filelist[0][0]
newfile_to_upload = file_to_upload
if workdate < startdate:
- newfile_to_upload = "securitiesNpv{%Y%m%d_%H%M%S}.csv".\
+ newfile_to_upload = "securitiesNpv{0:%Y%m%d_%H%M%S}.csv".\
format(datetime.datetime.today())
# due to the way the drive is mounted, we get an exception when copy
# tries to change permissions
diff --git a/python/yieldcurve.py b/python/yieldcurve.py
index 2dadf311..b426c6cc 100644
--- a/python/yieldcurve.py
+++ b/python/yieldcurve.py
@@ -13,9 +13,9 @@ import matplotlib.pyplot as plt
def getMarkitIRData(date = datetime.date.today()):
basedir = os.path.join(root, "data", "Yield Curves")
- filename = "InterestRates_USD_{%Y%m%d}.xml".format(date)
+ filename = "InterestRates_USD_{0:%Y%m%d}.xml".format(date)
if not os.path.exists(os.path.join(basedir, filename)):
- r = requests.get('http://www.markit.com/news/InterestRates_USD_{%Y%m%d}.zip'.format(date))
+ r = requests.get('http://www.markit.com/news/InterestRates_USD_{0:%Y%m%d}.zip'.format(date))
if "x-zip" in r.headers['content-type']:
with zipfile.ZipFile(BytesIO(r.content)) as z:
z.extractall(path = os.path.join(root, "data", "Yield Curves"))
@@ -37,7 +37,7 @@ def getMarkitIRData(date = datetime.date.today()):
def get_futures_data(date = datetime.date.today()):
futures_file = os.path.join(root, "data", "Yield Curves",
- "futures-{%Y-%m-%d}.csv".format(date)
+ "futures-{0:%Y-%m-%d}.csv".format(date)
with open(futures_file) as fh:
quotes = [float(line.split(",")[1]) for line in fh]
return quotes