From 229395e15b1bd771f1855306f69714cbc692e12e Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 30 Jan 2021 16:53:48 -0800 Subject: [PATCH] fix static analysis checks after mypy update --- selfdrive/debug/internal/test_paramsd.py | 1 + selfdrive/debug/live_cpu_and_temp.py | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/selfdrive/debug/internal/test_paramsd.py b/selfdrive/debug/internal/test_paramsd.py index fa8c31ef..3d8e422c 100755 --- a/selfdrive/debug/internal/test_paramsd.py +++ b/selfdrive/debug/internal/test_paramsd.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 # pylint: skip-file +# type: ignore import numpy as np import math diff --git a/selfdrive/debug/live_cpu_and_temp.py b/selfdrive/debug/live_cpu_and_temp.py index 8322e910..6c55a408 100755 --- a/selfdrive/debug/live_cpu_and_temp.py +++ b/selfdrive/debug/live_cpu_and_temp.py @@ -1,9 +1,8 @@ #!/usr/bin/env python3 import argparse -import numpy as np - from cereal.messaging import SubMaster +from common.numpy_fast import mean def cputime_total(ct): @@ -49,7 +48,7 @@ if __name__ == "__main__": if sm.updated['thermal']: t = sm['thermal'] - last_temp = np.mean(t.cpu) + last_temp = mean(t.cpu) last_mem = t.memUsedPercent if sm.updated['procLog']: @@ -72,7 +71,7 @@ if __name__ == "__main__": total_times = total_times_new[:] busy_times = busy_times_new[:] - print("CPU %.2f%% - RAM: %.2f - Temp %.2f" % (100. * np.mean(cores), last_mem, last_temp)) + print("CPU %.2f%% - RAM: %.2f - Temp %.2f" % (100. * mean(cores), last_mem, last_temp)) if args.cpu and prev_proclog is not None: procs = {}