Refactor routing internals and archive retry benchmarks

This commit is contained in:
Jan Petykiewicz 2026-11-26 19:58:46 -08:00
commit ea5cfe7f31

View file

@ -4,7 +4,18 @@ from typing import Any
from hypothesis import given, strategies as st
import pytest
from inire.geometry.primitives import Port
from inire.geometry.primitives import Port, port_local_coordinates, rotate_cardinal
@pytest.mark.parametrize(
("heading", "expected"),
[(0, (3.5, 7.25)), (90, (7.25, -3.5)), (180, (-3.5, -7.25)), (270, (-7.25, 3.5))],
)
def test_port_local_coordinates_preserve_fractional_points(heading, expected) -> None:
origin = Port(10, -4, heading)
local = port_local_coordinates(origin, 13.5, 3.25)
assert local == expected
assert rotate_cardinal(*local, heading) == (3.5, 7.25)
@st.composite