remove mypy ignore from a few scripts

This commit is contained in:
Adeeb Shihadeh
2022-06-30 15:36:40 -07:00
parent 8b32e1b060
commit 11b5d51da6
3 changed files with 12 additions and 8 deletions
+7 -4
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
# type: ignore
import argparse
import numpy as np
from collections import defaultdict, deque
from typing import DefaultDict, Deque
from common.realtime import sec_since_boot
import cereal.messaging as messaging
@@ -19,8 +19,8 @@ if __name__ == "__main__":
socket_names = args.socket
sockets = {}
rcv_times = defaultdict(lambda: deque(maxlen=100))
valids = defaultdict(lambda: deque(maxlen=100))
rcv_times: DefaultDict[str, Deque[float]] = defaultdict(lambda: deque(maxlen=100))
valids: DefaultDict[str, Deque[bool]] = defaultdict(lambda: deque(maxlen=100))
t = sec_since_boot()
for name in socket_names:
@@ -31,6 +31,9 @@ if __name__ == "__main__":
while True:
for socket in poller.poll(100):
msg = messaging.recv_one(socket)
if msg is None:
continue
name = msg.which()
t = sec_since_boot()
+2 -2
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# type: ignore
from typing import Dict
import cereal.messaging as messaging
from cereal.services import service_list
@@ -10,7 +10,7 @@ TO_CHECK = ['carState']
if __name__ == "__main__":
sm = messaging.SubMaster(TO_CHECK)
prev_t = {}
prev_t: Dict[str, float] = {}
while True:
sm.update()
+3 -2
View File
@@ -1,14 +1,15 @@
#!/usr/bin/env python3
# type: ignore
import sys
import time
import numpy as np
from typing import DefaultDict, Deque
from collections import defaultdict, deque
import cereal.messaging as messaging
socks = {s: messaging.sub_sock(s, conflate=False) for s in sys.argv[1:]}
ts = defaultdict(lambda: deque(maxlen=100))
ts: DefaultDict[str, Deque[float]] = defaultdict(lambda: deque(maxlen=100))
if __name__ == "__main__":
while True: