Пример #1
0
def test_no_func():
    x = boot.draw_bs_reps(np.array([1, 2, 3, 4]), func=None, size=2)
    assert x.shape[0] == 8
Пример #2
0
def test_2D_ndarray():
    with pytest.raises(RuntimeError) as excinfo:
        boot.draw_bs_reps(np.array([[1, 2, 3, 4], [5, 6, 7, 8]]))
    excinfo.match('data must be one dimensional.')
Пример #3
0
def test_diff_func():
    x = boot.draw_bs_reps(np.array([1, 2, 3, 4]), func=np.std, size=2)
    assert x.shape == (2, )
Пример #4
0
def test_output_size():
    x = boot.draw_bs_reps(np.array([1, 2, 3, 4]), size=6)
    assert x.shape == (6, )
Пример #5
0
def test_array_inf():
    with pytest.raises(RuntimeError) as excinfo:
        boot.draw_bs_reps(np.array([1, 2, 3, np.inf]))
    excinfo.match(
        'data contains inf values. change or remove these values to proceed.')
Пример #6
0
def test_list_dtype():
    with pytest.raises(RuntimeError) as excinfo:
        boot.draw_bs_reps([1, 2, 3, 4])
    excinfo.match('data must be of type numpy array.')
Пример #7
0
def test_string_dtype():
    with pytest.raises(RuntimeError) as excinfo:
        boot.draw_bs_reps('np.array[[1,2,3,4],[5]]')
    excinfo.match('data must be of type numpy array.')