Skip to content

Commit

Permalink
move bond engines inside folder
Browse files Browse the repository at this point in the history
  • Loading branch information
thrasibule committed Apr 22, 2024
1 parent c89f2d3 commit 2355b77
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
1 change: 1 addition & 0 deletions quantlib/pricingengines/bond/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .discountingbondengine import DiscountingBondEngine
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include '../types.pxi'
from quantlib.types cimport Rate, Real, Spread, Size, Time

from quantlib.instruments._bond cimport Bond
from quantlib.handle cimport shared_ptr
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ from quantlib.handle cimport Handle, optional
from quantlib.termstructures._yield_term_structure cimport YieldTermStructure

cdef extern from 'ql/pricingengines/bond/discountingbondengine.hpp' namespace \
'QuantLib':
'QuantLib' nogil:

cdef cppclass DiscountingBondEngine(PricingEngine):

DiscountingBondEngine()
DiscountingBondEngine(Handle[YieldTermStructure]& discountCurve)
DiscountingBondEngine(Handle[YieldTermStructure]& discountCurve,
optional[bool] includeSettlementDateFlows)
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
include '../types.pxi'

from quantlib.types cimport Rate, Real, Size
from quantlib.time._date cimport Day, Month, Year, Date as QLDate
from quantlib.time._period cimport Frequency
from quantlib.time._daycounter cimport DayCounter as _DayCounter
cimport quantlib.pricingengines._bondfunctions as _bf
from . cimport _bondfunctions as _bf

from quantlib.handle cimport shared_ptr, Handle
from cython.operator cimport dereference as deref
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,10 @@
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the license for more details.
"""
from cython.operator cimport dereference as deref
from . cimport _discountingbondengine as _dbe

from quantlib.handle cimport Handle, shared_ptr
from .cimport _pricing_engine as _pe
from . cimport _bond
from ..engine cimport PricingEngine

from .engine cimport PricingEngine

cimport quantlib.termstructures._yield_term_structure as _yts
from quantlib.termstructures.yield_term_structure cimport YieldTermStructure

cdef class DiscountingBondEngine(PricingEngine):
Expand All @@ -22,4 +17,4 @@ cdef class DiscountingBondEngine(PricingEngine):
"""
"""

self._thisptr.reset(new _bond.DiscountingBondEngine(discount_curve._thisptr))
self._thisptr.reset(new _dbe.DiscountingBondEngine(discount_curve._thisptr))

0 comments on commit 2355b77

Please sign in to comment.