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