예제 #1
0
 def test_speed(self):
     x_distorted = 1.01 * self.x - 2
     signal = interpolate_signal(self.mixture_signal, self.x, x_distorted,
                                 0, 0)
     f = partial(self.solver.solve, signal=signal)
     time = timeit.timeit(f, number=50)
     self.assertLess(time, 1)
예제 #2
0
 def test_slope_and_offset_error_should_pass(self) -> None:
     x_distorted = 1.01 * self.x - 2
     signal = interpolate_signal(self.mixture_signal, self.x, x_distorted,
                                 0, 0)
     self.run_test(signal)
예제 #3
0
 def test_quadratic_error_should_pass(self) -> None:
     x_distorted = 0.01 * self.x**2 + 1.01 * self.x + 2
     signal = interpolate_signal(self.mixture_signal, self.x, x_distorted,
                                 0, 0)
     self.run_test(signal)