From a389dc6240ba744418152855cb093367c33c06dd Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Wed, 10 Jun 2020 10:31:13 -0700 Subject: [PATCH] daemon: improve type hinting for WayPoint --- daemon/core/location/mobility.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/daemon/core/location/mobility.py b/daemon/core/location/mobility.py index 87cd7141..e9efa16b 100644 --- a/daemon/core/location/mobility.py +++ b/daemon/core/location/mobility.py @@ -539,7 +539,7 @@ class WayPoint: self, _time: float, node_id: int, - coords: Tuple[float, float, float], + coords: Tuple[float, float, Optional[float]], speed: float, ) -> None: """ @@ -552,7 +552,7 @@ class WayPoint: """ self.time: float = _time 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 def __eq__(self, other: "WayPoint") -> bool: @@ -737,7 +737,13 @@ class WayPointMobility(WirelessModel): self.session.mobility.updatewlans(moved, moved_netifs) 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: """ Waypoints are pushed to a heapq, sorted by time.