diff --git a/pyproject.toml b/pyproject.toml index e8f3acbc6..25cbcdad0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,23 +33,28 @@ classifiers = [ "Programming Language :: Python :: Implementation :: PyPy", ] -[project.optional-dependencies] -dev = [ - # testing - "pandas>=3.0,<4.0", +[dependency-groups] +test = [ + # "pandas>=3.0,<4.0", "pytest>=9.0,<10.0", "coverage>=7.6.1,<8.0", - # style/linting +] +lint = [ "ruff>=0.6.3,<1.0", +] +typing = [ "mypy>=1.13,<1.20", "pandas-stubs>2.0,<4.0", - # doc building - "sphinx>=9.0,<10.0", +] +docs = [ + "sphinx>=9.0,<10.0; python_version >= '3.11'", "sphinx-automodapi>=0.16.0,<1.0", "sphinxcontrib-googleanalytics>=0.4,<1.0", "sphinx-tabs>=3.4,<4.0", "pydata-sphinx-theme>=0.15.4,<1.0", "nbsphinx>=0.9.5,<1.0", +] +gui = [ "jupyterlab>=4.0,<5.0", "pickleshare>=0.7.5,<1.0", ] diff --git a/python/rateslib/_spec_loader.py b/python/rateslib/_spec_loader.py index 4fa883e24..442d64ec2 100644 --- a/python/rateslib/_spec_loader.py +++ b/python/rateslib/_spec_loader.py @@ -737,7 +737,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "us_gb", }, "us_gbi": { @@ -753,7 +753,7 @@ "index_method": "daily", "index_lag": 3, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "us_gb", }, "us_corp": { @@ -767,7 +767,7 @@ "convention": "30u360", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "us_corp", }, "us_muni": { @@ -781,7 +781,7 @@ "convention": "30u360", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "us_muni", }, "us_gb_tsy": { @@ -795,7 +795,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "us_gb_tsy", }, "uk_gb": { @@ -809,9 +809,23 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 7, + "ex_div": "-7b", "calc_mode": "uk_gb", }, + "au_gb": { + "frequency": "s", + "stub": "longfront", + "eom": False, + "modifier": "none", + "calendar": "syd", + "payment_lag": 0, + "currency": "aud", + "convention": "actacticma", + "payment_lag_exchange": 0, + "settle": 2, + "ex_div": "-8d", + "calc_mode": "au_gb", + }, "nz_gb": { "frequency": "s", "stub": "shortfront", @@ -823,9 +837,23 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 8, + "ex_div": "-8b", "calc_mode": "nz_gb", }, + "cn_gb": { + "frequency": "s", + "stub": "shortfront", + "eom": False, + "modifier": "none", + "calendar": "bjs", + "payment_lag": 0, + "currency": "cny", + "convention": "actacticma", + "payment_lag_exchange": 0, + "settle": 1, + "ex_div": "-1b", + "calc_mode": "cn_gb", + }, "de_gb": { "frequency": "a", "stub": "longfront", @@ -837,7 +865,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "de_gb", }, "fr_gb": { @@ -851,7 +879,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "fr_gb", }, "nl_gb": { @@ -865,7 +893,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "nl_gb", }, "it_gb": { @@ -879,7 +907,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "it_gb", }, "ch_gb": { @@ -893,7 +921,7 @@ "convention": "30e360", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "ch_gb", }, "se_gb": { @@ -907,7 +935,7 @@ "convention": "actacticma", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 5, + "ex_div": "-5b", "calc_mode": "se_gb", }, "no_gb": { @@ -921,7 +949,7 @@ "convention": "actacticma_stub365f", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "no_gb", }, "ca_gb": { @@ -935,7 +963,7 @@ "convention": "actacticma_stub365f", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "ca_gb", }, "ca_gbi": { @@ -951,7 +979,7 @@ "index_method": "daily", "index_lag": 3, "settle": 1, - "ex_div": 1, + "ex_div": "-1b", "calc_mode": "ca_gb", }, "us_gbb": { @@ -963,7 +991,7 @@ "convention": "act360", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 0, + "ex_div": "0b", "calc_mode": "us_gbb", }, "se_gbb": { @@ -975,7 +1003,7 @@ "convention": "act360", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 0, + "ex_div": "0b", "calc_mode": "se_gbb", }, "no_gbb": { @@ -987,7 +1015,7 @@ "convention": "act365f", "payment_lag_exchange": 0, "settle": 2, - "ex_div": 0, + "ex_div": "0b", "calc_mode": "no_gbb", }, "uk_gbb": { @@ -999,7 +1027,7 @@ "convention": "act365f", "payment_lag_exchange": 0, "settle": 1, - "ex_div": 0, + "ex_div": "0b", "calc_mode": "uk_gbb", }, "uk_gbi": { @@ -1015,7 +1043,7 @@ "index_method": "daily", "index_lag": 3, "settle": 1, - "ex_div": 7, + "ex_div": "-7b", "calc_mode": "uk_gb", }, "sek_fra3": { @@ -1101,7 +1129,7 @@ "spread_compound_method": "none_simple", "fixing_method": "rfr_observation_shift(5)", "settle": 1, - "ex_div": 1, + "ex_div": "1b", }, "usd_stir": { "frequency": "q", diff --git a/python/tests/test_ir_volatility.py b/python/tests/test_ir_volatility.py index e1befd0f9..6000ff090 100644 --- a/python/tests/test_ir_volatility.py +++ b/python/tests/test_ir_volatility.py @@ -11,7 +11,7 @@ from datetime import datetime as dt from itertools import combinations, product - +import sys import numpy as np import pytest from matplotlib import pyplot as plt @@ -2201,7 +2201,10 @@ def test_convert_to_new_shift(self, vol, k, shift, tgt, expected): ) assert abs(result - expected) < 1e-9 - +@pytest.mark.skipif( + sys.version_info[:2] == (3, 10), + reason="This test is incompatible with Python 3.10" +) class TestCookbokReplicators: def test_z_ir_vol_risks(self): curve = Curve( diff --git a/python/tests/test_solver.py b/python/tests/test_solver.py index 59c6ecb3f..dbf3e6769 100644 --- a/python/tests/test_solver.py +++ b/python/tests/test_solver.py @@ -12,7 +12,7 @@ import warnings from datetime import datetime as dt from math import cos, exp - +import sys import numpy as np import pytest from numpy.testing import assert_allclose @@ -20,8 +20,7 @@ from pandas.errors import PerformanceWarning from pandas.testing import assert_frame_equal, assert_series_equal from rateslib import add_tenor, calendars, default_context -from rateslib.curves import CompositeCurve, Curve, LineCurve, MultiCsaCurve, index_left -from rateslib.default import NoInput +from rateslib.curves import CompositeCurve, Curve, LineCurve, MultiCsaCurve from rateslib.dual import Dual, Dual2, Variable, gradient, ift_1dim, newton_1dim, newton_ndim from rateslib.fx import FXForwards, FXRates from rateslib.instruments import ( @@ -440,6 +439,10 @@ def test_grad_s_vT(self) -> None: class TestDocs: + @pytest.mark.skipif( + sys.version_info[:2] == (3, 10), + reason="This test is incompatible with Python 3.10" + ) def test_external_system_replicator(self): TODAY = dt(2026, 3, 23) SPOT = calendars.get("nyc").lag_bus_days(TODAY, 2, False)