aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/Dawn/static/dawn.js4
-rw-r--r--python/bespoke_utils.py11
-rw-r--r--python/thetas-durations.py4
3 files changed, 12 insertions, 7 deletions
diff --git a/python/Dawn/static/dawn.js b/python/Dawn/static/dawn.js
index a45411f4..e9fd586c 100644
--- a/python/Dawn/static/dawn.js
+++ b/python/Dawn/static/dawn.js
@@ -1,7 +1,7 @@
var index_list = [];
var bbg_map = {'CDX': ["IG", "HY"], 'ITRX': ["EUR", "XOVER"]};
-var series_map = {'CDX': ["24", "25", "26", "27", "28", "29", "30", "31", "32", "33"],
- 'ITRX': ["24", "25", "26", "27", "28", "29", "30", "31", "32"]};
+var series_map = {'CDX': ["24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34"],
+ 'ITRX': ["24", "25", "26", "27", "28", "29", "30", "31", "32", "33"]};
var index_tenor = ["3Y", "5Y", "7Y", "10Y"];
for(var begin_index in bbg_map){
for(var i=0; i<bbg_map[begin_index].length; i++){
diff --git a/python/bespoke_utils.py b/python/bespoke_utils.py
index 8cf9d4b1..33d9255d 100644
--- a/python/bespoke_utils.py
+++ b/python/bespoke_utils.py
@@ -126,13 +126,13 @@ def get_bbg_ids(
def get_basketid(conn: connection, name: str) -> Tuple[int, int]:
with conn.cursor() as c:
c.execute("SELECT max(series)+1 FROM index_version where index='BS'")
- serie, = c.fetchone()
+ (serie,) = c.fetchone()
c.execute(
"INSERT INTO index_version(index, series, version, redindexcode) "
"VALUES('BS', %s, 1, %s) RETURNING basketid",
(serie, name),
)
- basket_id, = c.fetchone()
+ (basket_id,) = c.fetchone()
conn.commit()
return serie, basket_id
@@ -194,7 +194,12 @@ def new_index_series(conn, basketid, index_type, series):
c.executemany(
"INSERT INTO basket_constituents VALUES(%s, %s, %s, %s)",
[
- (t.company_id, t.seniority, basketid, 1.0)
+ (
+ t.company_id,
+ "SLA" if t.seniority == "LAC" else t.seniority,
+ basketid,
+ 1.0,
+ )
for t in df.itertuples(index=False)
],
)
diff --git a/python/thetas-durations.py b/python/thetas-durations.py
index feffc869..4d61a009 100644
--- a/python/thetas-durations.py
+++ b/python/thetas-durations.py
@@ -63,8 +63,8 @@ if __name__ == "__main__":
recoveries = np.full(len(tenors[index]), 0.3)
else:
recoveries = np.full(len(tenors[index]), 0.4)
- for series in range(18, 34):
- if index in ["EU", "XO"] and series == 33:
+ for series in range(18, 35):
+ if index in ["EU", "XO"] and series == 34:
continue
if index == "HYBB" and series != 33:
continue