aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/calibrate_tranches_BC.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/python/calibrate_tranches_BC.py b/python/calibrate_tranches_BC.py
index c3f39b7e..47b08e49 100644
--- a/python/calibrate_tranches_BC.py
+++ b/python/calibrate_tranches_BC.py
@@ -19,7 +19,7 @@ def get_lastdate(conn, index, series, tenor):
)
with conn.cursor() as c:
c.execute(sql_str, (index, series, tenor))
- date, = c.fetchone()
+ (date,) = c.fetchone()
conn.commit()
return date
@@ -60,9 +60,9 @@ if __name__ == "__main__":
"--tenor", default="5yr", help="Tenor we want to run [default '5yr']"
)
parser.add_argument(
- "--until", default=pd.Timestamp.now() - BDay(), type=lambda s: pd.Timestamp(s)
+ "--until", default=pd.Timestamp.now() - BDay(), type=pd.Timestamp
)
- parser.add_argument("--start_from", default=None, type=lambda s: pd.Timestamp(s))
+ parser.add_argument("--start_from", default=None, type=pd.Timestamp)
parser.add_argument(
"-d", "--debug", action="store_true", help="more verbose logging"
)
@@ -195,9 +195,11 @@ if __name__ == "__main__":
except ValueError:
df["theta"] = None
- df["index_duration"], df["index_expected_loss"], df[
- "index_price"
- ] = tranche_index.index_pv()
+ (
+ df["index_duration"],
+ df["index_expected_loss"],
+ df["index_price"],
+ ) = tranche_index.index_pv()
df["index_expected_loss"] *= -1
df["index_duration"] -= tranche_index.accrued()
df["index_basis"] = tranche_index.tweaks[0]