Exemplo n.º 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)
Exemplo n.º 2
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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
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)
Exemplo n.º 7
0
 def test_strictly_increasing(self):
     data = np.linspace(1, 2., 10)
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1),
                      VALLEY)
Exemplo n.º 8
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)
Exemplo n.º 9
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)
Exemplo n.º 10
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)
Exemplo n.º 11
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)
Exemplo n.º 12
0
 def test_strictly_increasing(self):
     data = np.linspace(1, 2., 10)
     self.assertEqual(zigzag._identify_initial_pivot(data, 0.1, -0.1),
                      VALLEY)