aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/report_ops/misc.py1
-rw-r--r--python/report_ops/sma.py9
-rw-r--r--python/sma_positions.py10
3 files changed, 15 insertions, 5 deletions
diff --git a/python/report_ops/misc.py b/python/report_ops/misc.py
index 5c39eac3..b70c0605 100644
--- a/python/report_ops/misc.py
+++ b/python/report_ops/misc.py
@@ -40,6 +40,7 @@ _sma_recipients = {
"Vera.Dvorski@bnymellon.com",
"Diana.WuChen@bnymellon.com",
),
+ "BRINKER": ("nyops@lmcg.com",),
}
_settlement_recipients = {
diff --git a/python/report_ops/sma.py b/python/report_ops/sma.py
index dc9cc1ca..4c3ae373 100644
--- a/python/report_ops/sma.py
+++ b/python/report_ops/sma.py
@@ -42,9 +42,14 @@ class SMA:
fund: ClassVar[str]
_conn: ClassVar = dbconn("dawndb")
_em: ClassVar = ExchangeMessage()
+ _registry = {}
+
+ def __class_getitem__(cls, fund):
+ return cls._registry[fund]
def __init_subclass__(cls, fund):
cls.fund = fund
+ cls._registry[fund] = cls
def get_positions(self):
df_blotter = pd.read_sql_query(
@@ -100,6 +105,10 @@ class BowdstSMA(SMA, fund="BOWDST"):
pass
+class BrinkerSMA(SMA, fund="BRINKER"):
+ pass
+
+
_sql_query = {
"bond": "SELECT * FROM risk_positions(%s, null, %s) ",
"future": (
diff --git a/python/sma_positions.py b/python/sma_positions.py
index de1665e5..0a9b8f3e 100644
--- a/python/sma_positions.py
+++ b/python/sma_positions.py
@@ -1,4 +1,4 @@
-from report_ops.sma import IsoselSMA, BowdstSMA
+from report_ops.sma import SMA
import datetime
from serenitas.analytics.dates import prev_business_day
import logging
@@ -16,11 +16,11 @@ if __name__ == "__main__":
help="work date",
)
args = parser.parse_args()
- for sma_cls in (
- IsoselSMA,
- BowdstSMA,
+ for fund in (
+ "BOWDST",
+ "ISOSEL",
):
- sma = sma_cls(args.date)
+ sma = SMA["fund"](args.date)
try:
sma.email_positions()
except ValueError as e: