diff options
| author | Guillaume Horel <guillaume.horel@gmail.com> | 2017-11-16 16:44:53 -0500 |
|---|---|---|
| committer | Guillaume Horel <guillaume.horel@gmail.com> | 2017-11-16 17:01:45 -0500 |
| commit | 57abfe947a0cc7b90fd5bcfb0c9f51e9f82d5a0a (patch) | |
| tree | 16611e064701b1d0a3fab878ec9e0156bab748b8 | |
| parent | 3341528457bf8e07248fa4e249a7fb134df93d72 (diff) | |
| download | pyisda-57abfe947a0cc7b90fd5bcfb0c9f51e9f82d5a0a.tar.gz | |
export and copy recovery_rates
| -rw-r--r-- | pyisda/curve.pxd | 2 | ||||
| -rw-r--r-- | pyisda/curve.pyx | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/pyisda/curve.pxd b/pyisda/curve.pxd index c982347..49b1c1b 100644 --- a/pyisda/curve.pxd +++ b/pyisda/curve.pxd @@ -199,7 +199,7 @@ cdef class YieldCurve(Curve): cdef class SpreadCurve(Curve): cdef string ticker - cdef public double[:] recovery_rates + cdef double[:] recovery_rates cdef fArray_to_list(TRatePt* fArray, int fNumItems) diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 1e64ccb..acf4720 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -731,6 +731,10 @@ cdef class SpreadCurve(Curve): def ticker(self): return self.ticker.decode() + @property + def recovery_rates(self): + return np.asarray(self.recovery_rates) + @cython.boundscheck(False) @cython.wraparound(False) @cython.initializedcheck(False) @@ -756,4 +760,5 @@ def fill_curve(SpreadCurve sc, TDate[:] end_dates): cdef SpreadCurve sc_new = SpreadCurve.__new__(SpreadCurve) sc_new._thisptr = make_shared(curve) sc_new.ticker = sc.ticker + sc_new.recovery_rates = sc.recovery_rates return sc_new |
