aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/collateral/jpm.py6
-rw-r--r--python/external_deriv_marks.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/python/collateral/jpm.py b/python/collateral/jpm.py
index c5ff41ee..f1813975 100644
--- a/python/collateral/jpm.py
+++ b/python/collateral/jpm.py
@@ -39,10 +39,10 @@ def get_collateral(collat_page):
return float(get_col(collat_page, 200, 300, 1000, 1100)[0].replace(",", ""))
-def load_positions(positions_page):
+def load_positions(positions_page, bottom_offset=25):
anchor = next(c for c in positions_page if c.text.startswith("Total Product Group"))
- bottom = int(anchor["top"]) - 25
- widths = (10, 160, 300, 380, 450, 500, 550, 635, 700, 780, 850, 960, 1000, 1200)
+ bottom = int(anchor["top"]) - bottom_offset
+ widths = (10, 160, 340, 400, 480, 520, 600, 690, 780, 850, 950, 1035, 1100, 1250)
cols = [
get_col(positions_page, 200, bottom, l, r) for l, r in zip(widths, widths[1:])
]
diff --git a/python/external_deriv_marks.py b/python/external_deriv_marks.py
index 5df6979c..dcf8653c 100644
--- a/python/external_deriv_marks.py
+++ b/python/external_deriv_marks.py
@@ -272,7 +272,7 @@ def cs_navs(date: datetime.date = None, fund: str = "Serenitas"):
def jpm_navs(date: datetime.date = None, fund: str = "BowdSt"):
- account = {"Serenitas": 923550, "BowdSt": 909271, "Selene": "1001279"}
+ account = {"Serenitas": 923550, "BowdSt": 909271, "Selene": 1001279}
DATA_DIR = DAILY_DIR / fund / "JPM_reports"
if date:
glob_str = f"{date:%y%m%d}"
@@ -282,7 +282,7 @@ def jpm_navs(date: datetime.date = None, fund: str = "BowdSt"):
d = {}
for fname in g:
pages = load_pdf(fname, pages=True)
- df = load_positions(pages[4])
+ df = load_positions(pages[4], 15 if fund == "BowdSt" else 25)
date = datetime.datetime.strptime(fname.stem.split("-")[2], "%y%m%d").date()
df["fx"] = df["Pay CCY"].apply(lambda s: get_fx(date, s))
df["local_navs"] = df["MTM Amount"] / df["fx"]