-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_phase2.py
More file actions
31 lines (28 loc) · 1001 Bytes
/
run_phase2.py
File metadata and controls
31 lines (28 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from sfdr2.data import SAMPLE_PORTFOLIO
from sfdr2.exclusions import screen_portfolio
out = screen_portfolio(SAMPLE_PORTFOLIO)
print("=" * 70)
print("PHASE 2 - PAB EXCLUSION SCREENING")
print("=" * 70)
for r in out["results"]:
if r.excluded:
tag = "EXCLUDED"
elif r.data_gap:
tag = "DATA GAP"
else:
tag = "CLEAR"
print(f"\n[{tag:8s}] {r.issuer} (weight {r.weight_pct:.1f}%)")
for b in r.breaches:
print(f" - {b['basis']}")
for g in r.gaps:
print(f" ? missing input for screen: {g}")
s = out["summary"]
print("\n" + "-" * 70)
print("PORTFOLIO SUMMARY")
print(f" Issuers screened : {s['n_issuers']}")
print(f" Excluded (hard breach) : {s['n_excluded']} "
f"({s['weight_excluded_pct']:.1f}% of weight)")
print(f" Data-gap only (review) : {s['n_data_gap_only']} "
f"({s['weight_data_gap_pct']:.1f}% of weight)")
print(f" Clear of all screens : {s['weight_clear_pct']:.1f}% of weight")
print("-" * 70)