Skip to content

Commit

Permalink
MAINT: address PYI066
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Dec 18, 2024
1 parent 0550e2f commit a667657
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
6 changes: 3 additions & 3 deletions src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
from ampform.sympy import PoolSum, determine_indices
from ampform.sympy._array_expressions import ArraySum

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import (
ItemsView,
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/helicity/decay.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

from typing import Literal

if sys.version_info < (3, 10):
from typing_extensions import TypeGuard
else:
if sys.version_info >= (3, 10):
from typing import TypeGuard
else:
from typing_extensions import TypeGuard


@frozen
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/helicity/naming.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
group_by_spin_projection,
)

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import Iterable

Expand Down
6 changes: 3 additions & 3 deletions src/ampform/kinematics/lorentz.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
)
from ampform.sympy.math import ComplexSqrt

if sys.version_info < (3, 10):
from typing_extensions import TypeAlias
else:
if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias
if TYPE_CHECKING:
from qrules.topology import Topology
from sympy.printing.latex import LatexPrinter
Expand Down
10 changes: 5 additions & 5 deletions src/ampform/sympy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
make_commutative, # pyright: ignore[reportUnusedImport] # noqa: F401
)

if sys.version_info < (3, 11):
from typing_extensions import Self
else:
if sys.version_info >= (3, 11):
from typing import Self
if sys.version_info < (3, 12):
from typing_extensions import override
else:
from typing_extensions import Self
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import Iterable, Sequence

Expand Down
10 changes: 5 additions & 5 deletions src/ampform/sympy/_array_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
get_shape,
)

if sys.version_info < (3, 11):
from typing_extensions import Self
else:
if sys.version_info >= (3, 11):
from typing import Self
if sys.version_info < (3, 12):
from typing_extensions import override
else:
from typing_extensions import Self
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from collections.abc import Iterable

Expand Down
12 changes: 6 additions & 6 deletions src/ampform/sympy/_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@
from sympy.core.basic import _aresame # noqa: PLC2701
from sympy.utilities.exceptions import SymPyDeprecationWarning

if sys.version_info < (3, 11):
from typing_extensions import dataclass_transform
else:
if sys.version_info >= (3, 11):
from typing import dataclass_transform
else:
from typing_extensions import dataclass_transform

if TYPE_CHECKING:
from collections.abc import Hashable, Iterable

from sympy.printing.latex import LatexPrinter

if sys.version_info < (3, 11):
from typing_extensions import ParamSpec, Unpack
else:
if sys.version_info >= (3, 11):
from typing import ParamSpec, Unpack
else:
from typing_extensions import ParamSpec, Unpack

H = TypeVar("H", bound=Hashable)
P = ParamSpec("P")
Expand Down
6 changes: 3 additions & 3 deletions src/ampform/sympy/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@

import sympy as sp

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from sympy.printing.latex import LatexPrinter

Expand Down
6 changes: 3 additions & 3 deletions src/ampform/sympy/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

from ampform.sympy import NumPyPrintable

if sys.version_info < (3, 12):
from typing_extensions import override
else:
if sys.version_info >= (3, 12):
from typing import override
else:
from typing_extensions import override
if TYPE_CHECKING:
from sympy.printing.numpy import NumPyPrinter
from sympy.printing.printer import Printer
Expand Down

0 comments on commit a667657

Please sign in to comment.