From 15a96d530098efc7e3c6ed066d129672de9b8e27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Orieux?= Date: Fri, 6 Dec 2013 14:11:03 +0100 Subject: [PATCH] Fix python3 test and real values image. --- skimage/restoration/tests/test_restoration.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/skimage/restoration/tests/test_restoration.py b/skimage/restoration/tests/test_restoration.py index ce1a27a4..915640af 100644 --- a/skimage/restoration/tests/test_restoration.py +++ b/skimage/restoration/tests/test_restoration.py @@ -26,7 +26,9 @@ def test_wiener(): deconvolved = restoration.wiener(data, otf, 0.05, reg=laplacian, is_real=False) - np.testing.assert_allclose(deconvolved, np.load(path)) + np.testing.assert_allclose(np.real(deconvolved), + np.load(path), + rtol=1e-3) def test_unsupervised_wiener(): @@ -42,11 +44,13 @@ def test_unsupervised_wiener(): _, laplacian = uft.laplacian(2, data.shape) otf = uft.ir2tf(psf, data.shape, is_real=False) np.random.seed(0) - deconvolved = np.real(restoration.unsupervised_wiener( + deconvolved = restoration.unsupervised_wiener( data, otf, reg=laplacian, is_real=False, - user_params={"callback": lambda x: None})[0]) + user_params={"callback": lambda x: None})[0] path = pjoin(dirname(abspath(__file__)), 'camera_unsup2.npy') - np.testing.assert_allclose(deconvolved, np.load(path)) + np.testing.assert_allclose(np.real(deconvolved), + np.load(path), + rtol=1e-3) def test_richardson_lucy():