aboutsummaryrefslogtreecommitdiffstats
path: root/python/calibrate_tranches_BC.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/calibrate_tranches_BC.py')
-rw-r--r--python/calibrate_tranches_BC.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/python/calibrate_tranches_BC.py b/python/calibrate_tranches_BC.py
index cf04ea24..b6d7a37f 100644
--- a/python/calibrate_tranches_BC.py
+++ b/python/calibrate_tranches_BC.py
@@ -1,4 +1,4 @@
-from db import dbconn
+from utils.db import dbconn
from analytics import TrancheBasket
from pandas.tseries.offsets import BDay
import datetime
@@ -33,6 +33,7 @@ def build_sql_str(df):
if __name__ == "__main__":
+ from utils import SerenitasFileHandler
logger = logging.getLogger('tranche_calib')
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--update", action="store_true", default=False,
@@ -49,14 +50,11 @@ if __name__ == "__main__":
args = parser.parse_args()
logger.setLevel(logging.DEBUG if args.debug else logging.INFO)
CODE_DIR = Path(os.environ["CODE_DIR"])
- LOG_DIR = Path(os.environ["LOG_DIR"])
- formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
if not args.debug:
- handler = logging.FileHandler(filename=LOG_DIR /
- f"calib_tranches_{datetime.date.today()}.log")
+ handler = SerenitasFileHandler(f"calib_tranches_{datetime.date.today()}.log")
else:
handler = logging.StreamHandler()
- handler.setFormatter(formatter)
+ handler.setFormatter(SerenitasFileHandler._formatter)
logger.addHandler(handler)
start_dates = {# 'hy10': datetime.date(2014, 8, 11),