Enable PL in ruff

This commit is contained in:
Alexander Hess 2026-11-30 22:28:12 +01:00
commit 99dda74a9e
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
5 changed files with 13 additions and 8 deletions

View file

@ -147,9 +147,9 @@ class Path(meta.Base):
paths = []
# We consider all 2-tuples of `Address`es. The symmetric graph is ...
for first, second in itertools.combinations(addresses, 2):
for pair in itertools.combinations(addresses, 2):
# ... implicitly enforced by a precedence constraint for the `.id`s.
first, second = (first, second) if first.id < second.id else (second, first)
first, second = sorted(pair, key=lambda address: address.id)
# If there is no `Path` object in the database ...
path = (

View file

@ -94,6 +94,9 @@ class Location:
"""The UTM zone of the location as the zone number and the band."""
return self._zone, self._band
# Explicitly unhashable, the default for classes defining only `__eq__()`
__hash__ = None # type: ignore[assignment]
def __eq__(self, other: object) -> bool:
"""Check if two `Location` objects are the same location."""
if not isinstance(other, Location):

View file

@ -33,7 +33,7 @@ def predict(
"""
# Initialize R only if it is actually used.
# For example, the nox session "ci-tests-fast" does not use it.
from velofy import init_r # noqa:F401
from velofy import init_r # noqa:F401,PLC0415
# Re-seed R every time it is used to ensure reproducibility.
robjects.r("set.seed(42)")

View file

@ -153,7 +153,7 @@ def stl( # noqa:C901,PLR0912,PLR0913,PLR0915
# Initialize R only if it is actually used.
# For example, the nox session "ci-tests-fast" does not use it.
from velofy import init_r # noqa:F401
from velofy import init_r # noqa:F401,PLC0415
# Re-seed R every time it is used to ensure reproducibility.
robjects.r("set.seed(42)")

View file

@ -34,7 +34,7 @@ def predict(
"""
# Initialize R only if it is actually used.
# For example, the nox session "ci-tests-fast" does not use it.
from velofy import init_r # noqa:F401
from velofy import init_r # noqa:F401,PLC0415
# Re-seed R every time it is used to ensure reproducibility.
robjects.r("set.seed(42)")