From d3c91158116fc3c5189d38ebf92de07bda44998b Mon Sep 17 00:00:00 2001 From: Guillaume Horel Date: Tue, 26 Jul 2016 17:16:41 -0400 Subject: try to be more compliant --- pyisda/curve.pyx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pyisda/curve.pyx b/pyisda/curve.pyx index 7a7ce05..6ceee57 100644 --- a/pyisda/curve.pyx +++ b/pyisda/curve.pyx @@ -1,4 +1,5 @@ from libc.stdlib cimport malloc, free + from curve cimport (JpmcdsBuildIRZeroCurve, JpmcdsZeroPrice, JpmcdsMakeTCurve, Basis, CONTINUOUS, JpmcdsCleanSpreadCurve) from date cimport (JpmcdsStringToDateInterval, pydate_to_TDate, dcc, @@ -89,11 +90,16 @@ cdef class YieldCurve(Curve): raise ValueError cdef TDateInterval tmp + cdef long period_adjust for i, p in enumerate(periods): period_bytes = p.encode('utf-8') if JpmcdsStringToDateInterval(period_bytes, routine, &tmp) != SUCCESS: raise ValueError - if JpmcdsDateFwdThenAdjust(settle_date, &tmp, MODIFIED, + if types[i] == 'M': + period_adjust = MODIFIED + else: + priod_adjust = NONE + if JpmcdsDateFwdThenAdjust(settle_date, &tmp, period_adjust, "None", &self._dates[i]) != SUCCESS: raise ValueError('Invalid interval') -- cgit v1.2.3-70-g09d2