summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cdsone.pxd2
-rw-r--r--cdsone.pyx7
-rw-r--r--curve.pxd (renamed from zerocurve.pxd)0
-rw-r--r--curve.pyx (renamed from zerocurve.pyx)0
-rw-r--r--date.pxd5
-rw-r--r--date.pyx12
-rw-r--r--yearfrac.pxd4
-rw-r--r--yearfrac.pyx11
8 files changed, 20 insertions, 21 deletions
diff --git a/cdsone.pxd b/cdsone.pxd
index 0f76c50..b24d3b4 100644
--- a/cdsone.pxd
+++ b/cdsone.pxd
@@ -1,5 +1,5 @@
from date cimport TDateInterval
-from pyisda.zerocurve cimport TCurve
+from curve cimport TCurve
cdef extern from "isda/stub.h":
ctypedef struct TStubMethod:
diff --git a/cdsone.pyx b/cdsone.pyx
index cb567f6..d6bb4ec 100644
--- a/cdsone.pyx
+++ b/cdsone.pyx
@@ -1,8 +1,7 @@
-from pyisda.cdsone cimport (JpmcdsCdsoneUpfrontCharge,
+from cdsone cimport (JpmcdsCdsoneUpfrontCharge,
JpmcdsCdsoneSpread, JpmcdsStringToStubMethod)
-from pyisda.zerocurve cimport ZeroCurve
-from pyisda.date cimport JpmcdsStringToDateInterval, pydate_to_TDate
-from pyisda.yearfrac cimport dcc
+from curve cimport ZeroCurve
+from date cimport JpmcdsStringToDateInterval, pydate_to_TDate, dcc
cdef int SUCCESS = 0
diff --git a/zerocurve.pxd b/curve.pxd
index d652ca0..d652ca0 100644
--- a/zerocurve.pxd
+++ b/curve.pxd
diff --git a/zerocurve.pyx b/curve.pyx
index a5eb2d2..a5eb2d2 100644
--- a/zerocurve.pyx
+++ b/curve.pyx
diff --git a/date.pxd b/date.pxd
index 16b2261..a10d922 100644
--- a/date.pxd
+++ b/date.pxd
@@ -1,3 +1,8 @@
+cdef extern from "isda/yearfrac.h":
+ int JpmcdsStringToDayCountConv(char* day_count, long* type)
+
+cdef long dcc(str day_count)
+
cdef extern from "isda/cdate.h":
ctypedef struct TDateInterval:
pass
diff --git a/date.pyx b/date.pyx
index 8df0df8..26d7339 100644
--- a/date.pyx
+++ b/date.pyx
@@ -1,5 +1,5 @@
import datetime
-from date cimport JpmcdsDate
+from date cimport JpmcdsDate, JpmcdsStringToDayCountConv
cdef TDate pydate_to_TDate(d):
assert isinstance(d, datetime.date)
@@ -9,3 +9,13 @@ cpdef object TDate_to_pydate(TDate d):
cdef TMonthDayYear date
if JpmcdsDateToMDY(d, &date) == 0:
return datetime.date(date.year, date.month, date.day)
+
+cdef long dcc(str day_count):
+ cdef long r
+ dc_bytes = day_count.encode('utf-8')
+ cdef char* dc = dc_bytes
+ cdef err = JpmcdsStringToDayCountConv(<char*> dc, &r)
+ if err == 0:
+ return r
+ else:
+ raise ValueError('{0} is not a valid day count'.format(day_count))
diff --git a/yearfrac.pxd b/yearfrac.pxd
deleted file mode 100644
index 739ca90..0000000
--- a/yearfrac.pxd
+++ /dev/null
@@ -1,4 +0,0 @@
-cdef extern from "isda/yearfrac.h":
- int JpmcdsStringToDayCountConv(char* day_count, long* type)
-
-cdef long dcc(str day_count)
diff --git a/yearfrac.pyx b/yearfrac.pyx
deleted file mode 100644
index 48b8995..0000000
--- a/yearfrac.pyx
+++ /dev/null
@@ -1,11 +0,0 @@
-from pyisda.yearfrac cimport JpmcdsStringToDayCountConv
-
-cdef long dcc(str day_count):
- cdef long r
- dc_bytes = day_count.encode('utf-8')
- cdef char* dc = dc_bytes
- cdef err = JpmcdsStringToDayCountConv(<char*> dc, &r)
- if err == 0:
- return r
- else:
- raise ValueError('{0} is not a valid day count'.format(day_count))