Exemple #1
0
    def test_window_fraction_is_fraction(self):
        window_fraction = 2

        with pytest.raises(ValueError):
            find_outliers(np.zeros(5), window_fraction=window_fraction)
Exemple #2
0
 def test_data_can_be_1d(self):
     find_outliers(np.zeros(5))
Exemple #3
0
 def test_threshold_not_none(self):
     with pytest.raises(TypeError):
         find_outliers(np.zeros(5), None)
Exemple #4
0
 def test_threshold_not_inf(self):
     with pytest.raises(ValueError):
         find_outliers(np.zeros(5), np.inf)
Exemple #5
0
 def test_threshold_not_negative(self):
     with pytest.raises(ValueError):
         find_outliers(np.zeros(5), -1)
Exemple #6
0
    def test_cannot_send_empty(self):
        with pytest.raises(ValueError):
            find_outliers([])

        with pytest.raises(ValueError):
            find_outliers(np.array([]))
Exemple #7
0
 def test_cannot_send_none(self):
     with pytest.raises(Exception):
         find_outliers(None)
Exemple #8
0
 def test_data_can_be_linear(self):
     find_outliers(np.linspace(0, 5, 100))
Exemple #9
0
    def test_window_fraction_is_fraction(self, window_fraction):
        if 0 <= window_fraction <= 1:
            return

        with pytest.raises(ValueError):
            find_outliers(np.zeros(5), window_fraction=window_fraction)