Esempio n. 1
0
def test_w2k_finite_water_depth():
    vals = w2k(range(4), h=20)[0]
    true_vals = np.array([0., 0.10503601, 0.40774726, 0.91743119])
    assert ((np.abs(vals - true_vals) < 1e-7).all())
Esempio n. 2
0
def test_w2k_infinite_water_depth():
    vals = w2k(range(4))[0]
    true_vals = np.array([0., 0.1019368, 0.4077472, 0.91743119])
    assert ((np.abs(vals - true_vals) < 1e-7).all())
Esempio n. 3
0
def test_w2k_finite_water_depth():
    vals = w2k(range(4),h=20)[0]
    true_vals = np.array([ 0.        ,  0.10503601,  0.40774726,  0.91743119])
    assert((np.abs(vals-true_vals)<1e-7).all())
Esempio n. 4
0
def test_w2k_infinite_water_depth():
    vals = w2k(range(4))[0]
    true_vals = np.array([ 0.        ,  0.1019368 ,  0.4077472 ,  0.91743119])
    assert((np.abs(vals-true_vals)<1e-7).all())
Esempio n. 5
0
def test_w2k_finite_water_depth_with_negative_w():
    vals, k2 = w2k(-np.arange(4), h=20)
    true_vals = -1 * np.array([0., 0.10503601, 0.40774726, 0.91743119])
    assert_allclose(vals, true_vals)
    assert_allclose(k2, 0)
Esempio n. 6
0
def test_w2k_infinite_water_depth_with_negative_w():
    vals, k2 = w2k(-np.arange(4))
    true_vals = -1 * np.array([0., 0.1019368, 0.4077472, 0.91743119])
    assert_allclose(vals, true_vals)
    assert_allclose(k2, 0)