pyquantlib 0.10.0__cp314-cp314-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pyquantlib/__init__.py ADDED
@@ -0,0 +1,41 @@
1
+ # pyquantlib/__init__.py
2
+
3
+ from .version import __version__ as __version__
4
+
5
+ try:
6
+ from . import _pyquantlib as _ql
7
+ from ._pyquantlib import * # noqa: F403
8
+ except ImportError as e:
9
+ raise ImportError(f"Failed to import PyQuantLib: {e}") from e
10
+
11
+ # base = _ql.base
12
+ # sys.modules['pyquantlib.base'] = _ql.base
13
+
14
+ QL_VERSION = _ql.QL_VERSION # QuantLib C++ version
15
+ QL_VERSION_HEX = _ql.QL_VERSION_HEX # QuantLib hex version for comparison
16
+ BOOST_VERSION = _ql.BOOST_VERSION # Boost version (compile-time integer)
17
+
18
+ # Export Settings as the singleton instance to allow direct property access:
19
+ # ql.Settings.evaluationDate = date # Works correctly
20
+ Settings = _ql.Settings.instance()
21
+
22
+ del _ql
23
+
24
+ # Builder wrapper functions (shadow C++ classes with Pythonic kwargs API)
25
+ from .builders import MakeCapFloor as MakeCapFloor # noqa: E402, F811
26
+ from .builders import MakeFdHestonVanillaEngine as MakeFdHestonVanillaEngine # noqa: E402, F811
27
+ from .builders import MakeOIS as MakeOIS # noqa: E402, F811
28
+ from .builders import MakeSchedule as MakeSchedule # noqa: E402, F811
29
+ from .builders import MakeSwaption as MakeSwaption # noqa: E402, F811
30
+ from .builders import MakeVanillaSwap as MakeVanillaSwap # noqa: E402, F811
31
+ from .builders import MakeYoYInflationCapFloor as MakeYoYInflationCapFloor # noqa: E402, F811
32
+
33
+
34
+ # Helpers for readable Boost version
35
+ def boost_version_tuple() -> tuple[int, int, int]:
36
+ v = BOOST_VERSION
37
+ return v // 100000, (v // 100) % 1000, v % 100
38
+
39
+
40
+ def boost_version_str() -> str:
41
+ return ".".join(map(str, boost_version_tuple()))