Beispiel #1
0
    def test_decreasing_under_threshold_kinked(self):
        data = np.array([1.0, 1.01, 0.99])

        self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1), PEAK)
Beispiel #2
0
 def test_strictly_decreasing_under_threshold(self):
     data = np.linspace(1, 0.99, 10)
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1), PEAK)
Beispiel #3
0
 def test_decreasing_kinked(self):
     data = np.array([1.0, 1.01, 0.9])
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1),
                      VALLEY)
Beispiel #4
0
 def test_increasing_under_threshold_kinked(self):
     data = np.array([1.0, 0.99, 1.02])
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1),
                      VALLEY)
Beispiel #5
0
 def test_increasing_kinked(self):
     data = np.array([1.0, 0.99, 1.1])
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1), PEAK)
Beispiel #6
0
 def test_strictly_increasing(self):
     data = np.linspace(1, 2., 10)
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1),
                      VALLEY)