-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42a3e9e
commit eaddf93
Showing
11 changed files
with
36 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
cimport quantlib.time._calendar as _calendar | ||
from . cimport _calendar | ||
|
||
from libcpp.vector cimport vector | ||
|
||
cdef class Calendar: | ||
cdef _calendar.Calendar _thisptr | ||
|
||
cdef class TARGET(Calendar): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from ..calendar cimport Calendar | ||
|
||
cdef class TARGET(Calendar): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cimport quantlib.time._daycounter as _daycounter | ||
from . cimport _daycounter | ||
|
||
cdef class DayCounter: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,37 @@ | ||
"""This module contains "simple" Daycounter classes, i.e. which do not depend on | ||
a convention""" | ||
|
||
from cython.operator cimport dereference as deref | ||
|
||
cimport quantlib.time._daycounter as _daycounter | ||
from . cimport _simple | ||
from quantlib.time.daycounter cimport DayCounter | ||
cimport quantlib.time.calendars._target as _tg | ||
cimport quantlib.time._calendar as _calendar | ||
from quantlib.time.calendars.target cimport TARGET | ||
from quantlib.time.calendar cimport Calendar | ||
from libcpp cimport bool | ||
|
||
cdef class Actual365Fixed(DayCounter): | ||
|
||
def __cinit__(self, *args): | ||
self._thisptr = <_daycounter.DayCounter*> new _simple.Actual365Fixed() | ||
def __cinit__(self): | ||
self._thisptr = new _simple.Actual365Fixed() | ||
|
||
|
||
cdef class Actual360(DayCounter): | ||
|
||
def __cinit__(self, bool include_last_day = False): | ||
self._thisptr = <_daycounter.DayCounter*> new _simple.Actual360(include_last_day) | ||
self._thisptr = new _simple.Actual360(include_last_day) | ||
|
||
|
||
cdef class Business252(DayCounter): | ||
|
||
def __cinit__(self, *args, calendar=None): | ||
cdef _calendar.Calendar cl | ||
if calendar is None: | ||
cl = _tg.TARGET() | ||
else: | ||
cl = (<Calendar>calendar)._thisptr | ||
self._thisptr = <_daycounter.DayCounter*> new _simple.Business252(cl) | ||
def __cinit__(self, Calendar calendar=TARGET()): | ||
self._thisptr = new _simple.Business252(calendar._thisptr) | ||
|
||
|
||
cdef class OneDayCounter(DayCounter): | ||
|
||
def __cinit__(self, *args): | ||
self._thisptr = <_daycounter.DayCounter*> new _simple.OneDayCounter() | ||
def __cinit__(self): | ||
self._thisptr = new _simple.OneDayCounter() | ||
|
||
|
||
cdef class SimpleDayCounter(DayCounter): | ||
|
||
def __cinit__(self, *args): | ||
self._thisptr = <_daycounter.DayCounter*> new _simple.SimpleDayCounter() | ||
def __cinit__(self): | ||
self._thisptr = new _simple.SimpleDayCounter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters