Run mypy commit hook (#1591)

* run mypy commit hook

* fix mypy errors
old-commit-hash: 3d08dcc3b27936cb14c0eae63605be9a6c077380
This commit is contained in:
Willem Melching
2020-05-28 15:05:04 -07:00
committed by GitHub
parent 9aa70600dd
commit 2b60ee9531
39 changed files with 183 additions and 207 deletions
+2 -1
View File
@@ -5,9 +5,10 @@ from http.server import HTTPServer, BaseHTTPRequestHandler
from urllib.parse import urlencode, parse_qs
from tools.lib.api import CommaApi, APIError
from tools.lib.auth_config import set_token
from typing import Dict, Any
class ClientRedirectServer(HTTPServer):
query_params = {}
query_params: Dict[str, Any] = {}
class ClientRedirectHandler(BaseHTTPRequestHandler):
def do_GET(self):
+4 -3
View File
@@ -1,15 +1,16 @@
from collections import namedtuple
from typing import Any, Dict, Tuple
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pygame
from tools.lib.lazy_property import lazy_property
from selfdrive.config import UIParams as UP
from selfdrive.config import RADAR_TO_CAMERA
from selfdrive.config import UIParams as UP
from selfdrive.controls.lib.lane_planner import (compute_path_pinv,
model_polyfit)
from tools.lib.lazy_property import lazy_property
RED = (255, 0, 0)
GREEN = (0, 255, 0)
@@ -34,7 +35,7 @@ METER_WIDTH = 20
ModelUIData = namedtuple("ModelUIData", ["cpath", "lpath", "rpath", "lead", "lead_future"])
_COLOR_CACHE = {}
_COLOR_CACHE : Dict[Tuple[int, int, int], Any] = {}
def find_color(lidar_surface, color):
if color in _COLOR_CACHE:
return _COLOR_CACHE[color]
+1 -1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# type: ignore
import sys
import matplotlib.pyplot as plt
import numpy as np
@@ -78,4 +79,3 @@ if __name__ == "__main__":
# just a bit of wait to avoid 100% CPU usage
time.sleep(0.001)
+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# type: ignore
import time
import math
import atexit
+4 -3
View File
@@ -1,8 +1,9 @@
import sys
import termios
import time
from termios import (BRKINT, VMIN, CS8, CSIZE, ECHO, ICANON, ICRNL, IEXTEN,
INPCK, ISIG, ISTRIP, IXON, PARENB, VTIME)
from termios import (BRKINT, CS8, CSIZE, ECHO, ICANON, ICRNL, IEXTEN, INPCK,
ISIG, ISTRIP, IXON, PARENB, VMIN, VTIME)
from typing import Any
# Indexes for termios list.
IFLAG = 0
@@ -53,7 +54,7 @@ def test(q):
if __name__ == '__main__':
from multiprocessing import Process, Queue
q = Queue()
q : Any = Queue()
p = Process(target=test, args=(q,))
p.daemon = True
p.start()