|
51 | 51 | def pairwise(iterable):
|
52 | 52 | """Generates pairs of neighboring elements.
|
53 | 53 | >>> list(pairwise('ABCDEFG'))
|
54 |
| - [(AB), (BC), (CD), (DE), (EF), (FG)] |
| 54 | + [('A','B'), ('B','C'), ('C','D'), ('D','E'), ('E','F'), ('F','G')] |
55 | 55 | """
|
56 | 56 | a, b = itertools.tee(iterable)
|
57 | 57 | next(b, None)
|
@@ -135,7 +135,7 @@ def nearest_roads(self, point: Point, radius: float):
|
135 | 135 | edges: List[sumolib.net.edge.Edge] = self._graph.getEdges()
|
136 | 136 | if self._rtree_roads is None:
|
137 | 137 | self._rtree_roads = self._init_rtree(edges)
|
138 |
| - near_roads: List[SumoRoadNetwork.Road] = [] |
| 138 | + near_roads: List[RoadMap.Road] = [] |
139 | 139 | for i in self._rtree_roads.intersection((x - r, y - r, x + r, y + r)):
|
140 | 140 | near_roads.append(self.road_by_id(edges[i].getID()))
|
141 | 141 | return near_roads
|
@@ -458,12 +458,12 @@ def get_distance(self, point: Point, radius: float) -> float:
|
458 | 458 | @overload
|
459 | 459 | def get_distance(
|
460 | 460 | self, point: Point, radius: float, get_offset: bool
|
461 |
| - ) -> Tuple[float, float]: |
| 461 | + ) -> Tuple[float, Optional[float]]: |
462 | 462 | ...
|
463 | 463 |
|
464 | 464 | def get_distance(
|
465 | 465 | self, point: Point, radius: float, get_offset=...
|
466 |
| - ) -> Union[float, Tuple[float, float]]: |
| 466 | + ) -> Union[float, Tuple[float, Optional[float]]]: |
467 | 467 | """Get the distance on the lane from the given point within the given radius.
|
468 | 468 | Specifying to get the offset returns the offset value.
|
469 | 469 | """
|
@@ -969,7 +969,7 @@ def shape(
|
969 | 969 | bline = buffered_shape(line, 0.0)
|
970 | 970 | return line if bline.is_empty else bline
|
971 | 971 |
|
972 |
| - def road_by_id(self, road_id: str) -> RoadMap.Road: |
| 972 | + def road_by_id(self, road_id: str) -> SumoRoadNetwork.Road: |
973 | 973 | road = self._roads.get(road_id)
|
974 | 974 | if road:
|
975 | 975 | return road
|
|
0 commit comments