daemon: improve type hinting for WayPoint

This commit is contained in:
Blake Harnden 2020-06-10 10:31:13 -07:00
parent 784c4d2419
commit a389dc6240

View file

@ -539,7 +539,7 @@ class WayPoint:
self, self,
_time: float, _time: float,
node_id: int, node_id: int,
coords: Tuple[float, float, float], coords: Tuple[float, float, Optional[float]],
speed: float, speed: float,
) -> None: ) -> None:
""" """
@ -552,7 +552,7 @@ class WayPoint:
""" """
self.time: float = _time self.time: float = _time
self.node_id: int = node_id self.node_id: int = node_id
self.coords: Tuple[float, float, float] = coords self.coords: Tuple[float, float, Optional[float]] = coords
self.speed: float = speed self.speed: float = speed
def __eq__(self, other: "WayPoint") -> bool: def __eq__(self, other: "WayPoint") -> bool:
@ -737,7 +737,13 @@ class WayPointMobility(WirelessModel):
self.session.mobility.updatewlans(moved, moved_netifs) self.session.mobility.updatewlans(moved, moved_netifs)
def addwaypoint( def addwaypoint(
self, _time: float, nodenum: int, x: float, y: float, z: float, speed: float self,
_time: float,
nodenum: int,
x: float,
y: float,
z: Optional[float],
speed: float,
) -> None: ) -> None:
""" """
Waypoints are pushed to a heapq, sorted by time. Waypoints are pushed to a heapq, sorted by time.