Esempio n. 1
0
 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)
Esempio n. 2
0
 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)
Esempio n. 3
0
 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)
Esempio n. 4
0
 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)
Esempio n. 5
0
 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)
Esempio n. 6
0
 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)