diff --git a/.github/workflows/quantlib-risks.yml b/.github/workflows/quantlib-risks.yml index 4b15bd08..5fd8471c 100644 --- a/.github/workflows/quantlib-risks.yml +++ b/.github/workflows/quantlib-risks.yml @@ -3,16 +3,16 @@ # - OR pushes of tags starting with v* # - OR manual dispatch on repo # publishes to test pypi if: -# - in auto-differentiation/QuantLib-Risks-Py repository AND +# - in auto-differentiation/QuantLibAAD-Py repository AND # - pushes of tags starting with v* # - OR manual dispatch on repo # publishes to real PyPI if: # - publish to Test PyPI worked (with all build conditions above) # - and if it's a version tag (starting with v*) # -# cibuildwheel config: [tool.cibuildwheel] in pyproject.toml +# cibuildwheel config: [tool.cibuildwheel] in pyproject.toml; shim/ is built alongside -name: QuantLib-Risks wheels +name: QuantLibAAD wheels on: pull_request: branches: @@ -87,7 +87,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v7 with: - name: cibw-wheels-${{ matrix.platform.name }}-${{ matrix.python }} + name: dist-wheels-${{ matrix.platform.name }}-${{ matrix.python }} path: ./wheelhouse/*.whl if-no-files-found: error @@ -110,26 +110,44 @@ jobs: - name: Upload sdist uses: actions/upload-artifact@v7 with: - name: cibw-sdist + name: dist-sdist path: dist/*.tar.gz if-no-files-found: error + build_shim: + name: QuantLib-Risks shim + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7 + with: + persist-credentials: false + - name: Build sdist and wheel + run: pipx run build --outdir dist shim + - name: Check metadata + run: pipx run twine check --strict dist/* + - name: Upload shim + uses: actions/upload-artifact@v7 + with: + name: dist-shim + path: dist/* + if-no-files-found: error + test-publish: - needs: [build_wheels, build_sdist] + needs: [build_wheels, build_sdist, build_shim] if: >- - github.repository == 'auto-differentiation/QuantLib-Risks-Py' && + github.repository == 'auto-differentiation/QuantLibAAD-Py' && (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))) environment: name: testpypi - url: https://test.pypi.org/p/QuantLib-Risks + url: https://test.pypi.org/p/QuantLibAAD permissions: id-token: write runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v8 with: - pattern: cibw-* + pattern: dist-* path: dist merge-multiple: true - uses: pypa/gh-action-pypi-publish@v1.14.3 @@ -145,13 +163,13 @@ jobs: if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') environment: name: pypi - url: https://pypi.org/p/QuantLib-Risks + url: https://pypi.org/p/QuantLibAAD permissions: id-token: write steps: - uses: actions/download-artifact@v8 with: - pattern: cibw-* + pattern: dist-* path: dist merge-multiple: true - uses: pypa/gh-action-pypi-publish@v1.14.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ab61a8..74ef2d63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # ChangeLog This log is to be read in conjunction with [ChangeLog.txt](./ChangeLog.txt). -It lists the QuantLib-Risks specific changes on top of what is already listed in +It lists the QuantLibAAD (formerly QuantLib-Risks) specific changes on top of what is already listed in the underlying QuantLib-SWIG changelog. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), @@ -9,9 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.41.0] - Unreleased +- Renamed QuantLib-Risks -> QuantLibAAD: `pip install QuantLibAAD`, `import QuantLibAAD` +- `QuantLib-Risks` 1.41.0 is a deprecated shim (`shim/`) that requires `QuantLibAAD==1.41.*` and + re-exports it as `QuantLib_Risks` with a `DeprecationWarning` +- Anyone pinned to `QuantLib-Risks==1.33.3` must also pin `xad<2` - Matches QuantLib and QuantLib Python bindings version 1.41 - Builds against QuantLibAAD 1.41 (formerly QuantLib-Risks-Cpp) and the shared libxad of the installed xad 2.2 package (`xad>=2.2,<2.3`), which is not bundled -- Tapes are shared with xad through libxad, thread-local per Python thread; QuantLib no longer patches `xad.adj_1st.Tape` +- Tapes are shared with xad through libxad, thread-local per Python thread - Builds the unmodified QuantLib 1.41 release, no QuantLib patches - One-step build with scikit-build-core; wheels for Python 3.10-3.14 on Linux, macOS and Windows - `tools/sync-swig.sh` syncs `SWIG/` with a QuantLib-SWIG release, re-applying the XAD changes in `SWIG/patches/` @@ -32,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Initial release, matching QuantLib Python bindings version 1.33 -[1.41.0]: https://github.com/auto-differentiation/QuantLib-Risks-Py/compare/v1.33.3...v1.41.0 +[1.41.0]: https://github.com/auto-differentiation/QuantLibAAD-Py/compare/v1.33.3...v1.41.0 [1.33.3]: https://github.com/auto-differentiation/QuantLib-Risks-Py/compare/v1.33.2...v1.33.3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c2bf7a1..aa570356 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ ############################################################################## -# CMake file for QuantLib-Risks, driven by scikit-build-core (pyproject.toml). +# CMake file for QuantLibAAD, driven by scikit-build-core (pyproject.toml). # Keep the version in sync with pyproject.toml. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # @@ -24,7 +24,7 @@ ############################################################################## cmake_minimum_required(VERSION 3.18...4.2) -project(QuantLib_Risks LANGUAGES CXX VERSION 1.41.0) +project(QuantLibAAD_Py LANGUAGES CXX VERSION 1.41.0) set(QLR_VERSION ${PROJECT_VERSION}) set(QLR_HEX_VERSION "0x014100f0") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13f55960..f829afcb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,12 +7,12 @@ Note that this fork is importing all changes from the QuantLib-SWIG repository o release. Changes related to QuantLib's own Python bindings will be included in each new release. Contributions to this repository should only be made if they are related to building -the Python bindings for QuantLib-Risks (enabled with XAD). +the Python bindings for QuantLibAAD (enabled with XAD). 1. Fork, then clone the repository with its submodules: ```bash -git clone --recurse-submodules https://github.com/yourusername/QuantLib-Risks-Py.git +git clone --recurse-submodules https://github.com/yourusername/QuantLibAAD-Py.git ``` 2. Follow the [Build Instructions](#build-instructions) below to build the software. @@ -54,7 +54,7 @@ The package is built in one step by [scikit-build-core](https://scikit-build-cor (see `pyproject.toml`): CMake builds QuantLib as a static library together with [QuantLibAAD](https://github.com/auto-differentiation/QuantLibAAD) from the `lib/` submodules, against [XAD](https://github.com/auto-differentiation/xad) from the installed -[xad](https://pypi.org/project/xad/) package (`xad.get_cmake_dir()`), then the SWIG module from `SWIG/` and `Python/QuantLib_Risks/`. +[xad](https://pypi.org/project/xad/) package (`xad.get_cmake_dir()`), then the SWIG module from `SWIG/` and `Python/QuantLibAAD/`. Requirements: Python 3.10+, and a C++17 compiler. CMake, Ninja and SWIG are installed as build dependencies. @@ -67,7 +67,7 @@ python -m venv .venv source .venv/bin/activate pip install -v . pytest # run the tests from outside the source tree, against the installed package -cd /tmp && python -m pytest --import-mode=importlib /path/to/QuantLib-Risks-Py/Python/test +cd /tmp && python -m pytest --import-mode=importlib /path/to/QuantLibAAD-Py/Python/test ``` Notes: @@ -88,8 +88,11 @@ Notes: - Wheels for all supported Python versions are built with [cibuildwheel](https://cibuildwheel.pypa.io) (`pipx run cibuildwheel`, configured in `pyproject.toml`), the source distribution with `pipx run build --sdist`. +- `shim/` is the pure-Python `QuantLib-Risks` distribution, a deprecated alias that requires + `QuantLibAAD` and re-exports it as `QuantLib_Risks`. Build it with `pipx run build shim` + and keep its version and `QuantLibAAD` requirement in sync with `pyproject.toml`. -[pr]: https://github.com/auto-differentiation/QuantLib-Risks/compare/ +[pr]: https://github.com/auto-differentiation/QuantLibAAD-Py/compare/ [cla]: https://gist.github.com/auto-differentiation-dev/5c6121c3f341e2de710fa034e9ff3263 diff --git a/LICENSE.md b/LICENSE.md index 922488ec..d65553d8 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # License Terms -QuantLib-Risks is published under the AGPL, version 3, with the terms +QuantLibAAD is published under the AGPL, version 3, with the terms [given below](#gnu-affero-general-public-license). It contains code from [QuantLib](https://www.quantlib.org) @@ -8,7 +8,7 @@ and is based on [QuantLib-SWIG](https://github.com/lballabio/QuantLib-SWIG), which are shipped with a different (compatible) license. The license terms for these packages [are given below](#quantlib-swig-license). -## QuantLib-Risks License +## QuantLibAAD License ### GNU AFFERO GENERAL PUBLIC LICENSE diff --git a/Python/CMakeLists.txt b/Python/CMakeLists.txt index fc12bd66..b66fddc9 100644 --- a/Python/CMakeLists.txt +++ b/Python/CMakeLists.txt @@ -1,7 +1,7 @@ ############################################################################## # Main CMake file for the Python extension. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # @@ -30,4 +30,4 @@ include(UseSWIG) set(PYBIND11_FINDPYTHON ON) add_subdirectory(${PROJECT_SOURCE_DIR}/lib/pybind11 ${CMAKE_BINARY_DIR}/pybind11) -add_subdirectory(QuantLib_Risks) +add_subdirectory(QuantLibAAD) diff --git a/Python/QuantLib_Risks/CMakeLists.txt b/Python/QuantLibAAD/CMakeLists.txt similarity index 62% rename from Python/QuantLib_Risks/CMakeLists.txt rename to Python/QuantLibAAD/CMakeLists.txt index f31cc43e..f20c1470 100644 --- a/Python/QuantLib_Risks/CMakeLists.txt +++ b/Python/QuantLibAAD/CMakeLists.txt @@ -1,7 +1,7 @@ ############################################################################## # Build and install the SWIG binary module and the Python package. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # @@ -30,31 +30,36 @@ set_property(SOURCE ${QLR_SWIG_SOURCE} PROPERTY COMPILE_OPTIONS -DQLR_VERSION=\"${QLR_VERSION}\" -DQLR_HEX_VERSION=${QLR_HEX_VERSION}) -# builds _QuantLib_Risks and generates QuantLib_Risks.py -swig_add_library(QuantLib_Risks +set_property(SOURCE ${QLR_SWIG_SOURCE} PROPERTY SWIG_MODULE_NAME QuantLibAAD) + +# builds _QuantLibAAD and generates QuantLibAAD.py; the target name avoids a clash +# with the C++ QuantLibAAD target +swig_add_library(QuantLibAAD_Python LANGUAGE python OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} SOURCES ${QLR_SWIG_SOURCE} converters.cpp) -target_link_libraries(QuantLib_Risks PRIVATE QuantLib::QuantLib XAD::xad pybind11::module) -target_compile_definitions(QuantLib_Risks PRIVATE +target_link_libraries(QuantLibAAD_Python PRIVATE QuantLib::QuantLib XAD::xad pybind11::module) +target_compile_definitions(QuantLibAAD_Python PRIVATE QL_XAD=1 QLR_VERSION=\"${QLR_VERSION}\" QLR_HEX_VERSION=${QLR_HEX_VERSION}) -target_include_directories(QuantLib_Risks PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -set_target_properties(QuantLib_Risks PROPERTIES SUFFIX "${PYTHON_MODULE_EXTENSION}") +target_include_directories(QuantLibAAD_Python PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +set_target_properties(QuantLibAAD_Python PROPERTIES + OUTPUT_NAME QuantLibAAD + SUFFIX "${PYTHON_MODULE_EXTENSION}") # libxad from the installed xad package (on Windows, importing xad adds its DLL directory) if(APPLE) - set_target_properties(QuantLib_Risks PROPERTIES INSTALL_RPATH "@loader_path/../xad/lib") + set_target_properties(QuantLibAAD_Python PROPERTIES INSTALL_RPATH "@loader_path/../xad/lib") elseif(UNIX) - set_target_properties(QuantLib_Risks PROPERTIES INSTALL_RPATH "$ORIGIN/../xad/lib") + set_target_properties(QuantLibAAD_Python PROPERTIES INSTALL_RPATH "$ORIGIN/../xad/lib") endif() if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|RelWithDebInfo") - pybind11_strip(QuantLib_Risks) + pybind11_strip(QuantLibAAD_Python) endif() -get_property(QLR_SWIG_PY TARGET QuantLib_Risks PROPERTY SWIG_SUPPORT_FILES) -install(TARGETS QuantLib_Risks - LIBRARY DESTINATION QuantLib_Risks COMPONENT python - RUNTIME DESTINATION QuantLib_Risks COMPONENT python) +get_property(QLR_SWIG_PY TARGET QuantLibAAD_Python PROPERTY SWIG_SUPPORT_FILES) +install(TARGETS QuantLibAAD_Python + LIBRARY DESTINATION QuantLibAAD COMPONENT python + RUNTIME DESTINATION QuantLibAAD COMPONENT python) install(FILES __init__.py ${QLR_SWIG_PY} - DESTINATION QuantLib_Risks COMPONENT python) + DESTINATION QuantLibAAD COMPONENT python) diff --git a/Python/QuantLib_Risks/__init__.py b/Python/QuantLibAAD/__init__.py similarity index 69% rename from Python/QuantLib_Risks/__init__.py rename to Python/QuantLibAAD/__init__.py index 9263c3cc..a6fde607 100644 --- a/Python/QuantLib_Risks/__init__.py +++ b/Python/QuantLibAAD/__init__.py @@ -3,16 +3,16 @@ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,16 +33,16 @@ import xad # loads libxad, which the binary module links against -from .QuantLib_Risks import * +from .QuantLibAAD import * if XAD_ENABLED: from xad.adj_1st import Real, Tape from typing import Union, Tuple, List - # as part of the input at the top, we'll have _QuantLib_Risks in scope - DoubleVector = _QuantLib_Risks.DoubleVector - DoublePairVector = _QuantLib_Risks.DoublePairVector - DoubleVectorVector = _QuantLib_Risks.DoubleVectorVector + # as part of the input at the top, we'll have _QuantLibAAD in scope + DoubleVector = _QuantLibAAD.DoubleVector + DoublePairVector = _QuantLibAAD.DoublePairVector + DoubleVectorVector = _QuantLibAAD.DoubleVectorVector def Concentrating1dMesherPoint( x1: Union[Real, float, int], x2: Union[Real, float, int], v: bool @@ -54,16 +54,16 @@ def PairDoubleVector( ) -> Tuple[List[Real], List[Real]]: return ([Real(x) for x in x1], [Real(x) for x in x2]) -if hasattr(_QuantLib_Risks, "__version__"): - __version__ = _QuantLib_Risks.__version__ -elif hasattr(_QuantLib_Risks.cvar, "__version__"): - __version__ = _QuantLib_Risks.cvar.__version__ +if hasattr(_QuantLibAAD, "__version__"): + __version__ = _QuantLibAAD.__version__ +elif hasattr(_QuantLibAAD.cvar, "__version__"): + __version__ = _QuantLibAAD.cvar.__version__ else: print("Could not find __version__ attribute") -if hasattr(_QuantLib_Risks, "__hexversion__"): - __hexversion__ = _QuantLib_Risks.__hexversion__ -elif hasattr(_QuantLib_Risks.cvar, "__hexversion__"): - __hexversion__ = _QuantLib_Risks.cvar.__hexversion__ +if hasattr(_QuantLibAAD, "__hexversion__"): + __hexversion__ = _QuantLibAAD.__hexversion__ +elif hasattr(_QuantLibAAD.cvar, "__hexversion__"): + __hexversion__ = _QuantLibAAD.cvar.__hexversion__ else: print("Could not find __hexversion__ attribute") diff --git a/Python/QuantLib_Risks/converters.cpp b/Python/QuantLibAAD/converters.cpp similarity index 99% rename from Python/QuantLib_Risks/converters.cpp rename to Python/QuantLibAAD/converters.cpp index 79cbcba7..c6cb9287 100644 --- a/Python/QuantLib_Risks/converters.cpp +++ b/Python/QuantLibAAD/converters.cpp @@ -2,7 +2,7 @@ * Type converters and checks for the SWIG interface, interacting with XAD's * Pybind11 based bindings. * - * This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + * This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled * for risk computation using automatic differentiation. It uses XAD, * a fast and comprehensive C++ library for automatic differentiation. * diff --git a/Python/QuantLib_Risks/converters.hpp b/Python/QuantLibAAD/converters.hpp similarity index 98% rename from Python/QuantLib_Risks/converters.hpp rename to Python/QuantLibAAD/converters.hpp index 82c189fe..330ee661 100644 --- a/Python/QuantLib_Risks/converters.hpp +++ b/Python/QuantLibAAD/converters.hpp @@ -2,7 +2,7 @@ * Type converters and checks for the SWIG interface, interacting with XAD's * Pybind11 based bindings. * - * This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + * This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled * for risk computation using automatic differentiation. It uses XAD, * a fast and comprehensive C++ library for automatic differentiation. * diff --git a/Python/README.md b/Python/README.md index 30935146..2f1f67df 100644 --- a/Python/README.md +++ b/Python/README.md @@ -9,9 +9,13 @@ Useful links: ## Installation ``` -pip install QuantLib-Risks +pip install QuantLibAAD ``` +This package was called QuantLib-Risks up to version 1.33.3. `QuantLib-Risks` 1.41 is a +deprecated alias that installs `QuantLibAAD` and keeps `import QuantLib_Risks` working with a +`DeprecationWarning`. Anyone pinned to `QuantLib-Risks==1.33.3` must also pin `xad<2`. + Binary wheels are provided for CPython 3.10 to 3.14 on Linux (x86_64, aarch64), macOS (x86_64, arm64) and Windows (x86_64). The package requires the matching [xad](https://pypi.org/project/xad/) release, which pip installs automatically. @@ -22,20 +26,20 @@ On other platforms pip builds the package from the source distribution, which co and takes a while. This needs a C++17 compiler; CMake, Ninja and SWIG are fetched as build dependencies, and Boost headers are downloaded unless found on the system (or via `BOOST_ROOT`). To build from a clone of the -[repository](https://github.com/auto-differentiation/QuantLib-Risks-Py): +[repository](https://github.com/auto-differentiation/QuantLibAAD-Py): ``` -git clone --recurse-submodules https://github.com/auto-differentiation/QuantLib-Risks-Py.git -pip install -v ./QuantLib-Risks-Py +git clone --recurse-submodules https://github.com/auto-differentiation/QuantLibAAD-Py.git +pip install -v ./QuantLibAAD-Py ``` ## Usage Illustration ```python -import QuantLib_Risks as ql +import QuantLibAAD as ql from xad.adj_1st import Tape -with Tape() as t: +with Tape() as tape: rate = ql.Real(0.2) tape.registerInput(rate) @@ -55,4 +59,4 @@ with Tape() as t: ## Related Projects - XAD Comprehensive automatic differentiation in [Python](https://github.com/auto-differentiation/xad-py) and [C++](https://github.com/auto-differentiation/xad) -- QuantLib-Risks: Fast risk evaluations in [Python](https://github.com/auto-differentiation/QuantLib-Risks-Py) and [C++ (QuantLibAAD)](https://github.com/auto-differentiation/QuantLibAAD) +- QuantLibAAD: Fast risk evaluations in [Python](https://github.com/auto-differentiation/QuantLibAAD-Py) and [C++](https://github.com/auto-differentiation/QuantLibAAD) diff --git a/Python/examples/README.md b/Python/examples/README.md index 623c3742..f573cfe6 100644 --- a/Python/examples/README.md +++ b/Python/examples/README.md @@ -1,6 +1,6 @@ -# QuantLib-Risks Python examples +# QuantLibAAD Python examples -[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/auto-differentiation/QuantLib-Risks/main?labpath=Python%2Fexamples) +[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/auto-differentiation/QuantLibAAD-Py/main?labpath=Python%2Fexamples) This directory contains a number of examples of using risk-enabled QuantLib from Python. They can also run as Jupyter notebooks by means of @@ -11,8 +11,8 @@ If you're seeing this file as a notebook, you're probably there already. If not, you can click the "Launch Binder" badge at the top of this file. If you want to run these examples locally, you'll need the modules listed in the -`requirements.txt` file in the `binder` folder at the root of the [QuantLib-Risks -repository](https://github.com/auto-differentiation/QuantLib-Risks); to install +`requirements.txt` file in the `binder` folder at the root of the [QuantLibAAD-Py +repository](https://github.com/auto-differentiation/QuantLibAAD-Py); to install them, you can execute pip install -r requirements.txt diff --git a/Python/examples/american-option.py b/Python/examples/american-option.py index 6b807a9b..0fd80ec8 100644 --- a/Python/examples/american-option.py +++ b/Python/examples/american-option.py @@ -19,16 +19,16 @@ # Copyright (©) 2004, 2005, 2006, 2007 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # FOR A PARTICULAR PURPOSE. See the license for more details. # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd # %% [markdown] diff --git a/Python/examples/basket-option.py b/Python/examples/basket-option.py index cb673dce..eb82c002 100644 --- a/Python/examples/basket-option.py +++ b/Python/examples/basket-option.py @@ -18,16 +18,16 @@ # Copyright (©) 2004, 2005, 2006 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -45,7 +45,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the license for more details. -import QuantLib_Risks as ql +import QuantLibAAD as ql # ### Global data diff --git a/Python/examples/bermudan-swaption.py b/Python/examples/bermudan-swaption.py index 5f642415..7ef2c7ac 100644 --- a/Python/examples/bermudan-swaption.py +++ b/Python/examples/bermudan-swaption.py @@ -18,16 +18,16 @@ # Copyright (©) 2004, 2005, 2006, 2007 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -45,7 +45,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the license for more details. -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd # ### Setup diff --git a/Python/examples/bonds.py b/Python/examples/bonds.py index 44f65604..39f516ae 100644 --- a/Python/examples/bonds.py +++ b/Python/examples/bonds.py @@ -19,16 +19,16 @@ # Copyright (©) 2010 Lluis Pujol Bajador # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -50,7 +50,7 @@ # some simple bonds. The last part is dedicated to peripherical # computations such as "Yield to Price" or "Price to Yield" -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd interactive = 'get_ipython' in globals() diff --git a/Python/examples/callablebonds.py b/Python/examples/callablebonds.py index 3eec3dc6..ad38a0b6 100644 --- a/Python/examples/callablebonds.py +++ b/Python/examples/callablebonds.py @@ -15,16 +15,16 @@ # # Callable bonds # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -42,7 +42,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the license for more details. -import QuantLib_Risks as ql +import QuantLibAAD as ql import numpy as np calcDate = ql.Date(16, 8, 2006) diff --git a/Python/examples/capsfloors.py b/Python/examples/capsfloors.py index 303d0b1e..045e906f 100644 --- a/Python/examples/capsfloors.py +++ b/Python/examples/capsfloors.py @@ -15,16 +15,16 @@ # # Caps and Floors # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -42,7 +42,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the license for more details. -import QuantLib_Risks as ql +import QuantLibAAD as ql calcDate = ql.Date(14, 6, 2016) ql.Settings.instance().evaluationDate = calcDate diff --git a/Python/examples/cashflows.py b/Python/examples/cashflows.py index a7e78492..0440c4b0 100644 --- a/Python/examples/cashflows.py +++ b/Python/examples/cashflows.py @@ -19,16 +19,16 @@ # Copyright (©) 2020 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # FOR A PARTICULAR PURPOSE. See the license for more details. # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd # %% diff --git a/Python/examples/cds.py b/Python/examples/cds.py index 4891c174..3203dff8 100644 --- a/Python/examples/cds.py +++ b/Python/examples/cds.py @@ -18,16 +18,16 @@ # Copyright (©) 2014 Thema Consulting SA # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # ### Setup -import QuantLib_Risks as ql +import QuantLibAAD as ql calendar = ql.TARGET() diff --git a/Python/examples/european-option.py b/Python/examples/european-option.py index 3bd1872f..920af535 100644 --- a/Python/examples/european-option.py +++ b/Python/examples/european-option.py @@ -19,16 +19,16 @@ # Copyright (©) 2004, 2005, 2006, 2007 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # FOR A PARTICULAR PURPOSE. See the license for more details. # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd # %% [markdown] diff --git a/Python/examples/gaussian1d-models.py b/Python/examples/gaussian1d-models.py index a3e36566..4a9054dc 100644 --- a/Python/examples/gaussian1d-models.py +++ b/Python/examples/gaussian1d-models.py @@ -19,16 +19,16 @@ # Copyright (©) 2018 Angus Lee # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -50,7 +50,7 @@ # ### Setup # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd # %% diff --git a/Python/examples/global-bootstrap.py b/Python/examples/global-bootstrap.py index 44056a4e..d9378a2a 100644 --- a/Python/examples/global-bootstrap.py +++ b/Python/examples/global-bootstrap.py @@ -19,16 +19,16 @@ # Copyright (©) 2020 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # FOR A PARTICULAR PURPOSE. See the license for more details. # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd # %% diff --git a/Python/examples/isda-engine.py b/Python/examples/isda-engine.py index 215a81e6..7287acb5 100644 --- a/Python/examples/isda-engine.py +++ b/Python/examples/isda-engine.py @@ -15,16 +15,16 @@ # # ISDA CDS engine # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -42,7 +42,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the license for more details. -import QuantLib_Risks as ql +import QuantLibAAD as ql import pandas as pd interactive = 'get_ipython' in globals() diff --git a/Python/examples/multicurve-bootstrapping.py b/Python/examples/multicurve-bootstrapping.py index f3b0034f..124d4d42 100644 --- a/Python/examples/multicurve-bootstrapping.py +++ b/Python/examples/multicurve-bootstrapping.py @@ -18,7 +18,7 @@ # # This sample prices a forward-starting interest rate swap on a curve that # has been bootrapped on a large number of market quotes. -# It calculates all sensitivities using QuantLib-Risks and measures the performance +# It calculates all sensitivities using QuantLibAAD and measures the performance # (averaged over a number of repetitions). # # Pricing using standard QuantLib can also be done by simply changing the import @@ -31,16 +31,16 @@ # Copyright (©) 2018 Jose Garcia
# Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -60,7 +60,7 @@ # %% -import QuantLib_Risks as ql # enable this to calculate sensitivities +import QuantLibAAD as ql # enable this to calculate sensitivities # import QuantLib as ql # enable this for regular QuantLib performance @@ -578,7 +578,7 @@ def printResults( if not getattr(ql, "XAD_ENABLED", False): - # ql.XAD_ENABLED is set if we're using QuantLib-Risks + # ql.XAD_ENABLED is set if we're using QuantLibAAD print("Pricing swap with multicurve bootstrapping without sensitivities...") start = time.perf_counter_ns() for _ in range(N): diff --git a/Python/examples/slv.py b/Python/examples/slv.py index 7ed47e28..c58d3921 100644 --- a/Python/examples/slv.py +++ b/Python/examples/slv.py @@ -19,16 +19,16 @@ # Copyright (©) 2019 Klaus Spanderen # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -56,7 +56,7 @@ sys.exit() # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql from matplotlib import pyplot as plt import numpy as np from xad import math, value diff --git a/Python/examples/swap-adjoint.py b/Python/examples/swap-adjoint.py index fd23f63a..cdd1ba91 100644 --- a/Python/examples/swap-adjoint.py +++ b/Python/examples/swap-adjoint.py @@ -19,16 +19,16 @@ # Copyright (©) 2004, 2005, 2006, 2007 StatPro Italia srl
# Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # FOR A PARTICULAR PURPOSE. See the license for more details. # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql from xad.adj_1st import Tape # %% [markdown] diff --git a/Python/examples/swap.py b/Python/examples/swap.py index 44fe6108..84be3ad9 100644 --- a/Python/examples/swap.py +++ b/Python/examples/swap.py @@ -19,16 +19,16 @@ # Copyright (©) 2004, 2005, 2006, 2007 StatPro Italia srl # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -47,7 +47,7 @@ # FOR A PARTICULAR PURPOSE. See the license for more details. # %% -import QuantLib_Risks as ql +import QuantLibAAD as ql # %% [markdown] # ### Global data diff --git a/Python/examples/swing.py b/Python/examples/swing.py index 80458736..cbc40e43 100644 --- a/Python/examples/swing.py +++ b/Python/examples/swing.py @@ -18,16 +18,16 @@ # Copyright (©) 2018 Klaus Spanderen # Copyright (©) 2024 Xcelerit Computing Limited. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # -# QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +# QuantLibAAD and XAD are free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # -# QuantLib-Risks is distributed in the hope that it will be useful, +# QuantLibAAD is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. @@ -45,7 +45,7 @@ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the license for more details. -import QuantLib_Risks as ql +import QuantLibAAD as ql from xad import math todaysDate = ql.Date(30, ql.September, 2018) diff --git a/Python/run_tests.bat b/Python/run_tests.bat index 2d26434a..815d953b 100644 --- a/Python/run_tests.bat +++ b/Python/run_tests.bat @@ -1,7 +1,7 @@ :: ############################################################################# :: :: -:: This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +:: This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled :: for risk computation using automatic differentiation. It uses XAD, :: a fast and comprehensive C++ library for automatic differentiation. :: diff --git a/Python/run_tests.sh b/Python/run_tests.sh index 83dcdb6e..448487aa 100644 --- a/Python/run_tests.sh +++ b/Python/run_tests.sh @@ -3,7 +3,7 @@ ############################################################################## # # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # diff --git a/Python/test/test_americanquantooption.py b/Python/test/test_americanquantooption.py index 7632f9aa..9e744e34 100644 --- a/Python/test/test_americanquantooption.py +++ b/Python/test/test_americanquantooption.py @@ -2,16 +2,16 @@ Copyright (C) 2019 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class AmericanQuantoOptionTest(unittest.TestCase): def setUp(self): diff --git a/Python/test/test_basket_option.py b/Python/test/test_basket_option.py index 9b7648ac..e15f23be 100644 --- a/Python/test/test_basket_option.py +++ b/Python/test/test_basket_option.py @@ -17,7 +17,7 @@ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class BasketOptionTest(unittest.TestCase): diff --git a/Python/test/test_blackformula.py b/Python/test/test_blackformula.py index 27e8404b..b477a186 100644 --- a/Python/test/test_blackformula.py +++ b/Python/test/test_blackformula.py @@ -3,16 +3,16 @@ Copyright (C) 2017 Wojciech Ślusarski Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ """ import unittest import math -import QuantLib_Risks as ql +import QuantLibAAD as ql class BlackFormulaTest(unittest.TestCase): diff --git a/Python/test/test_bondfunctions.py b/Python/test/test_bondfunctions.py index 6f5f28c6..f14f4545 100644 --- a/Python/test/test_bondfunctions.py +++ b/Python/test/test_bondfunctions.py @@ -4,16 +4,16 @@ Copyright (C) 2023 Francois Botha Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_bonds.py b/Python/test/test_bonds.py index f5d6dd77..35a2be78 100644 --- a/Python/test/test_bonds.py +++ b/Python/test/test_bonds.py @@ -3,16 +3,16 @@ Copyright (C) 2019 Prasad Somwanshi Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_calendars.py b/Python/test/test_calendars.py index 60c4f5d4..0a41cefc 100644 --- a/Python/test/test_calendars.py +++ b/Python/test/test_calendars.py @@ -2,16 +2,16 @@ Copyright (C) 2023 Skandinaviska Enskilda Banken AB (publ) Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ import itertools import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class JointCalendarTest(unittest.TestCase): diff --git a/Python/test/test_capfloor.py b/Python/test/test_capfloor.py index 28400f6c..345a2daf 100644 --- a/Python/test/test_capfloor.py +++ b/Python/test/test_capfloor.py @@ -3,16 +3,16 @@ Copyright (C) 2016 Wojciech Ślusarski Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest class CapFloorTest(unittest.TestCase): diff --git a/Python/test/test_cms.py b/Python/test/test_cms.py index d29efc94..3fe53067 100644 --- a/Python/test/test_cms.py +++ b/Python/test/test_cms.py @@ -2,16 +2,16 @@ Copyright (C) 2011 Lluis Pujol Bajador Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -30,7 +30,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_coupons.py b/Python/test/test_coupons.py index 2bbd3a69..1f9038c5 100644 --- a/Python/test/test_coupons.py +++ b/Python/test/test_coupons.py @@ -16,7 +16,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql EPSILON = 1.e-9 diff --git a/Python/test/test_currencies.py b/Python/test/test_currencies.py index 8d724673..6ae87830 100644 --- a/Python/test/test_currencies.py +++ b/Python/test/test_currencies.py @@ -2,16 +2,16 @@ Copyright (C) 2021 Marcin Rybacki Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class CurrencyTest(unittest.TestCase): diff --git a/Python/test/test_date.py b/Python/test/test_date.py index a6060a6b..618ab9c1 100644 --- a/Python/test/test_date.py +++ b/Python/test/test_date.py @@ -2,16 +2,16 @@ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ import datetime import operator -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_daycounters.py b/Python/test/test_daycounters.py index b92261ee..36b2c0b6 100644 --- a/Python/test/test_daycounters.py +++ b/Python/test/test_daycounters.py @@ -1,4 +1,4 @@ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_equityindex.py b/Python/test/test_equityindex.py index 1143454e..e855bff7 100644 --- a/Python/test/test_equityindex.py +++ b/Python/test/test_equityindex.py @@ -15,7 +15,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_extrapolation.py b/Python/test/test_extrapolation.py index 1e5e4abf..81f1b3c2 100644 --- a/Python/test/test_extrapolation.py +++ b/Python/test/test_extrapolation.py @@ -2,16 +2,16 @@ Copyright (C) 2019 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ import math import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class ExtrapolationTest(unittest.TestCase): diff --git a/Python/test/test_fdm.py b/Python/test/test_fdm.py index 5923b166..03bbf25b 100644 --- a/Python/test/test_fdm.py +++ b/Python/test/test_fdm.py @@ -2,16 +2,16 @@ Copyright (C) 2020 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ import math import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class FdmTest(unittest.TestCase): diff --git a/Python/test/test_futures.py b/Python/test/test_futures.py index 41871ec6..b2b8e722 100644 --- a/Python/test/test_futures.py +++ b/Python/test/test_futures.py @@ -16,7 +16,7 @@ """ import unittest import math -import QuantLib_Risks as ql +import QuantLibAAD as ql LAG = 0 DC = ql.ActualActual(ql.ActualActual.ISDA) diff --git a/Python/test/test_iborindex.py b/Python/test/test_iborindex.py index 429b48fe..bd0aa4c1 100644 --- a/Python/test/test_iborindex.py +++ b/Python/test/test_iborindex.py @@ -3,16 +3,16 @@ Copyright (C) 2018 Wojciech Ślusarski Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_inflation.py b/Python/test/test_inflation.py index 396dd94a..7c217bb8 100644 --- a/Python/test/test_inflation.py +++ b/Python/test/test_inflation.py @@ -2,16 +2,16 @@ Copyright (C) 2020 Marcin Rybacki Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql EPSILON = 1.e-9 diff --git a/Python/test/test_instruments.py b/Python/test/test_instruments.py index 999c91e9..7e51226e 100644 --- a/Python/test/test_instruments.py +++ b/Python/test/test_instruments.py @@ -2,16 +2,16 @@ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -30,7 +30,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest flag = None diff --git a/Python/test/test_integrals.py b/Python/test/test_integrals.py index 1b60345a..bd616a2f 100644 --- a/Python/test/test_integrals.py +++ b/Python/test/test_integrals.py @@ -2,16 +2,16 @@ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -30,7 +30,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest import math diff --git a/Python/test/test_linear_algebra.py b/Python/test/test_linear_algebra.py index 6316798d..7e647d6a 100644 --- a/Python/test/test_linear_algebra.py +++ b/Python/test/test_linear_algebra.py @@ -1,4 +1,4 @@ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_marketelements.py b/Python/test/test_marketelements.py index 99095c90..c86132ae 100644 --- a/Python/test/test_marketelements.py +++ b/Python/test/test_marketelements.py @@ -2,16 +2,16 @@ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -30,7 +30,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest flag = None diff --git a/Python/test/test_money.py b/Python/test/test_money.py index c2c7c2b8..fed5e529 100644 --- a/Python/test/test_money.py +++ b/Python/test/test_money.py @@ -1,4 +1,4 @@ -import QuantLib_Risks as ql +import QuantLibAAD as ql import operator import unittest diff --git a/Python/test/test_ode.py b/Python/test/test_ode.py index 050ff43c..79304c34 100644 --- a/Python/test/test_ode.py +++ b/Python/test/test_ode.py @@ -2,16 +2,16 @@ Copyright (C) 2019 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ import math import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class OdeTest(unittest.TestCase): diff --git a/Python/test/test_options.py b/Python/test/test_options.py index 23357533..a7dcad60 100644 --- a/Python/test/test_options.py +++ b/Python/test/test_options.py @@ -2,16 +2,16 @@ Copyright (C) 2021 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class OptionsTest(unittest.TestCase): diff --git a/Python/test/test_ratehelpers.py b/Python/test/test_ratehelpers.py index b7feca10..7eeb137d 100644 --- a/Python/test/test_ratehelpers.py +++ b/Python/test/test_ratehelpers.py @@ -5,16 +5,16 @@ Copyright (C) 2021 Marcin Rybacki Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_risks.py b/Python/test/test_risks.py index 489525e3..c418c025 100644 --- a/Python/test/test_risks.py +++ b/Python/test/test_risks.py @@ -4,16 +4,16 @@ Copyright (©) 2004, 2005, 2006, 2007 StatPro Italia srl Copyright (©) 2024 Xcelerit Computing Limited. -This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. -QuantLib-Risks and XAD are free software: you can redistribute it and/or modify +QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -QuantLib-Risks is distributed in the hope that it will be useful, +QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql from xad.adj_1st import Tape class SwapWithSensiTest(unittest.TestCase): diff --git a/Python/test/test_sabr.py b/Python/test/test_sabr.py index abd70757..b2abf034 100644 --- a/Python/test/test_sabr.py +++ b/Python/test/test_sabr.py @@ -2,16 +2,16 @@ Copyright (C) 2019 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ import math import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class SabrTest(unittest.TestCase): diff --git a/Python/test/test_settings.py b/Python/test/test_settings.py index 54cf9e38..00924263 100644 --- a/Python/test/test_settings.py +++ b/Python/test/test_settings.py @@ -1,4 +1,4 @@ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest diff --git a/Python/test/test_slv.py b/Python/test/test_slv.py index 099d4d67..b24a1c81 100644 --- a/Python/test/test_slv.py +++ b/Python/test/test_slv.py @@ -2,16 +2,16 @@ Copyright (C) 2019 Klaus Spanderen Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class SlvTest(unittest.TestCase): diff --git a/Python/test/test_solvers1d.py b/Python/test/test_solvers1d.py index f90447f5..f9412c9c 100644 --- a/Python/test/test_solvers1d.py +++ b/Python/test/test_solvers1d.py @@ -2,16 +2,16 @@ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql class Foo: diff --git a/Python/test/test_swap.py b/Python/test/test_swap.py index 9714f979..42459eb2 100644 --- a/Python/test/test_swap.py +++ b/Python/test/test_swap.py @@ -17,7 +17,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql EPSILON = 1.e-8 diff --git a/Python/test/test_swaption.py b/Python/test/test_swaption.py index 6b3ef004..4fdb4a1f 100644 --- a/Python/test/test_swaption.py +++ b/Python/test/test_swaption.py @@ -2,16 +2,16 @@ Copyright (C) 2020 Marcin Rybacki Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -31,7 +31,7 @@ """ import unittest -import QuantLib_Risks as ql +import QuantLibAAD as ql BASIS_POINT = 1e-4 diff --git a/Python/test/test_termstructures.py b/Python/test/test_termstructures.py index ef28e176..e9bde5f9 100644 --- a/Python/test/test_termstructures.py +++ b/Python/test/test_termstructures.py @@ -4,16 +4,16 @@ Copyright (C) 2020 Marcin Rybacki Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -32,7 +32,7 @@ FOR A PARTICULAR PURPOSE. See the license for more details. """ -import QuantLib_Risks as ql +import QuantLibAAD as ql import unittest import math diff --git a/Python/test/test_volatilities.py b/Python/test/test_volatilities.py index 317ee78e..a79481a3 100644 --- a/Python/test/test_volatilities.py +++ b/Python/test/test_volatilities.py @@ -3,16 +3,16 @@ Copyright (C) 2022 Skandinaviska Enskilda Banken AB (publ) Copyright (C) 2024 Xcelerit Computing Limited. - This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled for risk computation using automatic differentiation. It uses XAD, a fast and comprehensive C++ library for automatic differentiation. - QuantLib-Risks and XAD are free software: you can redistribute it and/or modify + QuantLibAAD and XAD are free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - QuantLib-Risks is distributed in the hope that it will be useful, + QuantLibAAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. @@ -33,7 +33,7 @@ import unittest import math -import QuantLib_Risks as ql +import QuantLibAAD as ql TOLERANCE = 1e-10 if ql.IborCoupon.usingAtParCoupons() else 1e-6 SABR_ATM_TOLERANCE = 3.0e-4 diff --git a/README.md b/README.md index 65a4e5a5..445ddf6d 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ > Part of the [XAD ecosystem](https://github.com/auto-differentiation) — the fastest automatic differentiation library for C++. > If this is useful to you, please star the [core XAD repository](https://github.com/auto-differentiation/xad). -QuantLib-Risks: Risk-enabled QuantLib for Python -================================================ +QuantLibAAD: Risk-enabled QuantLib for Python +============================================= -[![Download source](https://img.shields.io/github/v/release/auto-differentiation/QuantLib-Risks-Py?label=source&sort=semver)](https://github.com/auto-differentiation/QuantLib-Risks-Py/releases/latest) -[![PyPI version](https://img.shields.io/pypi/v/QuantLib-Risks?label=PyPI)](https://pypi.org/project/QuantLib-Risks) +[![Download source](https://img.shields.io/github/v/release/auto-differentiation/QuantLibAAD-Py?label=source&sort=semver)](https://github.com/auto-differentiation/QuantLibAAD-Py/releases/latest) +[![PyPI version](https://img.shields.io/pypi/v/QuantLibAAD?label=PyPI)](https://pypi.org/project/QuantLibAAD) --- This repository builds QuantLib Python bindings with automatic differentiation, enabling fast risks calculation with QuantLib in Python. -It wraps [C++ QuantLib-Risks](https://github.com/auto-differentiation/QuantLib-Risks-Cpp) +It wraps [C++ QuantLibAAD](https://github.com/auto-differentiation/QuantLibAAD) in Python. It uses elements from [QuantLib-SWIG](https://github.com/lballabio/QuantLib-SWIG) and is kept in sync with it. @@ -21,19 +21,34 @@ is kept in sync with it. You can install it as: ``` -pip install QuantLib-Risks +pip install QuantLibAAD ``` +```python +import QuantLibAAD as ql +``` + +It links the XAD library that the [xad](https://pypi.org/project/xad) package ships, so +QuantLib and `xad` share one active tape per thread: a `xad.adj_1st.Tape` records QuantLib's +calculations as well as your own. + +### Formerly QuantLib-Risks + +This package was called QuantLib-Risks up to version 1.33.3. From 1.41, `QuantLib-Risks` +is a deprecated alias that installs `QuantLibAAD` and keeps `import QuantLib_Risks` working +with a `DeprecationWarning`. Please switch to `pip install QuantLibAAD` and +`import QuantLibAAD`. Anyone pinned to `QuantLib-Risks==1.33.3` must also pin `xad<2`. + ## Getting Help -For documentation and other resources, see https://auto-differentiation.github.io/quantlib-risks/python/ . +For documentation and other resources, see https://auto-differentiation.github.io/quantlib-aad/python/ . -If you have found an issue, want to report a bug, or have a feature request, please raise a [GitHub issue](https://github.com/auto-differentiation/QuantLib-Risks-Py/issues). +If you have found an issue, want to report a bug, or have a feature request, please raise a [GitHub issue](https://github.com/auto-differentiation/QuantLibAAD-Py/issues). ## Related Projects - XAD Comprehensive automatic differentiation in [Python](https://github.com/auto-differentiation/xad-py) and [C++](https://github.com/auto-differentiation/xad) -- QuantLib-Risks: Fast risk evaluations in [Python](https://github.com/auto-differentiation/QuantLib-Risks-Py) and [C++](https://github.com/auto-differentiation/QuantLib-Risks-Cpp) +- QuantLibAAD: Fast risk evaluations in [Python](https://github.com/auto-differentiation/QuantLibAAD-Py) and [C++](https://github.com/auto-differentiation/QuantLibAAD) ## Contributing @@ -43,7 +58,7 @@ Please also obey our [Code of Conduct](CODE_OF_CONDUCT.md) in all communication. ## Versioning This repository follows the QuantLib versions closely. With each new QuantLib release, -a new release of QuantLib-Risks is prepared with the same version number. +a new release of QuantLibAAD is prepared with the same version number. ## License diff --git a/SWIG/date_extra.i b/SWIG/date_extra.i index ffea7eb4..79b42d58 100644 --- a/SWIG/date_extra.i +++ b/SWIG/date_extra.i @@ -1,9 +1,9 @@ /****************************************************************************** - * Extra type converters for Dates that are needed with QuantLib-Risks in order + * Extra type converters for Dates that are needed with QuantLibAAD in order * to cover pair and vectors thereof. The functions are declared in * converters.hpp * - * This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + * This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled * for risk computation using automatic differentiation. It uses XAD, * a fast and comprehensive C++ library for automatic differentiation. * diff --git a/SWIG/fdm_extra.i b/SWIG/fdm_extra.i index 50a5873f..f48cb4ab 100644 --- a/SWIG/fdm_extra.i +++ b/SWIG/fdm_extra.i @@ -1,8 +1,8 @@ /****************************************************************************** * Extra type converters for vectors of tuples of Real, Real, bool - required - * for QuantLib-Risks. + * for QuantLibAAD. * - * This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + * This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled * for risk computation using automatic differentiation. It uses XAD, * a fast and comprehensive C++ library for automatic differentiation. * diff --git a/SWIG/inflation.i b/SWIG/inflation.i index b8641b28..029815b2 100644 --- a/SWIG/inflation.i +++ b/SWIG/inflation.i @@ -566,9 +566,9 @@ def __init__(self, quote, lag, maturity, calendar, bdc, dayCounter, index, obser __init__(ZeroCouponInflationSwapHelper self, QuoteHandle quote, Period lag, Date maturity, Calendar calendar, BusinessDayConvention bdc, DayCounter dayCounter, ext::shared_ptr< ZeroInflationIndex > const & index, CPI::InterpolationType observationInterpolation, YieldTermStructureHandle nominalTS) -> ZeroCouponInflationSwapHelper """ if nominalTS is None: - _QuantLib_Risks.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLib_Risks.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation)) + _QuantLibAAD.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLibAAD.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation)) else: - _QuantLib_Risks.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLib_Risks.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation, nominalTS)) + _QuantLibAAD.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLibAAD.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation, nominalTS)) %} #endif public: diff --git a/SWIG/patches/inflation.i.patch b/SWIG/patches/inflation.i.patch index 6899b17b..f08f19c3 100644 --- a/SWIG/patches/inflation.i.patch +++ b/SWIG/patches/inflation.i.patch @@ -6,10 +6,10 @@ diff --git a/SWIG/inflation.i b/SWIG/inflation.i """ if nominalTS is None: - _QuantLib.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLib.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation)) -+ _QuantLib_Risks.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLib_Risks.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation)) ++ _QuantLibAAD.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLibAAD.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation)) else: - _QuantLib.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLib.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation, nominalTS)) -+ _QuantLib_Risks.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLib_Risks.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation, nominalTS)) ++ _QuantLibAAD.ZeroCouponInflationSwapHelper_swiginit(self, _QuantLibAAD.new_ZeroCouponInflationSwapHelper(quote, lag, maturity, calendar, bdc, dayCounter, index, observationInterpolation, nominalTS)) %} #endif public: diff --git a/SWIG/patches/quantlib.i.patch b/SWIG/patches/quantlib.i.patch index cae2cce6..a20a1639 100644 --- a/SWIG/patches/quantlib.i.patch +++ b/SWIG/patches/quantlib.i.patch @@ -6,10 +6,10 @@ diff --git a/SWIG/quantlib.i b/SWIG/quantlib.i %module(directors="1") NQuantLibc #elif defined(SWIGJAVA) -%module(directors="1") QuantLib -+%module(directors="1") QuantLib_Risks ++%module(directors="1") QuantLibAAD #else -%module QuantLib -+%module QuantLib_Risks ++%module QuantLibAAD #endif %include exception.i diff --git a/SWIG/quantlib.i b/SWIG/quantlib.i index f1854968..b70a4962 100644 --- a/SWIG/quantlib.i +++ b/SWIG/quantlib.i @@ -21,9 +21,9 @@ #if defined(SWIGCSHARP) %module(directors="1") NQuantLibc #elif defined(SWIGJAVA) -%module(directors="1") QuantLib_Risks +%module(directors="1") QuantLibAAD #else -%module QuantLib_Risks +%module QuantLibAAD #endif %include exception.i diff --git a/SWIG/tape.i b/SWIG/tape.i index b0a2fc96..6d312827 100644 --- a/SWIG/tape.i +++ b/SWIG/tape.i @@ -1,7 +1,7 @@ /****************************************************************************** * Conversion of xad.adj_1st.Tape arguments to xad::Tape&. * - * This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + * This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled * for risk computation using automatic differentiation. It uses XAD, * a fast and comprehensive C++ library for automatic differentiation. * diff --git a/SWIG/vectors_extra.i b/SWIG/vectors_extra.i index 74b1447e..fd5821c7 100644 --- a/SWIG/vectors_extra.i +++ b/SWIG/vectors_extra.i @@ -1,7 +1,7 @@ /****************************************************************************** * Extra type converters for vectors of date/Real pairs. * - * This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled + * This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled * for risk computation using automatic differentiation. It uses XAD, * a fast and comprehensive C++ library for automatic differentiation. * diff --git a/binder/requirements.txt b/binder/requirements.txt index 480c016c..d9711e77 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,5 +1,5 @@ # Requirements for the example Python notebooks. Used by mybinder.org. -QuantLib-Risks +QuantLibAAD QuantLib jupyter jupytext diff --git a/cmake/QLRXad.cmake b/cmake/QLRXad.cmake index 67c715a5..9105f11e 100644 --- a/cmake/QLRXad.cmake +++ b/cmake/QLRXad.cmake @@ -1,6 +1,6 @@ ############################################################################## # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # diff --git a/pyproject.toml b/pyproject.toml index dd29b022..d5bddf80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ ############################################################################## # -# QuantLib-Risks - package and build configuration +# QuantLibAAD - package and build configuration # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # @@ -29,7 +29,7 @@ requires = ["scikit-build-core>=0.11", "swig>=4.4,<4.6", "xad>=2.1,<2.3"] build-backend = "scikit_build_core.build" [project] -name = "QuantLib-Risks" +name = "QuantLibAAD" # keep in sync with CMakeLists.txt version = "1.41.0" description = "Fast risks calculations in QuantLib" @@ -75,10 +75,10 @@ dependencies = ["xad>=2.1,<2.3"] [project.urls] Homepage = "https://auto-differentiation.github.io" -Repository = "https://github.com/auto-differentiation/QuantLib-Risks-Py" +Repository = "https://github.com/auto-differentiation/QuantLibAAD-Py" Documentation = "https://auto-differentiation.github.io/quantlib-risks/python/" -Download = "https://pypi.org/project/QuantLib-Risks/#files" -Tracker = "https://github.com/auto-differentiation/QuantLib-Risks-Py/issues" +Download = "https://pypi.org/project/QuantLibAAD/#files" +Tracker = "https://github.com/auto-differentiation/QuantLibAAD-Py/issues" [dependency-groups] test = ["pytest"] @@ -87,13 +87,14 @@ test = ["pytest"] minimum-version = "build-system.requires" cmake.version = ">=3.18" build.verbose = true -# the package is installed by CMake (Python/QuantLib_Risks/CMakeLists.txt) +# the package is installed by CMake (Python/QuantLibAAD/CMakeLists.txt) wheel.packages = [] install.components = ["python"] # submodule parts not needed to build sdist.exclude = [ ".github", "binder", + "shim", "build", "lib/QuantLib/Docs", "lib/QuantLib/Examples", diff --git a/shim/QuantLib_Risks/__init__.py b/shim/QuantLib_Risks/__init__.py new file mode 100644 index 00000000..d7554529 --- /dev/null +++ b/shim/QuantLib_Risks/__init__.py @@ -0,0 +1,19 @@ +"""Deprecated alias of QuantLibAAD.""" + +import sys +import warnings + +warnings.warn( + "QuantLib-Risks is now QuantLibAAD: pip install QuantLibAAD and import QuantLibAAD", + DeprecationWarning, + stacklevel=2, +) + +from QuantLibAAD import * +from QuantLibAAD import __version__, __hexversion__ +from QuantLibAAD import QuantLibAAD as QuantLib_Risks, _QuantLibAAD as _QuantLib_Risks + +sys.modules[__name__ + ".QuantLib_Risks"] = QuantLib_Risks +sys.modules[__name__ + "._QuantLib_Risks"] = _QuantLib_Risks + +del sys, warnings diff --git a/shim/README.md b/shim/README.md new file mode 100644 index 00000000..766559fe --- /dev/null +++ b/shim/README.md @@ -0,0 +1,15 @@ +# QuantLib-Risks is now QuantLibAAD + +This package has been renamed to [QuantLibAAD](https://pypi.org/project/QuantLibAAD). +`QuantLib-Risks` 1.41 only installs `QuantLibAAD` and keeps `import QuantLib_Risks` +working, with a `DeprecationWarning`. Please switch to: + +```bash +pip install QuantLibAAD +``` + +```python +import QuantLibAAD as ql +``` + +Anyone pinned to `QuantLib-Risks==1.33.3` must also pin `xad<2`. diff --git a/shim/pyproject.toml b/shim/pyproject.toml new file mode 100644 index 00000000..8589eaa5 --- /dev/null +++ b/shim/pyproject.toml @@ -0,0 +1,31 @@ +# QuantLib-Risks is now QuantLibAAD: this distribution only installs QuantLibAAD +# and keeps `import QuantLib_Risks` working, with a DeprecationWarning. + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "QuantLib-Risks" +# keep in sync with ../pyproject.toml +version = "1.41.0" +description = "Deprecated: QuantLib-Risks is now QuantLibAAD" +readme = "README.md" +requires-python = ">=3.10" +license = { text = "AGPL-3.0-or-later" } +authors = [ + { name = "Auto Differentiation Dev Team", email = "dev@auto-differentiation.com" }, +] +classifiers = [ + "Development Status :: 7 - Inactive", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + "Programming Language :: Python :: 3", +] +dependencies = ["QuantLibAAD==1.41.*"] + +[project.urls] +Homepage = "https://pypi.org/project/QuantLibAAD" +Repository = "https://github.com/auto-differentiation/QuantLibAAD-Py" + +[tool.hatch.build.targets.wheel] +packages = ["QuantLib_Risks"] diff --git a/tools/build-quantlib.cmake b/tools/build-quantlib.cmake index bfab1caf..51c04738 100644 --- a/tools/build-quantlib.cmake +++ b/tools/build-quantlib.cmake @@ -4,7 +4,7 @@ # # cmake -DPREFIX= [-DBUILD_DIR=] -P tools/build-quantlib.cmake # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. # diff --git a/tools/sync-swig.sh b/tools/sync-swig.sh index 482e20b7..bf58c014 100755 --- a/tools/sync-swig.sh +++ b/tools/sync-swig.sh @@ -11,7 +11,7 @@ # Without a checkout, is cloned from GitHub. The XAD-only files # (tape.i, date_extra.i, fdm_extra.i, vectors_extra.i) are kept as they are. # -# This file is part of QuantLib-Risks, a Python wrapper for QuantLib enabled +# This file is part of QuantLibAAD, a Python wrapper for QuantLib enabled # for risk computation using automatic differentiation. It uses XAD, # a fast and comprehensive C++ library for automatic differentiation. #