diff options
| -rw-r--r-- | pyisda/curve.pxd | 6 | ||||
| -rw-r--r-- | pyisda/curve.pyx | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd index f12fb54..48790ff 100644 --- a/pyisda/curve.pxd +++ b/pyisda/curve.pxd @@ -145,7 +145,7 @@ cdef extern from "isda/cxzerocurve.h" nogil: double JpmcdsZeroRate(TCurve* curve, TDate date) cdef double survival_prob(const TCurve* curve, TDate start_date, - TDate maturity_date, double eps, bint log) nogil + TDate maturity_date, double eps, bint log) noexcept nogil cdef extern from "isda/cfinanci.h" nogil: int JpmcdsDiscountToRateYearFrac(double discount, # (I) Discount factor @@ -209,7 +209,7 @@ cdef extern from "survival_curve.hpp" nogil: cdef class Curve: cdef shared_ptr[char] buf cdef readonly size_t buf_size - cdef inline const TCurve* get_TCurve(self) nogil + cdef inline const TCurve* get_TCurve(self) noexcept nogil cpdef bytes as_bytes(self, Fmt fmt) @@ -224,7 +224,7 @@ cdef class SpreadCurve(Curve): cdef inline double* recovery_rates_ptr(self) nogil cdef inline char* name(self) nogil -cdef fArray_to_list(const TRatePt* fArray, int fNumItems) noexcept +cdef list fArray_to_list(const TRatePt* fArray, int fNumItems) noexcept cdef void tweak_curve(const TCurve* sc, TCurve* sc_tweaked, double epsilon, unsigned long mask) noexcept nogil diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 8877877..a307b63 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -39,13 +39,13 @@ cdef extern from "lz4.h" nogil: cdef int SUCCESS = 0 -cdef inline void double_free(double* ptr) nogil: +cdef inline void double_free(double* ptr) noexcept nogil: free(ptr) cdef inline void char_free(char* ptr) noexcept nogil: free(ptr) -cdef double survival_prob(const TCurve* curve, TDate start_date, TDate maturity_date, double eps, bint log) nogil: +cdef double survival_prob(const TCurve* curve, TDate start_date, TDate maturity_date, double eps, bint log) noexcept nogil: cdef: double lambda1, lambda2 double t1, t2, u @@ -67,7 +67,7 @@ cdef double survival_prob(const TCurve* curve, TDate start_date, TDate maturity_ cdef class Curve(object): - cdef inline const TCurve* get_TCurve(self) nogil: + cdef inline const TCurve* get_TCurve(self) noexcept nogil: return <TCurve*>self.buf.get() cpdef bytes as_bytes(self, Fmt fmt): @@ -340,7 +340,7 @@ cdef class Curve(object): const TCurve* curve = self.get_TCurve() return JpmcdsZeroRate(curve, pydate_to_TDate(d)) -cdef fArray_to_list(const TRatePt* fArray, int fNumItems) noexcept: +cdef list fArray_to_list(const TRatePt* fArray, int fNumItems) noexcept: cdef size_t i cdef list l = [] for i in range(fNumItems): @@ -487,7 +487,7 @@ cdef class YieldCurve(Curve): yc.buf.reset(<char*>curve, char_free) return yc - def bump(self, epsilon): + def bump(self, double epsilon): cdef: YieldCurve yc = YieldCurve.__new__(YieldCurve) const TCurve* c1 = self.get_TCurve() |
