pyquantlib 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyquantlib-0.1.0/.gitattributes +34 -0
- pyquantlib-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- pyquantlib-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
- pyquantlib-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +22 -0
- pyquantlib-0.1.0/.github/ISSUE_TEMPLATE/infrastructure.md +24 -0
- pyquantlib-0.1.0/.github/scripts/build-quantlib-windows.ps1 +51 -0
- pyquantlib-0.1.0/.github/workflows/linux.yml +100 -0
- pyquantlib-0.1.0/.github/workflows/macos.yml +87 -0
- pyquantlib-0.1.0/.github/workflows/wheels.yml +182 -0
- pyquantlib-0.1.0/.github/workflows/windows.yml +111 -0
- pyquantlib-0.1.0/.gitignore +130 -0
- pyquantlib-0.1.0/.readthedocs.yaml +19 -0
- pyquantlib-0.1.0/CMakeLists.txt +313 -0
- pyquantlib-0.1.0/CMakePresets.json +54 -0
- pyquantlib-0.1.0/CONTRIBUTING.md +509 -0
- pyquantlib-0.1.0/LICENSE +29 -0
- pyquantlib-0.1.0/PKG-INFO +243 -0
- pyquantlib-0.1.0/README.md +162 -0
- pyquantlib-0.1.0/SECURITY.md +27 -0
- pyquantlib-0.1.0/docs/_static/custom.css +152 -0
- pyquantlib-0.1.0/docs/_static/favicon.svg +4 -0
- pyquantlib-0.1.0/docs/_static/logo.svg +15 -0
- pyquantlib-0.1.0/docs/api/cashflows.md +194 -0
- pyquantlib-0.1.0/docs/api/core.md +153 -0
- pyquantlib-0.1.0/docs/api/currencies.md +87 -0
- pyquantlib-0.1.0/docs/api/experimental.md +67 -0
- pyquantlib-0.1.0/docs/api/extensions.md +101 -0
- pyquantlib-0.1.0/docs/api/index.md +80 -0
- pyquantlib-0.1.0/docs/api/indexes.md +136 -0
- pyquantlib-0.1.0/docs/api/instruments.md +530 -0
- pyquantlib-0.1.0/docs/api/math.md +315 -0
- pyquantlib-0.1.0/docs/api/models.md +287 -0
- pyquantlib-0.1.0/docs/api/pricingengines.md +528 -0
- pyquantlib-0.1.0/docs/api/processes.md +96 -0
- pyquantlib-0.1.0/docs/api/quotes.md +62 -0
- pyquantlib-0.1.0/docs/api/termstructures.md +529 -0
- pyquantlib-0.1.0/docs/api/time.md +168 -0
- pyquantlib-0.1.0/docs/architecture.md +247 -0
- pyquantlib-0.1.0/docs/building.md +291 -0
- pyquantlib-0.1.0/docs/changelog.md +167 -0
- pyquantlib-0.1.0/docs/conf.py +164 -0
- pyquantlib-0.1.0/docs/contributing.md +296 -0
- pyquantlib-0.1.0/docs/design/api-design.md +46 -0
- pyquantlib-0.1.0/docs/design/bridge-defaults.md +173 -0
- pyquantlib-0.1.0/docs/design/builder-pattern.md +163 -0
- pyquantlib-0.1.0/docs/design/cross-tu-holders.md +180 -0
- pyquantlib-0.1.0/docs/design/diamond-inheritance.md +320 -0
- pyquantlib-0.1.0/docs/design/enum-singletons.md +341 -0
- pyquantlib-0.1.0/docs/design/hidden-handles.md +123 -0
- pyquantlib-0.1.0/docs/design/index.md +23 -0
- pyquantlib-0.1.0/docs/design/interpolation.md +231 -0
- pyquantlib-0.1.0/docs/design/protected-members.md +280 -0
- pyquantlib-0.1.0/docs/design/python-subclassing.md +275 -0
- pyquantlib-0.1.0/docs/design/settings-singleton.md +174 -0
- pyquantlib-0.1.0/docs/examples/index.md +22 -0
- pyquantlib-0.1.0/docs/extending.md +240 -0
- pyquantlib-0.1.0/docs/handles.md +132 -0
- pyquantlib-0.1.0/docs/index.md +178 -0
- pyquantlib-0.1.0/docs/installation.md +53 -0
- pyquantlib-0.1.0/docs/internals.md +294 -0
- pyquantlib-0.1.0/docs/numpy.md +116 -0
- pyquantlib-0.1.0/docs/quickstart.md +219 -0
- pyquantlib-0.1.0/docs/requirements.txt +5 -0
- pyquantlib-0.1.0/docs/troubleshooting.md +249 -0
- pyquantlib-0.1.0/examples/README.md +17 -0
- pyquantlib-0.1.0/examples/bermudan_swaption.ipynb +839 -0
- pyquantlib-0.1.0/examples/bonds.ipynb +377 -0
- pyquantlib-0.1.0/examples/cds.ipynb +234 -0
- pyquantlib-0.1.0/examples/equity_option.ipynb +501 -0
- pyquantlib-0.1.0/examples/hello_pyquantlib.ipynb +295 -0
- pyquantlib-0.1.0/examples/modified_kirk_engine.ipynb +336 -0
- pyquantlib-0.1.0/examples/multicurve_bootstrapping.ipynb +203 -0
- pyquantlib-0.1.0/examples/numpy_interoperability.ipynb +499 -0
- pyquantlib-0.1.0/examples/replication.ipynb +359 -0
- pyquantlib-0.1.0/examples/svi_smile.ipynb +680 -0
- pyquantlib-0.1.0/extensions.json +8 -0
- pyquantlib-0.1.0/include/pyquantlib/binding_manager.h +202 -0
- pyquantlib-0.1.0/include/pyquantlib/interpolation_helper.h +120 -0
- pyquantlib-0.1.0/include/pyquantlib/null_utils.h +61 -0
- pyquantlib-0.1.0/include/pyquantlib/pyquantlib.h +313 -0
- pyquantlib-0.1.0/include/pyquantlib/trampolines.h +1080 -0
- pyquantlib-0.1.0/include/pyquantlib/version.h +16 -0
- pyquantlib-0.1.0/licenseheader.txt +11 -0
- pyquantlib-0.1.0/pyproject.toml +167 -0
- pyquantlib-0.1.0/pyquantlib/__init__.py +39 -0
- pyquantlib-0.1.0/pyquantlib/__init__.pyi +611 -0
- pyquantlib-0.1.0/pyquantlib/_pyquantlib/__init__.pyi +13854 -0
- pyquantlib-0.1.0/pyquantlib/_pyquantlib/base.pyi +1307 -0
- pyquantlib-0.1.0/pyquantlib/builders.py +317 -0
- pyquantlib-0.1.0/pyquantlib/extensions/__init__.py +42 -0
- pyquantlib-0.1.0/pyquantlib/extensions/modified_kirk_engine.py +186 -0
- pyquantlib-0.1.0/pyquantlib/extensions/svi_smile_section.py +229 -0
- pyquantlib-0.1.0/pyquantlib/py.typed +2 -0
- pyquantlib-0.1.0/pyquantlib/version.py +1 -0
- pyquantlib-0.1.0/pyquantlib/version.pyi +3 -0
- pyquantlib-0.1.0/requirements-dev.txt +30 -0
- pyquantlib-0.1.0/scripts/README.md +29 -0
- pyquantlib-0.1.0/scripts/build_docs.py +66 -0
- pyquantlib-0.1.0/scripts/clean.py +55 -0
- pyquantlib-0.1.0/scripts/rebuild.py +48 -0
- pyquantlib-0.1.0/scripts/stubgen.py +151 -0
- pyquantlib-0.1.0/scripts/test.py +38 -0
- pyquantlib-0.1.0/settings.json +11 -0
- pyquantlib-0.1.0/src/cashflows/all.cpp +38 -0
- pyquantlib-0.1.0/src/cashflows/coupon.cpp +50 -0
- pyquantlib-0.1.0/src/cashflows/couponpricer.cpp +44 -0
- pyquantlib-0.1.0/src/cashflows/duration.cpp +27 -0
- pyquantlib-0.1.0/src/cashflows/fixedratecoupon.cpp +124 -0
- pyquantlib-0.1.0/src/cashflows/floatingratecoupon.cpp +75 -0
- pyquantlib-0.1.0/src/cashflows/iborcoupon.cpp +185 -0
- pyquantlib-0.1.0/src/cashflows/overnightindexedcoupon.cpp +167 -0
- pyquantlib-0.1.0/src/cashflows/rateaveraging.cpp +30 -0
- pyquantlib-0.1.0/src/cashflows/simplecashflow.cpp +39 -0
- pyquantlib-0.1.0/src/core/all.cpp +43 -0
- pyquantlib-0.1.0/src/core/cashflow.cpp +39 -0
- pyquantlib-0.1.0/src/core/cdspricingmodel.cpp +26 -0
- pyquantlib-0.1.0/src/core/compounding.cpp +31 -0
- pyquantlib-0.1.0/src/core/constants.cpp +27 -0
- pyquantlib-0.1.0/src/core/currency.cpp +47 -0
- pyquantlib-0.1.0/src/core/default.cpp +26 -0
- pyquantlib-0.1.0/src/core/exchangerate.cpp +50 -0
- pyquantlib-0.1.0/src/core/exercise.cpp +48 -0
- pyquantlib-0.1.0/src/core/index.cpp +41 -0
- pyquantlib-0.1.0/src/core/instrument.cpp +41 -0
- pyquantlib-0.1.0/src/core/interestrate.cpp +125 -0
- pyquantlib-0.1.0/src/core/money.cpp +105 -0
- pyquantlib-0.1.0/src/core/option.cpp +67 -0
- pyquantlib-0.1.0/src/core/payoff.cpp +37 -0
- pyquantlib-0.1.0/src/core/pricingengine.cpp +51 -0
- pyquantlib-0.1.0/src/core/quote.cpp +38 -0
- pyquantlib-0.1.0/src/core/settings.cpp +59 -0
- pyquantlib-0.1.0/src/core/stochasticprocess.cpp +79 -0
- pyquantlib-0.1.0/src/core/termstructure.cpp +54 -0
- pyquantlib-0.1.0/src/core/timegrid.cpp +72 -0
- pyquantlib-0.1.0/src/currencies/all.cpp +20 -0
- pyquantlib-0.1.0/src/currencies/currencies.cpp +787 -0
- pyquantlib-0.1.0/src/currencies/exchangeratemanager.cpp +45 -0
- pyquantlib-0.1.0/src/experimental/all.cpp +21 -0
- pyquantlib-0.1.0/src/experimental/volatility/svismilesection.cpp +73 -0
- pyquantlib-0.1.0/src/indexes/all.cpp +27 -0
- pyquantlib-0.1.0/src/indexes/ibor/eonia.cpp +39 -0
- pyquantlib-0.1.0/src/indexes/ibor/estr.cpp +39 -0
- pyquantlib-0.1.0/src/indexes/ibor/euribor.cpp +116 -0
- pyquantlib-0.1.0/src/indexes/ibor/sofr.cpp +39 -0
- pyquantlib-0.1.0/src/indexes/ibor/sonia.cpp +39 -0
- pyquantlib-0.1.0/src/indexes/iborindex.cpp +118 -0
- pyquantlib-0.1.0/src/indexes/interestrateindex.cpp +64 -0
- pyquantlib-0.1.0/src/indexes/swapindex.cpp +111 -0
- pyquantlib-0.1.0/src/instruments/all.cpp +82 -0
- pyquantlib-0.1.0/src/instruments/asianoption.cpp +63 -0
- pyquantlib-0.1.0/src/instruments/assetswap.cpp +72 -0
- pyquantlib-0.1.0/src/instruments/averagetype.cpp +25 -0
- pyquantlib-0.1.0/src/instruments/barrieroption.cpp +49 -0
- pyquantlib-0.1.0/src/instruments/barriertype.cpp +27 -0
- pyquantlib-0.1.0/src/instruments/basketoption.cpp +106 -0
- pyquantlib-0.1.0/src/instruments/bond.cpp +178 -0
- pyquantlib-0.1.0/src/instruments/bonds/fixedratebond.cpp +74 -0
- pyquantlib-0.1.0/src/instruments/bonds/floatingratebond.cpp +78 -0
- pyquantlib-0.1.0/src/instruments/bonds/zerocouponbond.cpp +35 -0
- pyquantlib-0.1.0/src/instruments/capfloor.cpp +108 -0
- pyquantlib-0.1.0/src/instruments/claim.cpp +50 -0
- pyquantlib-0.1.0/src/instruments/compositeinstrument.cpp +37 -0
- pyquantlib-0.1.0/src/instruments/creditdefaultswap.cpp +161 -0
- pyquantlib-0.1.0/src/instruments/doublebarrieroption.cpp +47 -0
- pyquantlib-0.1.0/src/instruments/doublebarriertype.cpp +27 -0
- pyquantlib-0.1.0/src/instruments/fixedvsfloatingswap.cpp +111 -0
- pyquantlib-0.1.0/src/instruments/forwardrateagreement.cpp +92 -0
- pyquantlib-0.1.0/src/instruments/makecapfloor.cpp +99 -0
- pyquantlib-0.1.0/src/instruments/makeois.cpp +208 -0
- pyquantlib-0.1.0/src/instruments/makeswaption.cpp +88 -0
- pyquantlib-0.1.0/src/instruments/makevanillaswap.cpp +192 -0
- pyquantlib-0.1.0/src/instruments/multiassetoption.cpp +52 -0
- pyquantlib-0.1.0/src/instruments/oneassetoption.cpp +81 -0
- pyquantlib-0.1.0/src/instruments/overnightindexedswap.cpp +93 -0
- pyquantlib-0.1.0/src/instruments/payoffs.cpp +96 -0
- pyquantlib-0.1.0/src/instruments/swap.cpp +117 -0
- pyquantlib-0.1.0/src/instruments/swaption.cpp +109 -0
- pyquantlib-0.1.0/src/instruments/vanillaoption.cpp +31 -0
- pyquantlib-0.1.0/src/instruments/vanillaswap.cpp +44 -0
- pyquantlib-0.1.0/src/instruments/zerocouponswap.cpp +77 -0
- pyquantlib-0.1.0/src/main.cpp +58 -0
- pyquantlib-0.1.0/src/math/all.cpp +38 -0
- pyquantlib-0.1.0/src/math/array.cpp +217 -0
- pyquantlib-0.1.0/src/math/distributions/bivariatenormaldistribution.cpp +31 -0
- pyquantlib-0.1.0/src/math/distributions/normaldistribution.cpp +63 -0
- pyquantlib-0.1.0/src/math/interpolations/backwardflatinterpolation.cpp +26 -0
- pyquantlib-0.1.0/src/math/interpolations/cubicinterpolation.cpp +78 -0
- pyquantlib-0.1.0/src/math/interpolations/extrapolation.cpp +32 -0
- pyquantlib-0.1.0/src/math/interpolations/interpolation.cpp +52 -0
- pyquantlib-0.1.0/src/math/interpolations/linearinterpolation.cpp +25 -0
- pyquantlib-0.1.0/src/math/interpolations/loglinearinterpolation.cpp +25 -0
- pyquantlib-0.1.0/src/math/matrix.cpp +228 -0
- pyquantlib-0.1.0/src/math/optimization/constraint.cpp +49 -0
- pyquantlib-0.1.0/src/math/optimization/costfunction.cpp +33 -0
- pyquantlib-0.1.0/src/math/optimization/endcriteria.cpp +101 -0
- pyquantlib-0.1.0/src/math/optimization/levenbergmarquardt.cpp +30 -0
- pyquantlib-0.1.0/src/math/optimization/method.cpp +30 -0
- pyquantlib-0.1.0/src/math/optimization/problem.cpp +48 -0
- pyquantlib-0.1.0/src/math/rounding.cpp +79 -0
- pyquantlib-0.1.0/src/math/solvers1d/solvers1d.cpp +116 -0
- pyquantlib-0.1.0/src/methods/all.cpp +21 -0
- pyquantlib-0.1.0/src/methods/finitedifferences/solvers/fdmbackwardsolver.cpp +69 -0
- pyquantlib-0.1.0/src/models/all.cpp +46 -0
- pyquantlib-0.1.0/src/models/calibrationhelper.cpp +70 -0
- pyquantlib-0.1.0/src/models/equity/batesmodel.cpp +31 -0
- pyquantlib-0.1.0/src/models/equity/hestonmodel.cpp +44 -0
- pyquantlib-0.1.0/src/models/model.cpp +95 -0
- pyquantlib-0.1.0/src/models/parameter.cpp +49 -0
- pyquantlib-0.1.0/src/models/piecewisetimedependenthestonmodel.cpp +61 -0
- pyquantlib-0.1.0/src/models/shortrate/calibrationhelpers/swaptionhelper.cpp +215 -0
- pyquantlib-0.1.0/src/models/shortrate/onefactormodel.cpp +39 -0
- pyquantlib-0.1.0/src/models/shortrate/onefactormodels/blackkarasinski.cpp +43 -0
- pyquantlib-0.1.0/src/models/shortrate/onefactormodels/hullwhite.cpp +55 -0
- pyquantlib-0.1.0/src/models/shortrate/onefactormodels/vasicek.cpp +45 -0
- pyquantlib-0.1.0/src/models/shortrate/twofactormodel.cpp +28 -0
- pyquantlib-0.1.0/src/models/shortrate/twofactormodels/g2.cpp +66 -0
- pyquantlib-0.1.0/src/patterns/all.cpp +22 -0
- pyquantlib-0.1.0/src/patterns/lazyobject.cpp +42 -0
- pyquantlib-0.1.0/src/patterns/observable.cpp +65 -0
- pyquantlib-0.1.0/src/pricingengines/all.cpp +102 -0
- pyquantlib-0.1.0/src/pricingengines/asian/analytic_cont_geom_av_price.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/asian/analytic_discr_geom_av_price.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/asian/mc_discr_arith_av_price.cpp +71 -0
- pyquantlib-0.1.0/src/pricingengines/asian/turnbullwakemanasianengine.cpp +30 -0
- pyquantlib-0.1.0/src/pricingengines/barrier/analyticbarrierengine.cpp +30 -0
- pyquantlib-0.1.0/src/pricingengines/barrier/analyticdoublebarrierengine.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/barrier/fdblackscholesbarrierengine.cpp +38 -0
- pyquantlib-0.1.0/src/pricingengines/basket/bjerksundstenslandspreadengine.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/basket/denglizhoubasketengine.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/basket/fd2dblackscholesvanillaengine.cpp +36 -0
- pyquantlib-0.1.0/src/pricingengines/basket/kirkengine.cpp +29 -0
- pyquantlib-0.1.0/src/pricingengines/basket/mceuropeanbasketengine.cpp +96 -0
- pyquantlib-0.1.0/src/pricingengines/basket/operatorsplittingspreadengine.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/basket/spreadblackscholesvanillaengine.cpp +46 -0
- pyquantlib-0.1.0/src/pricingengines/basket/stulzengine.cpp +30 -0
- pyquantlib-0.1.0/src/pricingengines/blackformula.cpp +149 -0
- pyquantlib-0.1.0/src/pricingengines/bond/bondfunctions.cpp +177 -0
- pyquantlib-0.1.0/src/pricingengines/bond/discountingbondengine.cpp +46 -0
- pyquantlib-0.1.0/src/pricingengines/capfloor/bacheliercapfloorengine.cpp +64 -0
- pyquantlib-0.1.0/src/pricingengines/capfloor/blackcapfloorengine.cpp +68 -0
- pyquantlib-0.1.0/src/pricingengines/credit/isdacdsengine.cpp +89 -0
- pyquantlib-0.1.0/src/pricingengines/credit/midpointcdsengine.cpp +54 -0
- pyquantlib-0.1.0/src/pricingengines/genericmodelengine.cpp +37 -0
- pyquantlib-0.1.0/src/pricingengines/swap/discountingswapengine.cpp +52 -0
- pyquantlib-0.1.0/src/pricingengines/swaption/blackswaptionengine.cpp +117 -0
- pyquantlib-0.1.0/src/pricingengines/swaption/fdg2swaptionengine.cpp +36 -0
- pyquantlib-0.1.0/src/pricingengines/swaption/fdhullwhiteswaptionengine.cpp +35 -0
- pyquantlib-0.1.0/src/pricingengines/swaption/g2swaptionengine.cpp +30 -0
- pyquantlib-0.1.0/src/pricingengines/swaption/jamshidianswaptionengine.cpp +44 -0
- pyquantlib-0.1.0/src/pricingengines/swaption/treeswaptionengine.cpp +60 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/analyticeuropeanengine.cpp +43 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/analyticeuropeanvasicekengine.cpp +33 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/analytichestonengine.cpp +110 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/baroneadesiwhaleyengine.cpp +39 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/batesengine.cpp +34 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/binomialengine.cpp +83 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/bjerksundstenslandengine.cpp +31 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/fdblackscholesvanillaengine.cpp +62 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/integralengine.cpp +28 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/mcamericanengine.cpp +138 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/mceuropeanengine.cpp +112 -0
- pyquantlib-0.1.0/src/pricingengines/vanilla/qdfpamericanengine.cpp +86 -0
- pyquantlib-0.1.0/src/processes/all.cpp +28 -0
- pyquantlib-0.1.0/src/processes/batesprocess.cpp +76 -0
- pyquantlib-0.1.0/src/processes/blackscholesprocess.cpp +234 -0
- pyquantlib-0.1.0/src/processes/eulerdiscretization.cpp +27 -0
- pyquantlib-0.1.0/src/processes/hestonprocess.cpp +87 -0
- pyquantlib-0.1.0/src/processes/stochasticprocessarray.cpp +76 -0
- pyquantlib-0.1.0/src/quotes/all.cpp +21 -0
- pyquantlib-0.1.0/src/quotes/compositequote.cpp +59 -0
- pyquantlib-0.1.0/src/quotes/derivedquote.cpp +58 -0
- pyquantlib-0.1.0/src/quotes/simplequote.cpp +38 -0
- pyquantlib-0.1.0/src/submodules.cpp +19 -0
- pyquantlib-0.1.0/src/termstructures/all.cpp +107 -0
- pyquantlib-0.1.0/src/termstructures/credit/defaultprobabilityhelpers.cpp +227 -0
- pyquantlib-0.1.0/src/termstructures/credit/flathazardrate.cpp +66 -0
- pyquantlib-0.1.0/src/termstructures/credit/piecewisedefaultcurve.cpp +91 -0
- pyquantlib-0.1.0/src/termstructures/defaulttermstructure.cpp +70 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/blackconstantvol.cpp +74 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/blackvariancesurface.cpp +82 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/blackvoltermstructure.cpp +146 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/fixedlocalvolsurface.cpp +102 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/localconstantvol.cpp +70 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/localvolsurface.cpp +75 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/localvoltermstructure.cpp +73 -0
- pyquantlib-0.1.0/src/termstructures/volatility/equityfx/noexceptlocalvolsurface.cpp +85 -0
- pyquantlib-0.1.0/src/termstructures/volatility/sabrinterpolatedsmilesection.cpp +66 -0
- pyquantlib-0.1.0/src/termstructures/volatility/sabrsmilesection.cpp +67 -0
- pyquantlib-0.1.0/src/termstructures/volatility/smilesection.cpp +96 -0
- pyquantlib-0.1.0/src/termstructures/volatility/volatilitytype.cpp +28 -0
- pyquantlib-0.1.0/src/termstructures/voltermstructure.cpp +50 -0
- pyquantlib-0.1.0/src/termstructures/yield/bondhelpers.cpp +200 -0
- pyquantlib-0.1.0/src/termstructures/yield/discountcurve.cpp +60 -0
- pyquantlib-0.1.0/src/termstructures/yield/flatforward.cpp +92 -0
- pyquantlib-0.1.0/src/termstructures/yield/forwardcurve.cpp +60 -0
- pyquantlib-0.1.0/src/termstructures/yield/oisratehelper.cpp +271 -0
- pyquantlib-0.1.0/src/termstructures/yield/piecewiseyieldcurve.cpp +105 -0
- pyquantlib-0.1.0/src/termstructures/yield/ratehelpers.cpp +287 -0
- pyquantlib-0.1.0/src/termstructures/yield/zerocurve.cpp +69 -0
- pyquantlib-0.1.0/src/termstructures/yield/zerospreadedtermstructure.cpp +49 -0
- pyquantlib-0.1.0/src/termstructures/yieldtermstructure.cpp +110 -0
- pyquantlib-0.1.0/src/time/all.cpp +41 -0
- pyquantlib-0.1.0/src/time/businessdayconvention.cpp +43 -0
- pyquantlib-0.1.0/src/time/calendar.cpp +108 -0
- pyquantlib-0.1.0/src/time/calendars/calendars.cpp +678 -0
- pyquantlib-0.1.0/src/time/date.cpp +203 -0
- pyquantlib-0.1.0/src/time/dategenerationrule.cpp +53 -0
- pyquantlib-0.1.0/src/time/daycounter.cpp +61 -0
- pyquantlib-0.1.0/src/time/daycounters/daycounters.cpp +122 -0
- pyquantlib-0.1.0/src/time/frequency.cpp +39 -0
- pyquantlib-0.1.0/src/time/period.cpp +96 -0
- pyquantlib-0.1.0/src/time/schedule.cpp +154 -0
- pyquantlib-0.1.0/src/time/timeunit.cpp +35 -0
- pyquantlib-0.1.0/src/time/weekday.cpp +40 -0
- pyquantlib-0.1.0/src/utilities/all.cpp +20 -0
- pyquantlib-0.1.0/src/utilities/null.cpp +53 -0
- pyquantlib-0.1.0/src/utilities/observablevalue.cpp +40 -0
- pyquantlib-0.1.0/tests/conftest.py +174 -0
- pyquantlib-0.1.0/tests/test_cashflows.py +896 -0
- pyquantlib-0.1.0/tests/test_core.py +434 -0
- pyquantlib-0.1.0/tests/test_currencies.py +308 -0
- pyquantlib-0.1.0/tests/test_experimental_volatility.py +200 -0
- pyquantlib-0.1.0/tests/test_extensions.py +89 -0
- pyquantlib-0.1.0/tests/test_indexes.py +470 -0
- pyquantlib-0.1.0/tests/test_instruments.py +2481 -0
- pyquantlib-0.1.0/tests/test_instruments_bonds.py +329 -0
- pyquantlib-0.1.0/tests/test_math.py +1167 -0
- pyquantlib-0.1.0/tests/test_math_distributions.py +144 -0
- pyquantlib-0.1.0/tests/test_math_solvers1d.py +174 -0
- pyquantlib-0.1.0/tests/test_methods.py +330 -0
- pyquantlib-0.1.0/tests/test_models.py +96 -0
- pyquantlib-0.1.0/tests/test_models_shortrate.py +518 -0
- pyquantlib-0.1.0/tests/test_pricingengines.py +100 -0
- pyquantlib-0.1.0/tests/test_pricingengines_asian.py +174 -0
- pyquantlib-0.1.0/tests/test_pricingengines_barrier.py +139 -0
- pyquantlib-0.1.0/tests/test_pricingengines_basket.py +534 -0
- pyquantlib-0.1.0/tests/test_pricingengines_bond.py +251 -0
- pyquantlib-0.1.0/tests/test_pricingengines_capfloor.py +112 -0
- pyquantlib-0.1.0/tests/test_pricingengines_credit.py +242 -0
- pyquantlib-0.1.0/tests/test_pricingengines_swaption.py +327 -0
- pyquantlib-0.1.0/tests/test_pricingengines_vanilla.py +883 -0
- pyquantlib-0.1.0/tests/test_processes.py +658 -0
- pyquantlib-0.1.0/tests/test_quotes.py +348 -0
- pyquantlib-0.1.0/tests/test_termstructures.py +387 -0
- pyquantlib-0.1.0/tests/test_termstructures_credit.py +371 -0
- pyquantlib-0.1.0/tests/test_termstructures_volatility.py +1829 -0
- pyquantlib-0.1.0/tests/test_termstructures_yield.py +1039 -0
- pyquantlib-0.1.0/tests/test_time.py +1176 -0
- pyquantlib-0.1.0/tests/test_utilities.py +93 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Auto detect text files and normalize to LF in repo
|
|
2
|
+
* text=auto eol=lf
|
|
3
|
+
|
|
4
|
+
# Source code
|
|
5
|
+
*.cpp text eol=lf
|
|
6
|
+
*.h text eol=lf
|
|
7
|
+
*.hpp text eol=lf
|
|
8
|
+
*.py text eol=lf
|
|
9
|
+
*.pyi text eol=lf
|
|
10
|
+
|
|
11
|
+
# Config/build files
|
|
12
|
+
*.yml text eol=lf
|
|
13
|
+
*.yaml text eol=lf
|
|
14
|
+
*.json text eol=lf
|
|
15
|
+
*.toml text eol=lf
|
|
16
|
+
*.cmake text eol=lf
|
|
17
|
+
*.txt text eol=lf
|
|
18
|
+
*.md text eol=lf
|
|
19
|
+
*.rst text eol=lf
|
|
20
|
+
CMakeLists.txt text eol=lf
|
|
21
|
+
|
|
22
|
+
# Shell scripts
|
|
23
|
+
*.sh text eol=lf
|
|
24
|
+
|
|
25
|
+
# Windows scripts (keep CRLF)
|
|
26
|
+
*.bat text eol=crlf
|
|
27
|
+
*.cmd text eol=crlf
|
|
28
|
+
*.ps1 text eol=crlf
|
|
29
|
+
|
|
30
|
+
# Binary files
|
|
31
|
+
*.png binary
|
|
32
|
+
*.jpg binary
|
|
33
|
+
*.ico binary
|
|
34
|
+
*.whl binary
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Report a bug or unexpected behavior
|
|
4
|
+
title: '[BUG] '
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Description
|
|
10
|
+
<!-- Brief description of the bug -->
|
|
11
|
+
|
|
12
|
+
## Environment
|
|
13
|
+
- **OS**: <!-- e.g., macOS 14, Ubuntu 24.04, Windows 11 -->
|
|
14
|
+
- **Python**: <!-- e.g., 3.11.5 -->
|
|
15
|
+
- **QuantLib**: <!-- e.g., 1.40 (Homebrew) or 1.38 (source) -->
|
|
16
|
+
- **PyQuantLib**: <!-- e.g., 0.1.0 or commit hash -->
|
|
17
|
+
|
|
18
|
+
## Steps to Reproduce
|
|
19
|
+
```python
|
|
20
|
+
# Minimal code to reproduce
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Expected Behavior
|
|
24
|
+
<!-- What should happen -->
|
|
25
|
+
|
|
26
|
+
## Actual Behavior
|
|
27
|
+
<!-- What happens instead -->
|
|
28
|
+
|
|
29
|
+
## Error/Traceback
|
|
30
|
+
```
|
|
31
|
+
<!-- Paste error message or traceback if applicable -->
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Additional Context
|
|
35
|
+
<!-- Any other relevant info -->
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest a new feature or enhancement
|
|
4
|
+
title: '[FEAT] '
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Summary
|
|
10
|
+
<!-- One-line description of the feature -->
|
|
11
|
+
|
|
12
|
+
## Motivation
|
|
13
|
+
<!-- Why is this needed? What problem does it solve? -->
|
|
14
|
+
|
|
15
|
+
## Proposed Solution
|
|
16
|
+
<!-- How should it work? -->
|
|
17
|
+
|
|
18
|
+
## Alternatives Considered
|
|
19
|
+
<!-- Other approaches you've thought about -->
|
|
20
|
+
|
|
21
|
+
## Additional Context
|
|
22
|
+
<!-- Examples, references, related issues -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Infrastructure Task
|
|
3
|
+
about: CI, tooling, documentation, or project setup work
|
|
4
|
+
title: '[INFRA] '
|
|
5
|
+
labels: infrastructure
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Task
|
|
10
|
+
<!-- What needs to be done -->
|
|
11
|
+
|
|
12
|
+
## Category
|
|
13
|
+
<!-- Check one -->
|
|
14
|
+
- [ ] CI/CD
|
|
15
|
+
- [ ] Documentation
|
|
16
|
+
- [ ] Tooling
|
|
17
|
+
- [ ] Project structure
|
|
18
|
+
- [ ] Release prep
|
|
19
|
+
|
|
20
|
+
## Details
|
|
21
|
+
<!-- Steps, requirements, or acceptance criteria -->
|
|
22
|
+
|
|
23
|
+
## Related
|
|
24
|
+
<!-- Links to related issues, docs, or references -->
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Build QuantLib and Boost dependencies for Windows wheel builds.
|
|
2
|
+
# Called by cibuildwheel via CIBW_BEFORE_ALL_WINDOWS.
|
|
3
|
+
#
|
|
4
|
+
# Expects environment variables:
|
|
5
|
+
# BOOST_VERSION (e.g. "1.86.0")
|
|
6
|
+
# QUANTLIB_VERSION (e.g. "1.40")
|
|
7
|
+
|
|
8
|
+
$ErrorActionPreference = 'Stop'
|
|
9
|
+
|
|
10
|
+
# --- Boost headers ---
|
|
11
|
+
$BOOST_VERSION_UNDERSCORE = $env:BOOST_VERSION -replace '\.', '_'
|
|
12
|
+
Write-Host "Downloading Boost $env:BOOST_VERSION headers..."
|
|
13
|
+
Invoke-WebRequest -Uri "https://archives.boost.io/release/$env:BOOST_VERSION/source/boost_${BOOST_VERSION_UNDERSCORE}.zip" -OutFile boost.zip
|
|
14
|
+
Write-Host "Extracting Boost headers..."
|
|
15
|
+
7z x boost.zip -oC:/boost-temp -y | Out-Null
|
|
16
|
+
New-Item -ItemType Directory -Path C:/boost/include -Force | Out-Null
|
|
17
|
+
Move-Item "C:/boost-temp/boost_${BOOST_VERSION_UNDERSCORE}/boost" "C:/boost/include/boost"
|
|
18
|
+
Remove-Item -Recurse -Force C:/boost-temp, boost.zip
|
|
19
|
+
Write-Host "Boost headers installed to C:/boost/include"
|
|
20
|
+
|
|
21
|
+
# --- QuantLib ---
|
|
22
|
+
Write-Host "Downloading QuantLib $env:QUANTLIB_VERSION..."
|
|
23
|
+
Invoke-WebRequest -Uri "https://github.com/lballabio/QuantLib/releases/download/v$env:QUANTLIB_VERSION/QuantLib-$env:QUANTLIB_VERSION.tar.gz" -OutFile QuantLib.tar.gz
|
|
24
|
+
tar xzf QuantLib.tar.gz
|
|
25
|
+
Push-Location "QuantLib-$env:QUANTLIB_VERSION"
|
|
26
|
+
New-Item -ItemType Directory -Path build -Force | Out-Null
|
|
27
|
+
Push-Location build
|
|
28
|
+
|
|
29
|
+
Write-Host "Configuring QuantLib..."
|
|
30
|
+
cmake .. -G "Visual Studio 17 2022" -A x64 `
|
|
31
|
+
-DCMAKE_BUILD_TYPE=Release `
|
|
32
|
+
-DCMAKE_INSTALL_PREFIX=C:/quantlib `
|
|
33
|
+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL `
|
|
34
|
+
-DQL_USE_STD_SHARED_PTR=ON `
|
|
35
|
+
-DQL_USE_STD_OPTIONAL=ON `
|
|
36
|
+
-DQL_USE_STD_ANY=ON `
|
|
37
|
+
-DQL_BUILD_EXAMPLES=OFF `
|
|
38
|
+
-DQL_BUILD_TEST_SUITE=OFF `
|
|
39
|
+
-DQL_BUILD_BENCHMARK=OFF `
|
|
40
|
+
-DBoost_INCLUDE_DIR=C:/boost/include
|
|
41
|
+
|
|
42
|
+
Write-Host "Building QuantLib..."
|
|
43
|
+
cmake --build . --config Release --parallel
|
|
44
|
+
|
|
45
|
+
Write-Host "Installing QuantLib..."
|
|
46
|
+
cmake --install . --config Release
|
|
47
|
+
|
|
48
|
+
Pop-Location
|
|
49
|
+
Pop-Location
|
|
50
|
+
Remove-Item -Recurse -Force "QuantLib-$env:QUANTLIB_VERSION", QuantLib.tar.gz
|
|
51
|
+
Write-Host "QuantLib installed to C:/quantlib"
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# PyQuantLib: Python bindings for QuantLib
|
|
2
|
+
# Copyright (c) 2025 Yassine Idyiahia
|
|
3
|
+
#
|
|
4
|
+
# QuantLib is Copyright (c) 2000-2025 The QuantLib Authors
|
|
5
|
+
# QuantLib is free software under a modified BSD license.
|
|
6
|
+
# See http://quantlib.org/ for more information.
|
|
7
|
+
#
|
|
8
|
+
# Source: https://github.com/quantales/pyquantlib
|
|
9
|
+
# Licensed under the BSD 3-Clause License. See LICENSE file for details.
|
|
10
|
+
|
|
11
|
+
name: Linux build
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
QUANTLIB_VERSION: "1.40"
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
cache: 'pip'
|
|
35
|
+
|
|
36
|
+
- name: Install system dependencies
|
|
37
|
+
run: |
|
|
38
|
+
sudo apt-get update
|
|
39
|
+
sudo apt-get install -y libboost-all-dev cmake ninja-build
|
|
40
|
+
|
|
41
|
+
- name: Cache QuantLib
|
|
42
|
+
id: cache-quantlib
|
|
43
|
+
uses: actions/cache@v4
|
|
44
|
+
with:
|
|
45
|
+
path: /home/runner/quantlib-install
|
|
46
|
+
key: quantlib-${{ env.QUANTLIB_VERSION }}-static-ubuntu-latest-v1
|
|
47
|
+
restore-keys: |
|
|
48
|
+
quantlib-${{ env.QUANTLIB_VERSION }}-static-ubuntu-latest-
|
|
49
|
+
|
|
50
|
+
- name: Build QuantLib from source
|
|
51
|
+
if: steps.cache-quantlib.outputs.cache-hit != 'true'
|
|
52
|
+
run: |
|
|
53
|
+
wget https://github.com/lballabio/QuantLib/releases/download/v${{ env.QUANTLIB_VERSION }}/QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz
|
|
54
|
+
tar xzf QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz
|
|
55
|
+
cd QuantLib-${{ env.QUANTLIB_VERSION }}
|
|
56
|
+
mkdir -p build && cd build
|
|
57
|
+
cmake .. -G Ninja \
|
|
58
|
+
-DCMAKE_BUILD_TYPE=Release \
|
|
59
|
+
-DCMAKE_INSTALL_PREFIX=/home/runner/quantlib-install \
|
|
60
|
+
-DBUILD_SHARED_LIBS=OFF \
|
|
61
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
62
|
+
-DQL_USE_STD_SHARED_PTR=ON \
|
|
63
|
+
-DQL_USE_STD_OPTIONAL=ON \
|
|
64
|
+
-DQL_USE_STD_ANY=ON \
|
|
65
|
+
-DQL_BUILD_EXAMPLES=OFF \
|
|
66
|
+
-DQL_BUILD_TEST_SUITE=OFF \
|
|
67
|
+
-DQL_BUILD_BENCHMARK=OFF
|
|
68
|
+
ninja
|
|
69
|
+
ninja install
|
|
70
|
+
|
|
71
|
+
- name: Verify QuantLib configuration
|
|
72
|
+
run: |
|
|
73
|
+
echo "Checking QuantLib config.hpp for std:: flags..."
|
|
74
|
+
grep -E "QL_USE_STD_(SHARED_PTR|OPTIONAL|ANY)" /home/runner/quantlib-install/include/ql/config.hpp || echo "Flags not found in config.hpp"
|
|
75
|
+
|
|
76
|
+
- name: Install Python build dependencies
|
|
77
|
+
run: |
|
|
78
|
+
python -m pip install --upgrade pip
|
|
79
|
+
|
|
80
|
+
- name: Build package with dev dependencies
|
|
81
|
+
run: |
|
|
82
|
+
pip install -e .[dev] -v
|
|
83
|
+
env:
|
|
84
|
+
QuantLib_ROOT: /home/runner/quantlib-install
|
|
85
|
+
LD_LIBRARY_PATH: /home/runner/quantlib-install/lib
|
|
86
|
+
|
|
87
|
+
- name: Run tests with coverage
|
|
88
|
+
run: |
|
|
89
|
+
pytest --cov=tests --cov-report=xml --cov-report=term-missing
|
|
90
|
+
env:
|
|
91
|
+
LD_LIBRARY_PATH: /home/runner/quantlib-install/lib
|
|
92
|
+
|
|
93
|
+
- name: Upload coverage to Codecov
|
|
94
|
+
uses: codecov/codecov-action@v4
|
|
95
|
+
with:
|
|
96
|
+
files: ./coverage.xml
|
|
97
|
+
fail_ci_if_error: false
|
|
98
|
+
verbose: true
|
|
99
|
+
env:
|
|
100
|
+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# PyQuantLib: Python bindings for QuantLib
|
|
2
|
+
# Copyright (c) 2025 Yassine Idyiahia
|
|
3
|
+
#
|
|
4
|
+
# QuantLib is Copyright (c) 2000-2025 The QuantLib Authors
|
|
5
|
+
# QuantLib is free software under a modified BSD license.
|
|
6
|
+
# See http://quantlib.org/ for more information.
|
|
7
|
+
#
|
|
8
|
+
# Source: https://github.com/quantales/pyquantlib
|
|
9
|
+
# Licensed under the BSD 3-Clause License. See LICENSE file for details.
|
|
10
|
+
|
|
11
|
+
name: macOS build
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
QUANTLIB_VERSION: "1.40"
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
build:
|
|
21
|
+
runs-on: macos-latest
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@v4
|
|
29
|
+
|
|
30
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
31
|
+
uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: ${{ matrix.python-version }}
|
|
34
|
+
cache: 'pip'
|
|
35
|
+
|
|
36
|
+
- name: Install system dependencies
|
|
37
|
+
run: |
|
|
38
|
+
brew install boost ninja
|
|
39
|
+
|
|
40
|
+
- name: Cache QuantLib
|
|
41
|
+
id: cache-quantlib
|
|
42
|
+
uses: actions/cache@v4
|
|
43
|
+
with:
|
|
44
|
+
path: /Users/runner/quantlib-install
|
|
45
|
+
key: quantlib-${{ env.QUANTLIB_VERSION }}-static-macos-latest-v1
|
|
46
|
+
restore-keys: |
|
|
47
|
+
quantlib-${{ env.QUANTLIB_VERSION }}-static-macos-latest-
|
|
48
|
+
|
|
49
|
+
- name: Build QuantLib from source
|
|
50
|
+
if: steps.cache-quantlib.outputs.cache-hit != 'true'
|
|
51
|
+
run: |
|
|
52
|
+
curl -L -o QuantLib.tar.gz https://github.com/lballabio/QuantLib/releases/download/v${{ env.QUANTLIB_VERSION }}/QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz
|
|
53
|
+
tar xzf QuantLib.tar.gz
|
|
54
|
+
cd QuantLib-${{ env.QUANTLIB_VERSION }}
|
|
55
|
+
mkdir -p build && cd build
|
|
56
|
+
cmake .. -G Ninja \
|
|
57
|
+
-DCMAKE_BUILD_TYPE=Release \
|
|
58
|
+
-DCMAKE_INSTALL_PREFIX=/Users/runner/quantlib-install \
|
|
59
|
+
-DBUILD_SHARED_LIBS=OFF \
|
|
60
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
61
|
+
-DQL_USE_STD_SHARED_PTR=ON \
|
|
62
|
+
-DQL_USE_STD_OPTIONAL=ON \
|
|
63
|
+
-DQL_USE_STD_ANY=ON \
|
|
64
|
+
-DQL_BUILD_EXAMPLES=OFF \
|
|
65
|
+
-DQL_BUILD_TEST_SUITE=OFF \
|
|
66
|
+
-DQL_BUILD_BENCHMARK=OFF
|
|
67
|
+
ninja
|
|
68
|
+
ninja install
|
|
69
|
+
|
|
70
|
+
- name: Verify QuantLib configuration
|
|
71
|
+
run: |
|
|
72
|
+
echo "Checking QuantLib config.hpp for std:: flags..."
|
|
73
|
+
grep -E "QL_USE_STD_(SHARED_PTR|OPTIONAL|ANY)" /Users/runner/quantlib-install/include/ql/config.hpp || echo "Flags not found in config.hpp"
|
|
74
|
+
|
|
75
|
+
- name: Install Python build dependencies
|
|
76
|
+
run: |
|
|
77
|
+
python -m pip install --upgrade pip
|
|
78
|
+
|
|
79
|
+
- name: Build package with dev dependencies
|
|
80
|
+
run: |
|
|
81
|
+
pip install -e .[dev] -v
|
|
82
|
+
env:
|
|
83
|
+
QuantLib_ROOT: /Users/runner/quantlib-install
|
|
84
|
+
|
|
85
|
+
- name: Run tests
|
|
86
|
+
run: |
|
|
87
|
+
pytest -v
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# PyQuantLib: Python bindings for QuantLib
|
|
2
|
+
# Copyright (c) 2025 Yassine Idyiahia
|
|
3
|
+
#
|
|
4
|
+
# Build wheels for multiple platforms using cibuildwheel.
|
|
5
|
+
# QuantLib is built from source during the wheel build process.
|
|
6
|
+
|
|
7
|
+
name: Build wheels
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
pull_request:
|
|
12
|
+
paths:
|
|
13
|
+
- "src/**"
|
|
14
|
+
- "include/**"
|
|
15
|
+
- "CMakeLists.txt"
|
|
16
|
+
- "pyproject.toml"
|
|
17
|
+
- ".github/workflows/wheels.yml"
|
|
18
|
+
release:
|
|
19
|
+
types: [published]
|
|
20
|
+
|
|
21
|
+
env:
|
|
22
|
+
QUANTLIB_VERSION: "1.40"
|
|
23
|
+
BOOST_VERSION: "1.86.0"
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
build_wheels:
|
|
27
|
+
name: Build wheels on ${{ matrix.os }}
|
|
28
|
+
runs-on: ${{ matrix.os }}
|
|
29
|
+
strategy:
|
|
30
|
+
fail-fast: false
|
|
31
|
+
matrix:
|
|
32
|
+
os: [ubuntu-latest, windows-latest, macos-14]
|
|
33
|
+
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Build wheels
|
|
38
|
+
uses: pypa/cibuildwheel@v2.21
|
|
39
|
+
env:
|
|
40
|
+
# Build for CPython only (no PyPy)
|
|
41
|
+
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
|
|
42
|
+
CIBW_SKIP: "*-musllinux_*"
|
|
43
|
+
CIBW_BUILD_VERBOSITY: 1
|
|
44
|
+
|
|
45
|
+
# macOS: ARM only (macos-14)
|
|
46
|
+
CIBW_ARCHS_MACOS: "arm64"
|
|
47
|
+
CIBW_ARCHS_LINUX: "x86_64"
|
|
48
|
+
CIBW_ARCHS_WINDOWS: "AMD64"
|
|
49
|
+
|
|
50
|
+
# Environment variables for build
|
|
51
|
+
CIBW_ENVIRONMENT: >
|
|
52
|
+
QUANTLIB_VERSION=${{ env.QUANTLIB_VERSION }}
|
|
53
|
+
BOOST_VERSION=${{ env.BOOST_VERSION }}
|
|
54
|
+
|
|
55
|
+
# Linux: Build QuantLib in manylinux container
|
|
56
|
+
# Note: CIBW_ENVIRONMENT is NOT available during before_all,
|
|
57
|
+
# so we use ${{ env.* }} (evaluated by GitHub Actions before cibuildwheel runs).
|
|
58
|
+
CIBW_BEFORE_ALL_LINUX: |
|
|
59
|
+
set -ex
|
|
60
|
+
yum install -y wget tar gzip
|
|
61
|
+
|
|
62
|
+
# Install Boost headers
|
|
63
|
+
BOOST_UNDERSCORE=$(echo ${{ env.BOOST_VERSION }} | tr '.' '_')
|
|
64
|
+
wget -q https://archives.boost.io/release/${{ env.BOOST_VERSION }}/source/boost_${BOOST_UNDERSCORE}.tar.gz
|
|
65
|
+
tar xzf boost_${BOOST_UNDERSCORE}.tar.gz
|
|
66
|
+
mkdir -p /usr/local/include
|
|
67
|
+
cp -r boost_${BOOST_UNDERSCORE}/boost /usr/local/include/
|
|
68
|
+
rm -rf boost_${BOOST_UNDERSCORE}*
|
|
69
|
+
|
|
70
|
+
# Build QuantLib
|
|
71
|
+
wget -q https://github.com/lballabio/QuantLib/releases/download/v${{ env.QUANTLIB_VERSION }}/QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz
|
|
72
|
+
tar xzf QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz
|
|
73
|
+
cd QuantLib-${{ env.QUANTLIB_VERSION }}
|
|
74
|
+
mkdir -p build && cd build
|
|
75
|
+
cmake .. \
|
|
76
|
+
-DCMAKE_BUILD_TYPE=Release \
|
|
77
|
+
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
|
78
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
79
|
+
-DCMAKE_POLICY_DEFAULT_CMP0167=OLD \
|
|
80
|
+
-DBUILD_SHARED_LIBS=OFF \
|
|
81
|
+
-DQL_USE_STD_SHARED_PTR=ON \
|
|
82
|
+
-DQL_USE_STD_OPTIONAL=ON \
|
|
83
|
+
-DQL_USE_STD_ANY=ON \
|
|
84
|
+
-DQL_BUILD_EXAMPLES=OFF \
|
|
85
|
+
-DQL_BUILD_TEST_SUITE=OFF \
|
|
86
|
+
-DQL_BUILD_BENCHMARK=OFF
|
|
87
|
+
cmake --build . --parallel $(nproc)
|
|
88
|
+
cmake --install .
|
|
89
|
+
cd ../..
|
|
90
|
+
rm -rf QuantLib-${{ env.QUANTLIB_VERSION }}*
|
|
91
|
+
|
|
92
|
+
CIBW_ENVIRONMENT_LINUX: >
|
|
93
|
+
QuantLib_ROOT=/usr/local
|
|
94
|
+
Boost_INCLUDE_DIR=/usr/local/include
|
|
95
|
+
|
|
96
|
+
# macOS: Build QuantLib
|
|
97
|
+
CIBW_BEFORE_ALL_MACOS: |
|
|
98
|
+
set -ex
|
|
99
|
+
brew install boost cmake
|
|
100
|
+
|
|
101
|
+
# Build QuantLib
|
|
102
|
+
curl -sL -o QuantLib.tar.gz https://github.com/lballabio/QuantLib/releases/download/v${{ env.QUANTLIB_VERSION }}/QuantLib-${{ env.QUANTLIB_VERSION }}.tar.gz
|
|
103
|
+
tar xzf QuantLib.tar.gz
|
|
104
|
+
cd QuantLib-${{ env.QUANTLIB_VERSION }}
|
|
105
|
+
mkdir -p build && cd build
|
|
106
|
+
cmake .. \
|
|
107
|
+
-DCMAKE_BUILD_TYPE=Release \
|
|
108
|
+
-DCMAKE_INSTALL_PREFIX=/tmp/quantlib \
|
|
109
|
+
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
|
|
110
|
+
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
|
|
111
|
+
-DBUILD_SHARED_LIBS=OFF \
|
|
112
|
+
-DQL_USE_STD_SHARED_PTR=ON \
|
|
113
|
+
-DQL_USE_STD_OPTIONAL=ON \
|
|
114
|
+
-DQL_USE_STD_ANY=ON \
|
|
115
|
+
-DQL_BUILD_EXAMPLES=OFF \
|
|
116
|
+
-DQL_BUILD_TEST_SUITE=OFF \
|
|
117
|
+
-DQL_BUILD_BENCHMARK=OFF
|
|
118
|
+
cmake --build . --parallel $(sysctl -n hw.ncpu)
|
|
119
|
+
cmake --install .
|
|
120
|
+
cd ../..
|
|
121
|
+
rm -rf QuantLib-${{ env.QUANTLIB_VERSION }}*
|
|
122
|
+
|
|
123
|
+
CIBW_ENVIRONMENT_MACOS: >
|
|
124
|
+
QuantLib_ROOT=/tmp/quantlib
|
|
125
|
+
|
|
126
|
+
# Windows: Build QuantLib (PowerShell script, since cibuildwheel uses cmd on Windows)
|
|
127
|
+
CIBW_BEFORE_ALL_WINDOWS: "powershell -ExecutionPolicy Bypass -File {project}/.github/scripts/build-quantlib-windows.ps1"
|
|
128
|
+
|
|
129
|
+
CIBW_ENVIRONMENT_WINDOWS: >
|
|
130
|
+
QuantLib_ROOT=C:/quantlib
|
|
131
|
+
Boost_INCLUDE_DIR=C:/boost/include
|
|
132
|
+
|
|
133
|
+
# Run tests
|
|
134
|
+
CIBW_TEST_REQUIRES: pytest numpy
|
|
135
|
+
CIBW_TEST_COMMAND: pytest {project}/tests -v --ignore={project}/tests/test_pricingengines_vanilla.py
|
|
136
|
+
|
|
137
|
+
- uses: actions/upload-artifact@v4
|
|
138
|
+
with:
|
|
139
|
+
name: wheels-${{ matrix.os }}
|
|
140
|
+
path: ./wheelhouse/*.whl
|
|
141
|
+
|
|
142
|
+
build_sdist:
|
|
143
|
+
name: Build source distribution
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
steps:
|
|
146
|
+
- uses: actions/checkout@v4
|
|
147
|
+
|
|
148
|
+
- name: Build sdist
|
|
149
|
+
run: pipx run build --sdist
|
|
150
|
+
|
|
151
|
+
- uses: actions/upload-artifact@v4
|
|
152
|
+
with:
|
|
153
|
+
name: sdist
|
|
154
|
+
path: dist/*.tar.gz
|
|
155
|
+
|
|
156
|
+
upload_pypi:
|
|
157
|
+
name: Upload to PyPI
|
|
158
|
+
needs: [build_wheels, build_sdist]
|
|
159
|
+
runs-on: ubuntu-latest
|
|
160
|
+
if: github.event_name == 'release' && github.event.action == 'published'
|
|
161
|
+
|
|
162
|
+
environment:
|
|
163
|
+
name: pypi
|
|
164
|
+
url: https://pypi.org/p/pyquantlib
|
|
165
|
+
|
|
166
|
+
permissions:
|
|
167
|
+
id-token: write # Required for trusted publishing
|
|
168
|
+
|
|
169
|
+
steps:
|
|
170
|
+
- uses: actions/download-artifact@v4
|
|
171
|
+
with:
|
|
172
|
+
pattern: wheels-*
|
|
173
|
+
path: dist
|
|
174
|
+
merge-multiple: true
|
|
175
|
+
|
|
176
|
+
- uses: actions/download-artifact@v4
|
|
177
|
+
with:
|
|
178
|
+
name: sdist
|
|
179
|
+
path: dist
|
|
180
|
+
|
|
181
|
+
- name: Publish to PyPI
|
|
182
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# PyQuantLib: Python bindings for QuantLib
|
|
2
|
+
# Copyright (c) 2025 Yassine Idyiahia
|
|
3
|
+
#
|
|
4
|
+
# QuantLib is Copyright (c) 2000-2025 The QuantLib Authors
|
|
5
|
+
# QuantLib is free software under a modified BSD license.
|
|
6
|
+
# See http://quantlib.org/ for more information.
|
|
7
|
+
#
|
|
8
|
+
# Source: https://github.com/quantales/pyquantlib
|
|
9
|
+
# Licensed under the BSD 3-Clause License. See LICENSE file for details.
|
|
10
|
+
|
|
11
|
+
name: Windows build
|
|
12
|
+
|
|
13
|
+
on:
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
QUANTLIB_VERSION: "1.40"
|
|
18
|
+
BOOST_VERSION: "1.86.0"
|
|
19
|
+
BOOST_VERSION_UNDERSCORE: "1_86_0"
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
build:
|
|
23
|
+
runs-on: windows-latest
|
|
24
|
+
strategy:
|
|
25
|
+
fail-fast: false
|
|
26
|
+
matrix:
|
|
27
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
28
|
+
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
|
|
32
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
33
|
+
uses: actions/setup-python@v5
|
|
34
|
+
with:
|
|
35
|
+
python-version: ${{ matrix.python-version }}
|
|
36
|
+
cache: 'pip'
|
|
37
|
+
|
|
38
|
+
- name: Cache Boost headers
|
|
39
|
+
id: cache-boost
|
|
40
|
+
uses: actions/cache@v4
|
|
41
|
+
with:
|
|
42
|
+
path: C:/boost
|
|
43
|
+
key: boost-headers-${{ env.BOOST_VERSION }}-windows-v1
|
|
44
|
+
|
|
45
|
+
- name: Download Boost headers
|
|
46
|
+
if: steps.cache-boost.outputs.cache-hit != 'true'
|
|
47
|
+
run: |
|
|
48
|
+
Write-Host "Downloading Boost $env:BOOST_VERSION headers..."
|
|
49
|
+
$url = "https://archives.boost.io/release/$env:BOOST_VERSION/source/boost_$env:BOOST_VERSION_UNDERSCORE.zip"
|
|
50
|
+
Invoke-WebRequest -Uri $url -OutFile boost.zip
|
|
51
|
+
Write-Host "Extracting Boost headers..."
|
|
52
|
+
Expand-Archive -Path boost.zip -DestinationPath C:/boost-temp
|
|
53
|
+
mkdir C:/boost/include -Force
|
|
54
|
+
Move-Item "C:/boost-temp/boost_$env:BOOST_VERSION_UNDERSCORE/boost" "C:/boost/include/boost"
|
|
55
|
+
Remove-Item -Recurse -Force C:/boost-temp, boost.zip
|
|
56
|
+
Write-Host "Boost headers installed to C:/boost/include"
|
|
57
|
+
|
|
58
|
+
- name: Cache QuantLib
|
|
59
|
+
id: cache-quantlib
|
|
60
|
+
uses: actions/cache@v4
|
|
61
|
+
with:
|
|
62
|
+
path: C:/quantlib-install
|
|
63
|
+
key: quantlib-${{ env.QUANTLIB_VERSION }}-std-windows-v3
|
|
64
|
+
restore-keys: |
|
|
65
|
+
quantlib-${{ env.QUANTLIB_VERSION }}-std-windows-
|
|
66
|
+
|
|
67
|
+
- name: Build QuantLib from source
|
|
68
|
+
if: steps.cache-quantlib.outputs.cache-hit != 'true'
|
|
69
|
+
run: |
|
|
70
|
+
Write-Host "Downloading QuantLib $env:QUANTLIB_VERSION..."
|
|
71
|
+
Invoke-WebRequest -Uri "https://github.com/lballabio/QuantLib/releases/download/v$env:QUANTLIB_VERSION/QuantLib-$env:QUANTLIB_VERSION.tar.gz" -OutFile QuantLib.tar.gz
|
|
72
|
+
tar xzf QuantLib.tar.gz
|
|
73
|
+
cd "QuantLib-$env:QUANTLIB_VERSION"
|
|
74
|
+
mkdir build -Force | Out-Null
|
|
75
|
+
cd build
|
|
76
|
+
Write-Host "Configuring QuantLib with std:: flags..."
|
|
77
|
+
cmake .. -G "Visual Studio 17 2022" -A x64 `
|
|
78
|
+
-DCMAKE_BUILD_TYPE=Release `
|
|
79
|
+
-DCMAKE_INSTALL_PREFIX=C:/quantlib-install `
|
|
80
|
+
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL `
|
|
81
|
+
-DQL_USE_STD_SHARED_PTR=ON `
|
|
82
|
+
-DQL_USE_STD_OPTIONAL=ON `
|
|
83
|
+
-DQL_USE_STD_ANY=ON `
|
|
84
|
+
-DQL_BUILD_EXAMPLES=OFF `
|
|
85
|
+
-DQL_BUILD_TEST_SUITE=OFF `
|
|
86
|
+
-DQL_BUILD_BENCHMARK=OFF `
|
|
87
|
+
-DBoost_INCLUDE_DIR=C:/boost/include
|
|
88
|
+
Write-Host "Building QuantLib..."
|
|
89
|
+
cmake --build . --config Release --parallel
|
|
90
|
+
Write-Host "Installing QuantLib..."
|
|
91
|
+
cmake --install . --config Release
|
|
92
|
+
|
|
93
|
+
- name: Verify QuantLib configuration
|
|
94
|
+
run: |
|
|
95
|
+
Write-Host "Checking QuantLib config.hpp for std:: flags..."
|
|
96
|
+
Get-Content "C:\quantlib-install\include\ql\config.hpp" | Select-String -Pattern "QL_USE_STD"
|
|
97
|
+
|
|
98
|
+
- name: Install Python build dependencies
|
|
99
|
+
run: |
|
|
100
|
+
python -m pip install --upgrade pip
|
|
101
|
+
|
|
102
|
+
- name: Build package with dev dependencies
|
|
103
|
+
run: |
|
|
104
|
+
pip install -e .[dev] -v
|
|
105
|
+
env:
|
|
106
|
+
QuantLib_ROOT: C:/quantlib-install
|
|
107
|
+
Boost_INCLUDE_DIR: C:/boost/include
|
|
108
|
+
|
|
109
|
+
- name: Run tests
|
|
110
|
+
run: |
|
|
111
|
+
pytest -v
|