summaryrefslogtreecommitdiffstats
path: root/legs.pyx
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@serenitascapital.com>2016-07-06 15:58:45 -0400
committerGuillaume Horel <guillaume.horel@serenitascapital.com>2016-07-06 15:58:45 -0400
commit36f6bec51667a7df7606eba7d53879dca54a1575 (patch)
tree411433e25b25053592999b9253ba39c6f0b35411 /legs.pyx
parent1990c15ff0bfeffd442d9be3c3d38df0dbb0b15d (diff)
downloadpyisda-36f6bec51667a7df7606eba7d53879dca54a1575.tar.gz
add inspect function for FeeLeg
Diffstat (limited to 'legs.pyx')
-rw-r--r--legs.pyx13
1 files changed, 13 insertions, 0 deletions
diff --git a/legs.pyx b/legs.pyx
index f45dce1..0a07a9b 100644
--- a/legs.pyx
+++ b/legs.pyx
@@ -58,6 +58,19 @@ cdef class FeeLeg:
if self._thisptr is NULL:
raise ValueError
+ def inspect(self):
+ cdef list acc_start_dates = []
+ cdef list acc_end_dates = []
+ cdef list pay_dates = []
+ cdef size_t i
+ for i in range(self._thisptr.nbDates):
+ acc_start_dates.append(TDate_to_pydate(self._thisptr.accStartDates[i]))
+ acc_end_dates.append(TDate_to_pydate(self._thisptr.accEndDates[i]))
+ pay_dates.append(TDate_to_pydate(self._thisptr.payDates[i]))
+ return {'acc_start_dates': acc_start_dates,
+ 'acc_end_dates': acc_end_dates,
+ 'pay_dates': pay_dates}
+
@property
def cashflows(self):
cdef TCashFlowList* cfl = JpmcdsFeeLegFlows(self._thisptr)