Esempio n. 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
Esempio n. 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.')
Esempio n. 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, )
Esempio n. 4
0
def test_output_size():
    x = boot.draw_bs_reps(np.array([1, 2, 3, 4]), size=6)
    assert x.shape == (6, )
Esempio n. 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.')
Esempio n. 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.')
Esempio n. 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.')