From e56153e868471b2cd67b018a7b248ebb9166ce89 Mon Sep 17 00:00:00 2001 From: Per A Brodtkorb Date: Sun, 15 Oct 2017 23:19:19 +0200 Subject: [PATCH] Updated tests. --- wafo/spectrum/tests/test_specdata1d.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wafo/spectrum/tests/test_specdata1d.py b/wafo/spectrum/tests/test_specdata1d.py index 645c1fa..70139ce 100644 --- a/wafo/spectrum/tests/test_specdata1d.py +++ b/wafo/spectrum/tests/test_specdata1d.py @@ -39,11 +39,11 @@ class TestSpectrumHs7(unittest.TestCase): def test_to_t_pdf(self): f = self.S.to_t_pdf(pdef='Tc', paramt=(0, 10, 51), speed=7, seed=100) - vals = ['%2.3f' % val for val in f.data[:10]] - truevals = ['0.000', '0.014', '0.027', '0.040', - '0.050', '0.059', '0.067', '0.073', '0.077', '0.082'] - for t, v in zip(truevals, vals): - assert(t == v) + + truth = [0.0, 0.014068786046738972, 0.027384724577108947, 0.039538002584522454, + 0.050183061144017056, 0.05948762020247726, 0.0669017098497974, + 0.07251637759775977, 0.07729759248201125, 0.08151306823047058] + assert_array_almost_equal(f.data[:10], truth, decimal=1e-3) # estimated error bounds vals = ['%2.4f' % val for val in f.err[:10]]