summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2016-08-08 11:45:34 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2016-08-08 11:45:34 -0400
commita1a6f286afffa881427e3d8b3b6071d5676b9c26 (patch)
tree15c189ca4e9830d8e8ecb62e554cf145eac510f0
parent1ce5ac59f97510857114d015aeadc66604a7e240 (diff)
downloadpyisda-a1a6f286afffa881427e3d8b3b6071d5676b9c26.tar.gz
fix bug
-rw-r--r--pyisda/curve.pyx3
1 files changed, 2 insertions, 1 deletions
diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx
index 46708ff..699666a 100644
--- a/pyisda/curve.pyx
+++ b/pyisda/curve.pyx
@@ -133,12 +133,13 @@ cdef class YieldCurve(Curve):
yc._dates = <TDate*>malloc(sizeof(TDate) * len(dates))
cdef size_t i
cdef double* rates = <double*>malloc(sizeof(double) * len(dfs))
+ yc._ninstr = len(dates)
for i, d in enumerate(dates):
yc._dates[i] = pydate_to_TDate(d)
JpmcdsDiscountToRateYearFrac(dfs[i], <double>(yc._dates[i]-base_date_c)/365.,
<double>1, &rates[i]);
- yc._thisptr = JpmcdsMakeTCurve(base_date_c, yc._dates, rates, len(dfs),
+ yc._thisptr = JpmcdsMakeTCurve(base_date_c, yc._dates, rates, dfs.shape[0],
<double>1, dcc(day_count_conv))
return yc