示例#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)
示例#2
0
 def test_data_can_be_1d(self):
     find_outliers(np.zeros(5))
示例#3
0
 def test_threshold_not_none(self):
     with pytest.raises(TypeError):
         find_outliers(np.zeros(5), None)
示例#4
0
 def test_threshold_not_inf(self):
     with pytest.raises(ValueError):
         find_outliers(np.zeros(5), np.inf)
示例#5
0
 def test_threshold_not_negative(self):
     with pytest.raises(ValueError):
         find_outliers(np.zeros(5), -1)
示例#6
0
    def test_cannot_send_empty(self):
        with pytest.raises(ValueError):
            find_outliers([])

        with pytest.raises(ValueError):
            find_outliers(np.array([]))
示例#7
0
 def test_cannot_send_none(self):
     with pytest.raises(Exception):
         find_outliers(None)
示例#8
0
 def test_data_can_be_linear(self):
     find_outliers(np.linspace(0, 5, 100))
示例#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)