Skip to content

Commit 4b98358

Browse files
committed
Fix doctest.
1 parent c83683d commit 4b98358

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

smarts/core/sumo_road_network.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
def pairwise(iterable):
5252
"""Generates pairs of neighboring elements.
5353
>>> list(pairwise('ABCDEFG'))
54-
[(AB), (BC), (CD), (DE), (EF), (FG)]
54+
[('A','B'), ('B','C'), ('C','D'), ('D','E'), ('E','F'), ('F','G')]
5555
"""
5656
a, b = itertools.tee(iterable)
5757
next(b, None)
@@ -135,7 +135,7 @@ def nearest_roads(self, point: Point, radius: float):
135135
edges: List[sumolib.net.edge.Edge] = self._graph.getEdges()
136136
if self._rtree_roads is None:
137137
self._rtree_roads = self._init_rtree(edges)
138-
near_roads: List[SumoRoadNetwork.Road] = []
138+
near_roads: List[RoadMap.Road] = []
139139
for i in self._rtree_roads.intersection((x - r, y - r, x + r, y + r)):
140140
near_roads.append(self.road_by_id(edges[i].getID()))
141141
return near_roads
@@ -458,12 +458,12 @@ def get_distance(self, point: Point, radius: float) -> float:
458458
@overload
459459
def get_distance(
460460
self, point: Point, radius: float, get_offset: bool
461-
) -> Tuple[float, float]:
461+
) -> Tuple[float, Optional[float]]:
462462
...
463463

464464
def get_distance(
465465
self, point: Point, radius: float, get_offset=...
466-
) -> Union[float, Tuple[float, float]]:
466+
) -> Union[float, Tuple[float, Optional[float]]]:
467467
"""Get the distance on the lane from the given point within the given radius.
468468
Specifying to get the offset returns the offset value.
469469
"""
@@ -969,7 +969,7 @@ def shape(
969969
bline = buffered_shape(line, 0.0)
970970
return line if bline.is_empty else bline
971971

972-
def road_by_id(self, road_id: str) -> RoadMap.Road:
972+
def road_by_id(self, road_id: str) -> SumoRoadNetwork.Road:
973973
road = self._roads.get(road_id)
974974
if road:
975975
return road

0 commit comments

Comments
 (0)