def test_irregular_points(self): irregular_points = np.array([2, 5, 1, 4]) exp_avdiff = np.mean(np.diff(irregular_points)) result_avdiff, result = points_step(irregular_points) self.assertEqual(exp_avdiff, result_avdiff) self.assertFalse(result)
def test_regular_points(self): regular_points = np.arange(5) exp_avdiff = np.mean(np.diff(regular_points)) result_avdiff, result = points_step(regular_points) self.assertEqual(exp_avdiff, result_avdiff) self.assertTrue(result)
def test_single_point(self): lone_point = np.array([4]) result_avdiff, result = points_step(lone_point) self.assertTrue(np.isnan(result_avdiff)) self.assertTrue(result)
def test_no_points(self): no_points = np.array([]) result_avdiff, result = points_step(no_points) self.assertTrue(np.isnan(result_avdiff)) self.assertTrue(result)