diff --git a/wafo/gaussian.py b/wafo/gaussian.py index 67c7a08..81457dc 100644 --- a/wafo/gaussian.py +++ b/wafo/gaussian.py @@ -112,7 +112,7 @@ class Rind(object): >>> val, err, terr = rind(Sc,m,Blo,Bup,indI, xc, nt=0) >>> np.allclose(val, 0.05494076, rtol=1e-2) True - >>> err < 1e-3, terr< 1e-7 + >>> err < 1e-3, terr< 1e-7 True, True Compute expectation E( X1^{+}*X2^{+} ) with random diff --git a/wafo/objects.py b/wafo/objects.py index 2fba80c..bba1a17 100644 --- a/wafo/objects.py +++ b/wafo/objects.py @@ -1592,16 +1592,24 @@ class TimeSeries(PlotData): >>> import wafo.objects as wo >>> x = wd.sea() >>> ts = wo.mat2timeseries(x) + >>> true_SH = [ + ... [[ 0.01186982, 0.04852534], [ 0.69, 0.86]], + ... [[ 0.02918363, 0.06385979], [ 0.69, 0.86]], + ... [[ 0.27797411, 0.33585743], [ 0.69, 0.86]], + ... [[ 0.60835634, 0.60930197], [ 0.42, 0.78]], + ... [[ 0.60835634, 0.60930197], [ 0.42, 0.78]], + ... [[ 0.10140867, 0.06141156], [ 0.42, 0.78]], + ... [[ 0.01821413, 0.01236672], [ 0.42, 0.78]]] >>> for i in range(-3,4): ... S, H = ts.wave_height_steepness(method=i) - ... print(S[:2],H[:2]) - [ 0.01186982 0.04852534]), [ 0.69, 0.86] - [ 0.02918363, 0.06385979]) [ 0.69, 0.86] - [ 0.27797411, 0.33585743]) [ 0.69, 0.86] - [ 0.60835634, 0.60930197]) [ 0.42, 0.78] - [ 0.60835634, 0.60930197]) [ 0.42, 0.78] - [ 0.10140867, 0.06141156]) [ 0.42, 0.78] - [ 0.01821413, 0.01236672]) [ 0.42, 0.78] + ... np.allclose((S[:2],H[:2]), true_SH[i+3]) + True + True + True + True + True + True + True import pylab as plt h = plt.plot(S,H,'.') diff --git a/wafo/tests/test_misc.py b/wafo/tests/test_misc.py index 4df73fa..2fa28af 100644 --- a/wafo/tests/test_misc.py +++ b/wafo/tests/test_misc.py @@ -583,7 +583,8 @@ class TestPiecewise(TestCase): x = np.linspace(-2, 2, 5) X, Y = np.meshgrid(x, x) vals = piecewise([X * Y < -0.5, X * Y > 0.5], - [lambda x, y: -x * y, lambda x, y: x * y, np.nan], (X, Y)) + [lambda x, y: -x * y, lambda x, y: x * y, np.nan], + (X, Y)) nan = np.nan assert_array_equal(vals, [[4., 2., nan, 2., 4.], [2., 1., nan, 1., 2.], diff --git a/wafo/transform/estimation.py b/wafo/transform/estimation.py index 6c7dc43..e6665ef 100644 --- a/wafo/transform/estimation.py +++ b/wafo/transform/estimation.py @@ -397,8 +397,8 @@ class TransformEstimator(object): 141 >>> int(g0emp.dist2gauss()*100)>17000 True - >>> int(g0.dist2gauss()*100) - 93 + >>> int(g0.dist2gauss()*100) > 90 + True >>> int(g1.dist2gauss()*100) 66 >>> int(g2.dist2gauss()*100)