aboutsummaryrefslogtreecommitdiffstats
path: root/python/analytics/index.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/analytics/index.py')
-rw-r--r--python/analytics/index.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/python/analytics/index.py b/python/analytics/index.py
index 265e470d..0600deb9 100644
--- a/python/analytics/index.py
+++ b/python/analytics/index.py
@@ -18,10 +18,11 @@ from sqlalchemy import exc
from pyisda.curve import SpreadCurve
from .utils import previous_twentieth, build_table
from bbg_helpers import BBG_IP, retrieve_data, init_bbg_session
+
from yieldcurve import YC, ql_to_jp, roll_yc, rate_helpers
from weakref import WeakSet
-engine = dbengine('serenitasdb')
+_engine = dbengine('serenitasdb')
def g(index, spread, exercise_date, forward_yc=None, pv=None):
"""computes the strike clean price using the expected forward yield curve. """
@@ -366,7 +367,7 @@ class Index(object):
ref_data = retrieve_data(session, security, field)
self.ref = ref_data[security][field]
else:
- run = engine.execute("""SELECT * FROM index_quotes
+ run = _engine.execute("""SELECT * FROM index_quotes
WHERE index=%s AND series=%s AND tenor=%s AND date=%s""",
(index_type, series, tenor, self.trade_date))
rec = run.fetchone()
@@ -389,7 +390,7 @@ class Index(object):
raise ValueError("Not enough information to load the index.")
try:
df = pd.read_sql_query(sql_str,
- engine, parse_dates=['lastdate', 'issue_date'],
+ _engine, parse_dates=['lastdate', 'issue_date'],
params=params)
maturity = df.maturity[0]
coupon = df.coupon[0]