Skip to content

Commit e43f66c

Browse files
MAINT: drop Python 3.8 support due to EOL (#143)
1 parent 58030fd commit e43f66c

File tree

12 files changed

+35
-270
lines changed

12 files changed

+35
-270
lines changed

.constraints/py3.8.txt

Lines changed: 0 additions & 245 deletions
This file was deleted.

docs/conf.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@
4040
"ampform_dpd.decay.StateIDTemplate": ("obj", "ampform_dpd.decay.StateID"),
4141
"ampform_dpd.io.serialization.dynamics.T": "typing.TypeVar",
4242
"DecayNode": ("obj", "ampform_dpd.decay.DecayNode"),
43+
"EdgeType": "typing.TypeVar",
4344
"FinalState": ("obj", "ampform_dpd.decay.FinalState"),
4445
"FinalStateID": ("obj", "ampform_dpd.decay.FinalStateID"),
4546
"FrozenTransition": "qrules.topology.FrozenTransition",
4647
"InitialStateID": ("obj", "ampform_dpd.decay.InitialStateID"),
4748
"Literal[-1, 1]": "typing.Literal",
4849
"Literal[(-1, 1)]": "typing.Literal",
4950
"Node": ("obj", "ampform_dpd.io.serialization.format.Node"),
51+
"NodeType": "typing.TypeVar",
5052
"ParameterValue": ("obj", "tensorwaves.interface.ParameterValue"),
5153
"ParametrizedBackendFunction": "tensorwaves.function.ParametrizedBackendFunction",
5254
"PoolSum": "ampform.sympy.PoolSum",
@@ -172,7 +174,7 @@
172174
html_title = REPO_TITLE
173175
intersphinx_mapping = {
174176
"IPython": (f"https://ipython.readthedocs.io/en/{pin('IPython')}", None),
175-
"ampform": (f"https://ampform.readthedocs.io/en/{pin('ampform')}", None),
177+
"ampform": (f"https://ampform.readthedocs.io/{pin('ampform')}", None),
176178
"attrs": (f"https://www.attrs.org/en/{pin('attrs')}", None),
177179
"compwa": ("https://compwa.github.io", None),
178180
"graphviz": ("https://graphviz.readthedocs.io/en/stable", None),
@@ -181,17 +183,14 @@
181183
"matplotlib": (f"https://matplotlib.org/{pin('matplotlib')}", None),
182184
"numpy": (f"https://numpy.org/doc/{pin_minor('numpy')}", None),
183185
"python": ("https://docs.python.org/3", None),
184-
"qrules": (f"https://qrules.readthedocs.io/en/{pin('qrules')}", None),
186+
"qrules": (f"https://qrules.readthedocs.io/{pin('qrules')}", None),
185187
"sympy": ("https://docs.sympy.org/latest", None),
186-
"tensorwaves": (
187-
f"https://tensorwaves.readthedocs.io/en/{pin('tensorwaves')}",
188-
None,
189-
),
188+
"tensorwaves": (f"https://tensorwaves.readthedocs.io/{pin('tensorwaves')}", None),
190189
}
191190
linkcheck_anchors = False
192191
linkcheck_ignore = [
193-
"https://github.com/ComPWA/polarimetry",
194-
"https://journals.aps.org/prd/pdf/10.1103/PhysRevD.101.034033#page=9",
192+
"https://doi.org/10.1103",
193+
"https://journals.aps.org/prd",
195194
]
196195
myst_enable_extensions = [
197196
"amsmath",

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ classifiers = [
1818
"Programming Language :: Python :: 3.10",
1919
"Programming Language :: Python :: 3.11",
2020
"Programming Language :: Python :: 3.12",
21-
"Programming Language :: Python :: 3.8",
2221
"Programming Language :: Python :: 3.9",
2322
"Programming Language :: Python",
2423
"Topic :: Scientific/Engineering :: Physics",
@@ -38,7 +37,7 @@ description = "Symbolic expressions for Dalitz-Plot Decomposition"
3837
dynamic = ["version"]
3938
license = {file = "LICENSE"}
4039
name = "ampform-dpd"
41-
requires-python = ">=3.8"
40+
requires-python = ">=3.9"
4241

4342
[project.optional-dependencies]
4443
dev = [

src/ampform_dpd/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from collections import abc
6-
from functools import lru_cache
6+
from functools import cache
77
from itertools import product
88
from typing import Any, Literal, Protocol
99
from warnings import warn
@@ -289,7 +289,7 @@ def _create_coupling_symbol(
289289
return H[resonance, interaction.L, interaction.S]
290290

291291

292-
@lru_cache(maxsize=None)
292+
@cache
293293
def _get_coupling_base(
294294
helicity_coupling: bool, typ: Literal["production", "decay"]
295295
) -> sp.IndexedBase:
@@ -331,7 +331,7 @@ def _formulate_clebsch_gordan_factors(
331331
return sqrt_factor * cg_ll * cg_ss
332332

333333

334-
@lru_cache(maxsize=None)
334+
@cache
335335
def _generate_amplitude_index_bases() -> dict[FinalStateID, sp.IndexedBase]:
336336
return dict(enumerate(sp.symbols(R"A^(1:4)", cls=sp.IndexedBase), 1)) # type:ignore[arg-type]
337337

src/ampform_dpd/_attrs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, Iterable, SupportsFloat
5+
from typing import TYPE_CHECKING, SupportsFloat
66

77
import sympy as sp
88

99
if TYPE_CHECKING:
10+
from collections.abc import Iterable
11+
1012
from attrs import Attribute
1113

1214
from ampform_dpd.decay import LSCoupling, ThreeBodyDecayChain

src/ampform_dpd/_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _get_python_hash_seed() -> int | None:
8080
return None
8181

8282

83-
@functools.lru_cache(maxsize=None) # warn once
83+
@functools.cache # warn once
8484
def _warn_about_unsafe_hash() -> None:
8585
message = """
8686
PYTHONHASHSEED has not been set. For faster and safer hashing of SymPy expressions,

src/ampform_dpd/adapter/qrules.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from collections import abc, defaultdict
66
from functools import singledispatch
77
from pathlib import Path
8-
from typing import Any, Iterable, NoReturn, TypeVar, overload
8+
from typing import TYPE_CHECKING, Any, NoReturn, TypeVar, overload
99

1010
import attrs
1111
import qrules
@@ -24,6 +24,9 @@
2424
ThreeBodyDecayChain,
2525
)
2626

27+
if TYPE_CHECKING:
28+
from collections.abc import Iterable
29+
2730
_LOGGER = logging.getLogger(__name__)
2831

2932

0 commit comments

Comments
 (0)