[python-dtcwt] 61/497: get coverage of transform2d up to 100%

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:05:49 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit 4a35c31cdb7ed1a5afa54239a6e94ff836348834
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Thu Aug 8 01:02:26 2013 +0100

    get coverage of transform2d up to 100%
---
 tests/testifm2.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/tests/testifm2.py b/tests/testifm2.py
index 68ff2e6..551cac2 100644
--- a/tests/testifm2.py
+++ b/tests/testifm2.py
@@ -3,14 +3,12 @@ from nose.tools import raises
 from nose.plugins.attrib import attr
 
 import numpy as np
-from dtcwt import dtwavexfm2, dtwaveifm2
+from dtcwt import dtwavexfm2, dtwaveifm2, biort, qshift
 
 def setup():
-    global lena, lena_crop, Yl, Yh, Yl_crop, Yh_crop
+    global lena, lena_crop
     lena = np.load(os.path.join(os.path.dirname(__file__), 'lena.npz'))['lena']
     lena_crop = lena[:233, :301]
-    Yl, Yh = dtwavexfm2(lena)
-    Yl_crop, Yh_crop = dtwavexfm2(lena_crop)
 
 def test_lena_loaded():
     assert lena.shape == (512, 512)
@@ -21,13 +19,23 @@ def test_lena_loaded():
 @attr('transform')
 def test_reconstruct():
     # Reconstruction up to tolerance
+    Yl, Yh = dtwavexfm2(lena)
     lena_recon = dtwaveifm2(Yl, Yh)
     assert np.all(np.abs(lena_recon - lena) < 1e-3)
 
 @attr('transform')
-def test_reconstruct_ctop():
+def test_reconstruct_crop():
     # Reconstruction up to tolerance
+    Yl_crop, Yh_crop = dtwavexfm2(lena_crop)
     lena_recon = dtwaveifm2(Yl_crop, Yh_crop)[:lena_crop.shape[0], :lena_crop.shape[1]]
     assert np.all(np.abs(lena_recon - lena_crop) < 1e-3)
 
+ at attr('transform')
+def test_reconstruct_custom_filter():
+    # Reconstruction up to tolerance
+    Yl, Yh = dtwavexfm2(lena, 4, biort('legall'), qshift('qshift_06'))
+    lena_recon = dtwaveifm2(Yl, Yh, biort('legall'), qshift('qshift_06'))
+    assert np.all(np.abs(lena_recon - lena) < 1e-3)
+
+
 # vim:sw=4:sts=4:et

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list