mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 11:53:57 +08:00
[bot] Update Python packages (#34140)
* Update Python packages * pin * fstring * this too --------- Co-authored-by: Vehicle Researcher <user@comma.ai> Co-authored-by: Maxime Desroches <desroches.maxime@gmail.com>
This commit is contained in:
Submodule msgq_repo updated: e621ce0763...434ed2312c
2
panda
2
panda
Submodule panda updated: 2fbf0c5ff8...c7cc2deaf0
@@ -31,6 +31,9 @@ dependencies = [
|
||||
# body / webrtcd
|
||||
"aiohttp",
|
||||
"aiortc",
|
||||
# aiortc does not put an upper bound on pyopenssl and is now incompatible
|
||||
# with the latest release
|
||||
"pyopenssl < 24.3.0",
|
||||
"pyaudio",
|
||||
|
||||
# panda
|
||||
@@ -239,6 +242,7 @@ exclude = [
|
||||
"cereal",
|
||||
"panda",
|
||||
"opendbc",
|
||||
"opendbc_repo",
|
||||
"rednose_repo",
|
||||
"tinygrad_repo",
|
||||
"teleoprtc",
|
||||
|
||||
@@ -37,7 +37,7 @@ for f in sorted(pyf):
|
||||
lns = len(src.split("\n"))
|
||||
tree = ast.parse(src)
|
||||
Analyzer().visit(tree)
|
||||
print("%5d %s %s" % (lns, f, xbit))
|
||||
print(f"{lns:5d} {f} {xbit}")
|
||||
if 'test' in f:
|
||||
testlns += lns
|
||||
elif f.startswith(('tools/', 'scripts/', 'selfdrive/debug')):
|
||||
@@ -47,8 +47,8 @@ for f in sorted(pyf):
|
||||
else:
|
||||
tlns += lns
|
||||
|
||||
print("%d lines of openpilot python" % tlns)
|
||||
print("%d lines of car ports" % carlns)
|
||||
print("%d lines of tools/scripts/debug" % scriptlns)
|
||||
print("%d lines of tests" % testlns)
|
||||
print(f"{tlns} lines of openpilot python")
|
||||
print(f"{carlns} lines of car ports")
|
||||
print(f"{scriptlns} lines of tools/scripts/debug")
|
||||
print(f"{testlns} lines of tests")
|
||||
#print(sorted(list(imps)))
|
||||
|
||||
@@ -16,9 +16,9 @@ def waste(core):
|
||||
j = 0
|
||||
while 1:
|
||||
if (i % 100) == 0:
|
||||
setproctitle("%3d: %8d" % (core, i))
|
||||
setproctitle(f"{core:3d}: {i:8d}")
|
||||
lt = time.monotonic()
|
||||
print("%3d: %8d %f %.2f" % (core, i, lt-st, j))
|
||||
print(f"{core:3d}: {i:8d} {lt-st:f} {j:.2f}")
|
||||
st = lt
|
||||
i += 1
|
||||
j = np.sum(np.matmul(m1, m2))
|
||||
|
||||
@@ -28,7 +28,7 @@ def can_printer(bus, max_msg, addr, ascii_decode):
|
||||
x = binascii.hexlify(msgs[_addr][-1]).decode('ascii')
|
||||
freq = len(msgs[_addr]) / (time.monotonic() - start)
|
||||
if max_msg is None or _addr < max_msg:
|
||||
dd += "%04X(%4d)(%6d)(%3dHz) %s %s\n" % (_addr, _addr, len(msgs[_addr]), freq, x.ljust(20), a)
|
||||
dd += f"{_addr:04X}({_addr:4d})({len(msgs[_addr]):6d})({freq:3}dHz) {x.ljust(20)} {a}\n"
|
||||
print(dd)
|
||||
lp = time.monotonic()
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ def get_fingerprint(lr):
|
||||
msgs[c.address] = len(c.dat)
|
||||
|
||||
# show CAN fingerprint
|
||||
fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items()))
|
||||
fingerprint = ', '.join(f"{v[0]}: {v[1]}" for v in sorted(msgs.items()))
|
||||
print(f"\nfound {len(msgs)} messages. CAN fingerprint:\n")
|
||||
print(fingerprint)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ while True:
|
||||
if c.src % 0x80 == 0 and c.address < 0x800 and c.address not in (0x7df, 0x7e0, 0x7e8):
|
||||
msgs[c.address] = len(c.dat)
|
||||
|
||||
fingerprint = ', '.join("%d: %d" % v for v in sorted(msgs.items()))
|
||||
fingerprint = ', '.join(f"{v[0]}: {v[1]}" for v in sorted(msgs.items()))
|
||||
|
||||
print(f"number of messages {len(msgs)}:")
|
||||
print(f"fingerprint {fingerprint}")
|
||||
|
||||
@@ -42,7 +42,7 @@ class TestAlerts:
|
||||
|
||||
for name, e in events.items():
|
||||
if not name.endswith("DEPRECATED"):
|
||||
fail_msg = "%s @%d not in EVENTS" % (name, e)
|
||||
fail_msg = f"{name} @{e} not in EVENTS"
|
||||
assert e in EVENTS.keys(), fail_msg
|
||||
|
||||
# ensure alert text doesn't exceed allowed width
|
||||
|
||||
@@ -21,7 +21,7 @@ class Pc(HardwareBase):
|
||||
print("uninstall")
|
||||
|
||||
def get_imei(self, slot):
|
||||
return "%015d" % random.randint(0, 1 << 32)
|
||||
return f"{random.randint(0, 1 << 32):015d}"
|
||||
|
||||
def get_serial(self):
|
||||
return "cccccccc"
|
||||
|
||||
@@ -323,8 +323,8 @@ class Tici(HardwareBase):
|
||||
os.system("sudo poweroff")
|
||||
|
||||
def get_thermal_config(self):
|
||||
return ThermalConfig(cpu=(["cpu%d-silver-usr" % i for i in range(4)] +
|
||||
["cpu%d-gold-usr" % i for i in range(4)], 1000),
|
||||
return ThermalConfig(cpu=([f"cpu{i}-silver-usr" for i in range(4)] +
|
||||
[f"cpu{i}-gold-usr" for i in range(4)], 1000),
|
||||
gpu=(("gpu0-usr", "gpu1-usr"), 1000),
|
||||
mem=("ddr-usr", 1000),
|
||||
bat=(None, 1),
|
||||
|
||||
@@ -273,7 +273,7 @@ def main() -> NoReturn:
|
||||
|
||||
(pending_msgs, log_outer_length), inner_log_packet = unpack_from('<BH', payload), payload[calcsize('<BH'):]
|
||||
if pending_msgs > 0:
|
||||
cloudlog.debug("have %d pending messages" % pending_msgs)
|
||||
cloudlog.debug(f"have {pending_msgs} pending messages")
|
||||
assert log_outer_length == len(inner_log_packet)
|
||||
|
||||
(log_inner_length, log_type, log_time), log_payload = unpack_from('<HHQ', inner_log_packet), inner_log_packet[calcsize('<HHQ'):]
|
||||
@@ -283,7 +283,7 @@ def main() -> NoReturn:
|
||||
continue
|
||||
|
||||
if DEBUG:
|
||||
print("%.4f: got log: %x len %d" % (time.time(), log_type, len(log_payload)))
|
||||
print(f"{time.time():.4f}: got log: {log_type} len {len(log_payload)}")
|
||||
|
||||
if log_type == LOG_GNSS_OEMDRE_MEASUREMENT_REPORT:
|
||||
msg = messaging.new_message('qcomGnss', valid=True)
|
||||
|
||||
@@ -322,7 +322,7 @@ def parse_struct(ss):
|
||||
cnt = int(nam.split("[")[1].split("]")[0])
|
||||
st += st[-1]*(cnt-1)
|
||||
for i in range(cnt):
|
||||
nams.append("%s[%d]" % (nam.split("[")[0], i))
|
||||
nams.append(f'{nam.split("[")[0]}[{i}]')
|
||||
else:
|
||||
nams.append(nam)
|
||||
return st, nams
|
||||
|
||||
@@ -13,7 +13,7 @@ if __name__ == "__main__":
|
||||
cnos = []
|
||||
for m in ug.measurementReport.measurements:
|
||||
cnos.append(m.cno)
|
||||
print("Sats: %d Accuracy: %.2f m cnos" % (ug.measurementReport.numMeas, gle.horizontalAccuracy), sorted(cnos))
|
||||
print(f"Sats: {ug.measurementReport.numMeas} Accuracy: {gle.horizontalAccuracy:.2f} m cnos", sorted(cnos))
|
||||
except Exception:
|
||||
pass
|
||||
sm.update()
|
||||
|
||||
@@ -101,9 +101,9 @@ def decoder(addr, vipc_server, vst, nvidia, W, H, debug=False):
|
||||
pc_latency = (time.monotonic()-time_q[0])*1000
|
||||
time_q = time_q[1:]
|
||||
if debug:
|
||||
print("%2d %4d %.3f %.3f roll %6.2f ms latency %6.2f ms + %6.2f ms + %6.2f ms = %6.2f ms"
|
||||
% (len(msgs), evta.idx.encodeId, evt.logMonoTime/1e9, evta.idx.timestampEof/1e6, frame_latency,
|
||||
process_latency, network_latency, pc_latency, process_latency+network_latency+pc_latency ), len(evta.data), sock_name)
|
||||
print(f"{len(msgs):2d} {evta.idx.encodeId:4d} {evt.logMonoTime/1e9:.3f} {evta.idx.timestampEof/1e6:.3f} \
|
||||
roll {frame_latency:6.2f} ms latency {process_latency:6.2f} ms + {network_latency:6.2f} ms + {pc_latency:6.2f} ms \
|
||||
= {process_latency+network_latency+pc_latency:6.2f} ms", len(evta.data), sock_name)
|
||||
|
||||
|
||||
class CompressedVipc:
|
||||
|
||||
@@ -168,9 +168,9 @@ def print_timestamps(timestamps, durations, start_times, relative):
|
||||
print(" "+service)
|
||||
events = timestamps[frame_id][service]
|
||||
for event, time in sorted(events, key = lambda x: x[1]):
|
||||
print(" "+'%-53s%-53s' %(event, str((time-t0)/1e6)))
|
||||
print(" "+f'{event:<53s}{str((time-t0)/1e6):<53s}')
|
||||
for event, time in durations[frame_id][service]:
|
||||
print(" "+'%-53s%-53s' %(event, str(time*1000)))
|
||||
print(" "+f'{event:<53s}{str(time*1000):<53s}')
|
||||
|
||||
def graph_timestamps(timestamps, start_times, end_times, relative, offset_services=False, title=""):
|
||||
plt.rcParams.update({'font.size': 18})
|
||||
|
||||
@@ -31,11 +31,11 @@ print("got api response")
|
||||
|
||||
segments = r.json()[camera]
|
||||
if segment >= len(segments):
|
||||
raise Exception("segment %d not found, got %d segments" % (segment, len(segments)))
|
||||
raise Exception(f"segment {segment} not found, got {len(segments)} segments")
|
||||
|
||||
fr = FrameReader(segments[segment])
|
||||
if frame >= fr.frame_count:
|
||||
raise Exception("frame %d not found, got %d frames" % (frame, fr.frame_count))
|
||||
raise Exception("frame {frame} not found, got {fr.frame_count} frames")
|
||||
|
||||
im = Image.fromarray(fr.get(frame, count=1, pix_fmt="rgb24")[0])
|
||||
fn = f"uxxx_{route.replace('|', '_')}_{segment}_{frame}.png"
|
||||
|
||||
@@ -133,8 +133,8 @@ def wheel_poll_thread(q: 'Queue[str]') -> NoReturn:
|
||||
button_name_list.append(btn_name)
|
||||
button_states[btn_name] = 0
|
||||
|
||||
print('%d axes found: %s' % (num_axes, ', '.join(axis_name_list)))
|
||||
print('%d buttons found: %s' % (num_buttons, ', '.join(button_name_list)))
|
||||
print(f'{num_axes} axes found: {", ".join(axis_name_list)}')
|
||||
print(f'{num_buttons} buttons found: {", ".join(button_name_list)}')
|
||||
|
||||
# Enable FF
|
||||
import evdev
|
||||
|
||||
Reference in New Issue
Block a user