lballabio / QuantLib-SWIG

QuantLib wrappers to other languages
Other
343 stars 286 forks source link

COSHestonEngine not available in Python Wrapper #114

Closed bstemper closed 6 years ago

bstemper commented 6 years ago

Under Python 3.6, QuantLib doesn't recognise the COSHestonEngine. Sample code:

import QuantLib as ql
ql.COSHestonEngine

Error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-cc96c8f4e92f> in <module>()
----> 1 ql.COSHestonEngine

AttributeError: module 'QuantLib' has no attribute 'COSHestonEngine'

As far as I understand, the Python call just to be linked to the C++ code. If I knew C++, I would do it myself but unfortunately I don't. Many thanks to whoever could link it.

bstemper commented 6 years ago

Is it possible to do this with pure Python skills? If so, I would do it myself. Or is there some kind of guideline available?

PiotrSiejda commented 6 years ago

@lballabio should this be done is separate SWIG file or merged into existing one? What is the convention? The COSHestonEngine is now in QuantLib at following location: /qt/pricingengines/vanilla/coshestonengine.cpp /qt/pricingengines/vanilla/coshestonengine.hpp

lballabio commented 6 years ago

The other Heston-model engines are in SWIG/options.i. You can add this one there, as well.