trim down

This commit is contained in:
Jan Petykiewicz 2026-03-29 01:26:22 -07:00
commit 4c2d5051cd

View file

@ -15,8 +15,8 @@ def port_strategy(draw: Any) -> Port:
def test_port_snapping() -> None:
p = Port(0.123456, 0.654321, 90)
assert p.x == 0.123
assert p.y == 0.654
assert p.x == 0
assert p.y == 1
@given(p=port_strategy())
@ -38,14 +38,13 @@ def test_port_transform_invariants(p: Port) -> None:
)
def test_translate_snapping(p: Port, dx: float, dy: float) -> None:
p_trans = translate_port(p, dx, dy)
# Check that snapped result is indeed multiple of GRID_SNAP_UM (0.001 um = 1nm)
assert abs(p_trans.x * 1000 - round(p_trans.x * 1000)) < 1e-6
assert abs(p_trans.y * 1000 - round(p_trans.y * 1000)) < 1e-6
assert isinstance(p_trans.x, int)
assert isinstance(p_trans.y, int)
def test_orientation_normalization() -> None:
p = Port(0, 0, 360)
assert p.orientation == 0.0
assert p.orientation == 0
p2 = Port(0, 0, -90)
assert p2.orientation == 270.0
assert p2.orientation == 270