From 5ae5babc87fcbf60d73a3fb06d0e16afda1c3f81 Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Fri, 20 Sep 2019 14:50:24 -0400 Subject: allow to specify the stub type --- pyisda/legs.pyx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyisda/legs.pyx b/pyisda/legs.pyx index 838ef7a..06b9680 100644 --- a/pyisda/legs.pyx +++ b/pyisda/legs.pyx @@ -95,15 +95,17 @@ cdef class FeeLeg: Default 'ACT/360' protect_start : bool, optional if True, protection starts at beginning of day. Default to True. + stub : string, one of 'f/s', 'b/s', 'f/l', 'b/l', optional + Default 'f/s' """ def __cinit__(self, start_date, end_date, bint pay_accrued_on_default, double notional, double coupon_rate, str payment_dcc='ACT/360', - bint protect_start=True): + bint protect_start=True, str stub="f/s"): cdef TStubMethod stub_type - if JpmcdsStringToStubMethod(b"f/s", &stub_type) != 0: - raise ValueError("can't convert stub") + if JpmcdsStringToStubMethod(stub, &stub_type) != 0: + raise ValueError(f"can't convert stub {stub}") self._thisptr = JpmcdsCdsFeeLegMake(pydate_to_TDate(start_date), pydate_to_TDate(end_date), -- cgit v1.2.3-70-g09d2