def test_removes_broken_values(self): shifts = [0.1, 0.1, 0.1, 9001, 0.1, 0.1, 0.1] smooth = running_median(shifts, 5) self.assertEqual(smooth, [0.1] * 7)
def test_removes_broken_values(self): shifts = [0.1, 0.1, 0.1, 9001, 0.1, 0.1, 0.1] smooth = sushi.running_median(shifts, 5) self.assertEqual(smooth, [0.1] * 7)
def test_does_no_touch_border_values(self): shifts = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] smooth = running_median(shifts, 5) self.assertEqual(shifts, smooth)