diff options
| -rw-r--r-- | python/insert_fx_id.py | 9 | ||||
| -rw-r--r-- | python/report_ops/enums.py | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/python/insert_fx_id.py b/python/insert_fx_id.py index a6ab83a9..3f5ef68f 100644 --- a/python/insert_fx_id.py +++ b/python/insert_fx_id.py @@ -7,6 +7,7 @@ from serenitas.analytics.dates import prev_business_day from serenitas.utils.db import dawn_engine from serenitas.utils.db import dbconn from collateral.baml_isda import load_excel +from report_ops.enums import FundEnum logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) @@ -21,8 +22,6 @@ FX_REPORT_COLUMNS = [ "sell_amount", ] -_fund_enums = {"Serenitas": "SERCGMAST", "BowdSt": "BOWDST", "Selene": "ISOSEL"} - def get_tag(fund): if fund == "Serenitas": @@ -108,14 +107,14 @@ def get_forwards(cob): def main(workdate): conn = dbconn("dawndb") dawn_trades = get_forwards(workdate) - for fund, fund_code in _fund_enums.items(): + for fund in FundEnum: for counterparty in ("MSCSNY", "BAMSNY"): read_fun = globals()[f"read_{counterparty}"] - for row in read_fun(fund, workdate): + for row in read_fun(fund.name, workdate): if row.cpty_id not in dawn_trades.cpty_id.values: matching_candidates = dawn_trades.loc[ (dawn_trades["cp_code"] == counterparty) - & (dawn_trades["fund"] == fund_code) + & (dawn_trades["fund"] == fund.value) ] filters = { "trade_date": row.trade_date, diff --git a/python/report_ops/enums.py b/python/report_ops/enums.py new file mode 100644 index 00000000..e2c1e38d --- /dev/null +++ b/python/report_ops/enums.py @@ -0,0 +1,7 @@ +from enum import Enum + + +class FundEnum(Enum): + Serenitas = "SERCGMAST" + BowdSt = "BOWDST" + Selene = "ISOSEL" |
