diff options
| -rw-r--r-- | python/analytics/index_data.py | 13 | ||||
| -rw-r--r-- | python/analytics/tranche_basket.py | 2 | ||||
| m--------- | python/pyisda | 0 |
3 files changed, 11 insertions, 4 deletions
diff --git a/python/analytics/index_data.py b/python/analytics/index_data.py index 13e6c7b6..61d283e7 100644 --- a/python/analytics/index_data.py +++ b/python/analytics/index_data.py @@ -268,9 +268,16 @@ def get_singlenames_curves_prebuilt(conn, index_type, series, trade_date): def load_all_curves(conn, trade_date): with conn.cursor() as c: - c.execute("SELECT curve FROM cds_curves WHERE date=%s", (trade_date,)) - r = [SpreadCurve.from_bytes(b, True) for (b,) in c] - return pd.Series(r, index=[c.full_ticker for c in r]) + c.execute( + "SELECT curve, referenceentity FROM cds_curves " + "LEFT JOIN refentity ON redcode=redentitycode WHERE date=%s", + (trade_date,), + ) + r = [(name, SpreadCurve.from_bytes(b, True)) for (b, name) in c] + r = pd.DataFrame.from_records( + r, columns=["name", "curve"], index=[c.full_ticker for _, c in r] + ) + return r.loc[r.index.drop_duplicates()] def get_tranche_quotes( diff --git a/python/analytics/tranche_basket.py b/python/analytics/tranche_basket.py index b253a8b6..55fd4524 100644 --- a/python/analytics/tranche_basket.py +++ b/python/analytics/tranche_basket.py @@ -702,7 +702,7 @@ class DualCorrTranche: ) upf += float(loss) * 100 r.append(self.notional * (upf - orig_upf) / 100) - tickers.append(curve.ticker) + tickers.append(curve.full_ticker) self._index._factor, self._index._cumloss = orig_factor, orig_cumloss self.K = adjust_attachments( self.K_orig, self._index.cumloss, self._index.factor diff --git a/python/pyisda b/python/pyisda -Subproject 20b378876a27e833160d6d039f46c0e0723a4a4 +Subproject 3be205c245acbeaf1dd8866b59a57638f78bd3a |
