add mypy unit test (#621)

* add mypy unit test

* add mypy unit test

* add mypy unit test
This commit is contained in:
Atsushi Sakai
2022-01-09 00:01:29 +09:00
committed by GitHub
parent a13ef29dc4
commit 82d97cef94
5 changed files with 58 additions and 37 deletions

View File

@@ -64,15 +64,15 @@ class DStarLite:
for x, y in zip(ox, oy)]
self.start = Node(0, 0)
self.goal = Node(0, 0)
self.U = list()
self.U = list() # type: ignore
self.km = 0.0
self.kold = 0.0
self.rhs = list()
self.g = list()
self.detected_obstacles = list()
self.rhs = list() # type: ignore
self.g = list() # type: ignore
self.detected_obstacles = list() # type: ignore
if show_animation:
self.detected_obstacles_for_plotting_x = list()
self.detected_obstacles_for_plotting_y = list()
self.detected_obstacles_for_plotting_x = list() # type: ignore
self.detected_obstacles_for_plotting_y = list() # type: ignore
def create_grid(self, val: float):
grid = list()
@@ -248,7 +248,7 @@ class DStarLite:
return False
return True
def display_path(self, path: list, colour: str, alpha: int = 1):
def display_path(self, path: list, colour: str, alpha: float = 1.0):
px = [(node.x + self.x_min_world) for node in path]
py = [(node.y + self.y_min_world) for node in path]
drawing = plt.plot(px, py, colour, alpha=alpha)