1
0
forked from IQ.Lvbs/IQ.Pilot

IQ.Pilot Prebuilt Release @ ab07000

This commit is contained in:
IQ.Lvbs history cleanup
2026-08-22 23:42:42 -05:00
commit 9f9c9a70cc
3729 changed files with 778697 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
from collections import deque
from openpilot.system.ui.lib.scroll_panel2 import weighted_velocity
def test_weighted_velocity_empty():
assert weighted_velocity(deque()) == 0.0
def test_weighted_velocity_single():
assert weighted_velocity(deque([120.0])) == 120.0
def test_weighted_velocity_two_samples():
assert weighted_velocity(deque([100.0, 200.0])) == 130.0
def test_weighted_velocity_three_samples_biases_older():
velocity = weighted_velocity(deque([300.0, 180.0, 20.0]))
assert velocity == 244.0