mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 16:55:58 +08:00
process_replay: sort logs before comparing them (#28201)
* Sort logs before comparing them in process replay
* Simplify
old-commit-hash: 504768f922
This commit is contained in:
@@ -70,7 +70,10 @@ def compare_logs(log1, log2, ignore_fields=None, ignore_msgs=None, tolerance=Non
|
||||
field_tolerances = {}
|
||||
default_tolerance = EPSILON if tolerance is None else tolerance
|
||||
|
||||
log1, log2 = (list(filter(lambda m: m.which() not in ignore_msgs, log)) for log in (log1, log2))
|
||||
log1, log2 = (
|
||||
sorted((m for m in log if m.which() not in ignore_msgs), key=lambda m: (m.logMonoTime, m.which()))
|
||||
for log in (log1, log2)
|
||||
)
|
||||
|
||||
if len(log1) != len(log2):
|
||||
cnt1 = Counter(m.which() for m in log1)
|
||||
|
||||
Reference in New Issue
Block a user