Skip to content

Commit

Permalink
fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
xoolive committed Sep 26, 2024
1 parent ae248ed commit 99ac82c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/traffic/core/airspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import json
from functools import cached_property, lru_cache
from itertools import pairwise
from pathlib import Path
from typing import (
TYPE_CHECKING,
Expand Down Expand Up @@ -410,7 +411,7 @@ def unary_union_with_alt(polyalt: AirspaceList) -> AirspaceList:
simple_union = unary_union([p for p, *_ in polyalt])
return [ExtrudedPolygon(simple_union, float("-inf"), float("inf"))]
results: List[ExtrudedPolygon] = []
for low, up in zip(slices, slices[1:]):
for low, up in pairwise(slices):
matched_poly = [
p
for (p, low_, up_) in polyalt
Expand Down
3 changes: 2 additions & 1 deletion tests/test_flightplan.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from itertools import pairwise
from typing import List, cast

import pandas as pd
Expand Down Expand Up @@ -180,7 +181,7 @@ def test_flightplan() -> None:
assert any(isinstance(p, SpeedLevel) for p in elts)
# we can parse everything
assert all(p is not None for p in elts)
for cur_, next_ in zip(elts, elts[1:]):
for cur_, next_ in pairwise(elts):
# never two consecutive airways
assert not isinstance(cur_, Airway) or not isinstance(next_, Airway)
# never two consecutive navaids (coordinate points are ok though)
Expand Down

0 comments on commit 99ac82c

Please sign in to comment.