[python-dtcwt] 62/497: get coverage of transform1d 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 a21884844bdad6dc241355e32bcc021da35cbc7b
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Thu Aug 8 01:07:23 2013 +0100

    get coverage of transform1d to 100%
---
 tests/testxfm1.py | 32 ++++++++++++++++++++++++++++++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/tests/testxfm1.py b/tests/testxfm1.py
index 740647a..24f945e 100644
--- a/tests/testxfm1.py
+++ b/tests/testxfm1.py
@@ -3,12 +3,40 @@ from nose.tools import raises
 from nose.plugins.attrib import attr
 
 import numpy as np
-from dtcwt import dtwavexfm
+from dtcwt import dtwavexfm, dtwaveifm, biort, qshift
 
 @attr('transform')
 def test_simple():
     vec = np.random.rand(630)
-    Yl, Yh = dtwavexfm(vec)
+    Yl, Yh = dtwavexfm(vec, 3)
+    assert len(Yh) == 3
+
+ at attr('transform')
+def test_simple_with_no_levels():
+    vec = np.random.rand(630)
+    Yl, Yh = dtwavexfm(vec, 0)
+    assert len(Yh) == 0
+
+ at attr('transform')
+def test_simple_with_scale():
+    vec = np.random.rand(630)
+    Yl, Yh, Yscale = dtwavexfm(vec, 3, include_scale=True)
+    assert len(Yh) == 3
+    assert len(Yscale) == 3
+
+ at attr('transform')
+def test_simple_with_scale_and_no_levels():
+    vec = np.random.rand(630)
+    Yl, Yh, Yscale = dtwavexfm(vec, 0, include_scale=True)
+    assert len(Yh) == 0
+    assert len(Yscale) == 0
+
+ at attr('transform')
+def test_simple_custom_filter():
+    vec = np.random.rand(630)
+    Yl, Yh = dtwavexfm(vec, 4, biort('legall'), qshift('qshift_06'))
+    vec_recon = dtwaveifm(Yl, Yh, biort('legall'), qshift('qshift_06'))
+    assert np.max(np.abs(vec_recon - vec)) < 1e-8
 
 @attr('transform')
 def test_single_level():

-- 
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