Skip to content

Commit 8c5fde5

Browse files
authored
Fix pyright issues in pathing (#1809)
1 parent 2583a89 commit 8c5fde5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arcade/paths.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Classic A-star algorithm for path finding.
33
"""
44
from typing import (
5+
cast,
56
List,
67
Optional,
78
Set,
@@ -168,7 +169,7 @@ def _AStarSearch(start: Point, end: Point, graph: _AStarGraph) -> Optional[List[
168169
current = None
169170
current_fscore = None
170171
for pos in sorted(open_vertices):
171-
if current is None or F[pos] < current_fscore:
172+
if current is None or F[pos] < current_fscore: # type: ignore
172173
current_fscore = F[pos]
173174
current = pos
174175

@@ -319,7 +320,7 @@ def astar_calculate_path(start_point: Point,
319320
# Currently 'result' is in grid locations. We need to convert them to pixel
320321
# locations.
321322
revised_result = [_expand(p, grid_size) for p in result]
322-
return revised_result
323+
return cast(List[Point], revised_result)
323324

324325

325326
def has_line_of_sight(observer: Point,

0 commit comments

Comments
 (0)