linter fixes
This commit is contained in:
parent
e2c91076f7
commit
1849075b11
1 changed files with 152 additions and 104 deletions
|
|
@ -1,7 +1,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
from typing import Literal
|
||||
from typing import TYPE_CHECKING, Literal
|
||||
|
||||
import numpy
|
||||
from shapely.affinity import rotate as shapely_rotate
|
||||
|
|
@ -13,6 +13,9 @@ from inire.constants import TOLERANCE_ANGULAR
|
|||
from inire.seeds import Bend90Seed, PathSegmentSeed, SBendSeed, StraightSeed
|
||||
from .primitives import Port, rotation_matrix2
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Sequence
|
||||
|
||||
|
||||
MoveKind = Literal["straight", "bend90", "sbend"]
|
||||
BendCollisionModelName = Literal["arc", "bbox", "clipped_bbox"]
|
||||
|
|
@ -27,14 +30,14 @@ def _normalize_length(value: float) -> float:
|
|||
@dataclass(frozen=True, slots=True)
|
||||
class ComponentResult:
|
||||
start_port: Port
|
||||
collision_geometry: tuple[Polygon, ...]
|
||||
collision_geometry: Sequence[Polygon]
|
||||
end_port: Port
|
||||
length: float
|
||||
move_type: MoveKind
|
||||
move_spec: PathSegmentSeed
|
||||
physical_geometry: tuple[Polygon, ...]
|
||||
dilated_collision_geometry: tuple[Polygon, ...]
|
||||
dilated_physical_geometry: tuple[Polygon, ...]
|
||||
physical_geometry: Sequence[Polygon]
|
||||
dilated_collision_geometry: Sequence[Polygon]
|
||||
dilated_physical_geometry: Sequence[Polygon]
|
||||
_bounds: tuple[tuple[float, float, float, float], ...] = field(init=False, repr=False)
|
||||
_total_bounds: tuple[float, float, float, float] = field(init=False, repr=False)
|
||||
_dilated_bounds: tuple[tuple[float, float, float, float], ...] = field(init=False, repr=False)
|
||||
|
|
@ -146,7 +149,7 @@ def _clip_bbox_legacy(
|
|||
minx, miny, maxx, maxy = arc_poly.bounds
|
||||
bbox_poly = box(minx, miny, maxx, maxy)
|
||||
shrink = min(clip_margin, max(radius, width))
|
||||
return bbox_poly.buffer(-shrink, join_style=2) if shrink > 0 else bbox_poly
|
||||
return bbox_poly.buffer(-shrink, join_style="mitre") if shrink > 0 else bbox_poly
|
||||
|
||||
|
||||
def _clip_bbox_polygonal(cxy: tuple[float, float], radius: float, width: float, ts: tuple[float, float]) -> Polygon:
|
||||
|
|
|
|||
Loading…
Reference in a new issue