summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2018-11-07 14:34:48 -0500
committerGuillaume Horel <guillaume.horel@gmail.com>2018-11-07 14:34:48 -0500
commite778769df705ca00f5c7f0cf76bc6c957650ab68 (patch)
tree5a36a8825eec1755821005ccbb672a6cdf1302a6
parentfb3292452ca2b20688026eae9eead3876bd8a00c (diff)
downloadpyisda-e778769df705ca00f5c7f0cf76bc6c957650ab68.tar.gz
fix defaulted case
-rw-r--r--pyisda/curve.pyx7
1 files changed, 5 insertions, 2 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx
index 810353d..b435eeb 100644
--- a/pyisda/curve.pyx
+++ b/pyisda/curve.pyx
@@ -530,6 +530,8 @@ cdef class SpreadCurve(Curve):
self.recovery_rates = shared_ptr[double](
<double*>malloc(sizeof(double)), double_free)
self.recovery_rates.get()[0] = recovery_rates[0]
+ if ticker:
+ self.ticker = ticker
return
if isinstance(end_dates, list):
@@ -651,11 +653,12 @@ cdef class SpreadCurve(Curve):
@property
def defaulted(self):
- return self.defaulted == -1
+ return self.defaulted != -1
@property
def default_date(self):
- return TDate_to_pydate(self.defaulted)
+ if self.defaulted != -1:
+ return TDate_to_pydate(self.defaulted)
@classmethod
def from_bytes(cls, bytes state):