[python-dtcwt] 14/38: Merge branch 'master' into tox-refactor
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Mar 8 11:39:18 UTC 2016
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to branch master
in repository python-dtcwt.
commit c83acda486934cb114bd16a865594af17145da3b
Merge: a1b8c6c 0e28cf3
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date: Tue Aug 4 16:48:01 2015 +0100
Merge branch 'master' into tox-refactor
Conflicts:
tests/testagainstmatlab.py
tests/testcoldfilt.py
tests/testcolifilt.py
tests/testopenclcoldfilt.py
tests/testopenclcolifilt.py
tests/testopenclxfm2.py
tests/testxfm2.py
docs/2dtransform.rst | 20 ++++----
docs/conf.py | 4 ++
docs/variant.rst | 18 ++++----
dtcwt/plotting.py | 10 ++--
examples/resampling_highpass_coefficients.py | 44 +++++++++---------
matlab/gen_verif.m | 24 +++++-----
matlab/lena.mat | Bin 261700 -> 0 bytes
matlab/mandrill.mat | Bin 0 -> 341820 bytes
matlab/verif_m_to_npz.py | 44 +++++++++---------
scripts/benchmark_opencl.py | 44 +++++++++---------
tests/datasets.py | 6 +--
tests/lena.npz | Bin 279987 -> 0 bytes
tests/mandrill.npz | Bin 0 -> 341854 bytes
tests/qbgn.npz | Bin 652796 -> 652802 bytes
tests/testagainstmatlab.py | 46 +++++++++----------
tests/testcoldfilt.py | 28 ++++++------
tests/testcolfilter.py | 48 +++++++++----------
tests/testcolifilt.py | 40 ++++++++--------
tests/testifm2.py | 40 ++++++++--------
tests/testopenclcoldfilt.py | 46 +++++++++----------
tests/testopenclcolfilter.py | 64 +++++++++++++-------------
tests/testopenclcolifilt.py | 66 +++++++++++++--------------
tests/testopenclxfm2.py | 48 +++++++++----------
tests/testxfm2.py | 48 +++++++++----------
tests/verification.npz | Bin 4293123 -> 4293548 bytes
25 files changed, 346 insertions(+), 342 deletions(-)
diff --cc tests/testcoldfilt.py
index b9bfe1f,6173851..a639e9c
--- a/tests/testcoldfilt.py
+++ b/tests/testcoldfilt.py
@@@ -8,35 -8,35 +8,35 @@@ from pytest import raise
import tests.datasets as datasets
def setup():
- global lena
- lena = datasets.lena()
+ global mandrill
+ mandrill = datasets.mandrill()
- def test_lena_loaded():
- assert lena.shape == (512, 512)
- assert lena.min() >= 0
- assert lena.max() <= 1
- assert lena.dtype == np.float32
+ def test_mandrill_loaded():
+ assert mandrill.shape == (512, 512)
+ assert mandrill.min() >= 0
+ assert mandrill.max() <= 1
+ assert mandrill.dtype == np.float32
- at raises(ValueError)
def test_odd_filter():
- coldfilt(mandrill, (-1,2,-1), (-1,2,1))
+ with raises(ValueError):
- coldfilt(lena, (-1,2,-1), (-1,2,1))
++ coldfilt(mandrill, (-1,2,-1), (-1,2,1))
- at raises(ValueError)
def test_different_size():
- coldfilt(mandrill, (-0.5,-1,2,1,0.5), (-1,2,-1))
+ with raises(ValueError):
- coldfilt(lena, (-0.5,-1,2,1,0.5), (-1,2,-1))
++ coldfilt(mandrill, (-0.5,-1,2,1,0.5), (-1,2,-1))
- at raises(ValueError)
def test_bad_input_size():
- coldfilt(mandrill[:511,:], (-1,1), (1,-1))
+ with raises(ValueError):
- coldfilt(lena[:511,:], (-1,1), (1,-1))
++ coldfilt(mandrill[:511,:], (-1,1), (1,-1))
def test_good_input_size():
- coldfilt(lena[:,:511], (-1,1), (1,-1))
+ coldfilt(mandrill[:,:511], (-1,1), (1,-1))
def test_good_input_size_non_orthogonal():
- coldfilt(lena[:,:511], (1,1), (1,1))
+ coldfilt(mandrill[:,:511], (1,1), (1,1))
def test_output_size():
- Y = coldfilt(lena, (-1,1), (1,-1))
- assert Y.shape == (lena.shape[0]/2, lena.shape[1])
+ Y = coldfilt(mandrill, (-1,1), (1,-1))
+ assert Y.shape == (mandrill.shape[0]/2, mandrill.shape[1])
# vim:sw=4:sts=4:et
diff --cc tests/testcolifilt.py
index a05accb,1696aa0..33e41a4
--- a/tests/testcolifilt.py
+++ b/tests/testcolifilt.py
@@@ -8,48 -8,48 +8,48 @@@ from pytest import raise
import tests.datasets as datasets
def setup():
- global lena
- lena = datasets.lena()
+ global mandrill
+ mandrill = datasets.mandrill()
- def test_lena_loaded():
- assert lena.shape == (512, 512)
- assert lena.min() >= 0
- assert lena.max() <= 1
- assert lena.dtype == np.float32
+ def test_mandrill_loaded():
+ assert mandrill.shape == (512, 512)
+ assert mandrill.min() >= 0
+ assert mandrill.max() <= 1
+ assert mandrill.dtype == np.float32
- at raises(ValueError)
def test_odd_filter():
- colifilt(mandrill, (-1,2,-1), (-1,2,1))
+ with raises(ValueError):
- colifilt(lena, (-1,2,-1), (-1,2,1))
++ colifilt(mandrill, (-1,2,-1), (-1,2,1))
- at raises(ValueError)
def test_different_size_h():
- colifilt(mandrill, (-1,2,1), (-0.5,-1,2,-1,0.5))
+ with raises(ValueError):
- colifilt(lena, (-1,2,1), (-0.5,-1,2,-1,0.5))
++ colifilt(mandrill, (-1,2,1), (-0.5,-1,2,-1,0.5))
def test_zero_input():
- Y = colifilt(np.zeros_like(lena), (-1,1), (1,-1))
+ Y = colifilt(np.zeros_like(mandrill), (-1,1), (1,-1))
assert np.all(Y[:0] == 0)
- at raises(ValueError)
def test_bad_input_size():
- colifilt(mandrill[:511,:], (-1,1), (1,-1))
+ with raises(ValueError):
- colifilt(lena[:511,:], (-1,1), (1,-1))
++ colifilt(mandrill[:511,:], (-1,1), (1,-1))
def test_good_input_size():
- colifilt(lena[:,:511], (-1,1), (1,-1))
+ colifilt(mandrill[:,:511], (-1,1), (1,-1))
def test_output_size():
- Y = colifilt(lena, (-1,1), (1,-1))
- assert Y.shape == (lena.shape[0]*2, lena.shape[1])
+ Y = colifilt(mandrill, (-1,1), (1,-1))
+ assert Y.shape == (mandrill.shape[0]*2, mandrill.shape[1])
def test_non_orthogonal_input():
- Y = colifilt(lena, (1,1), (1,1))
- assert Y.shape == (lena.shape[0]*2, lena.shape[1])
+ Y = colifilt(mandrill, (1,1), (1,1))
+ assert Y.shape == (mandrill.shape[0]*2, mandrill.shape[1])
def test_output_size_non_mult_4():
- Y = colifilt(lena, (-1,0,0,1), (1,0,0,-1))
- assert Y.shape == (lena.shape[0]*2, lena.shape[1])
+ Y = colifilt(mandrill, (-1,0,0,1), (1,0,0,-1))
+ assert Y.shape == (mandrill.shape[0]*2, mandrill.shape[1])
def test_non_orthogonal_input_non_mult_4():
- Y = colifilt(lena, (1,0,0,1), (1,0,0,1))
- assert Y.shape == (lena.shape[0]*2, lena.shape[1])
+ Y = colifilt(mandrill, (1,0,0,1), (1,0,0,1))
+ assert Y.shape == (mandrill.shape[0]*2, mandrill.shape[1])
# vim:sw=4:sts=4:et
diff --cc tests/testifm2.py
index 2e3ca5c,a6d0b2d..4c11267
--- a/tests/testifm2.py
+++ b/tests/testifm2.py
@@@ -8,33 -10,36 +8,33 @@@ import tests.datasets as dataset
TOLERANCE = 1e-12
def setup():
- global lena, lena_crop
- lena = datasets.lena().astype(np.float64)
- lena_crop = lena[:233, :301]
+ global mandrill, mandrill_crop
+ mandrill = datasets.mandrill().astype(np.float64)
+ mandrill_crop = mandrill[:233, :301]
- def test_lena_loaded():
- assert lena.shape == (512, 512)
- assert lena.min() >= 0
- assert lena.max() <= 1
- assert lena.dtype == np.float64
+ def test_mandrill_loaded():
+ assert mandrill.shape == (512, 512)
+ assert mandrill.min() >= 0
+ assert mandrill.max() <= 1
+ assert mandrill.dtype == np.float64
- at 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) < TOLERANCE)
+ Yl, Yh = dtwavexfm2(mandrill)
+ mandrill_recon = dtwaveifm2(Yl, Yh)
+ assert np.all(np.abs(mandrill_recon - mandrill) < TOLERANCE)
- at attr('transform')
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) < TOLERANCE)
+ Yl_crop, Yh_crop = dtwavexfm2(mandrill_crop)
+ mandrill_recon = dtwaveifm2(Yl_crop, Yh_crop)[:mandrill_crop.shape[0], :mandrill_crop.shape[1]]
+ assert np.all(np.abs(mandrill_recon - mandrill_crop) < TOLERANCE)
- 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) < TOLERANCE)
+ Yl, Yh = dtwavexfm2(mandrill, 4, biort('legall'), qshift('qshift_06'))
+ mandrill_recon = dtwaveifm2(Yl, Yh, biort('legall'), qshift('qshift_06'))
+ assert np.all(np.abs(mandrill_recon - mandrill) < TOLERANCE)
def test_float32_input():
# Check that an float32 input is correctly output as float32
diff --cc tests/testopenclcoldfilt.py
index 6b8603a,c9fd718..3fb53b1
--- a/tests/testopenclcoldfilt.py
+++ b/tests/testopenclcoldfilt.py
@@@ -11,29 -11,29 +11,29 @@@ from .util import assert_almost_equal,
import tests.datasets as datasets
def setup():
- global lena
- lena = datasets.lena()
+ global mandrill
+ mandrill = datasets.mandrill()
- def test_lena_loaded():
- assert lena.shape == (512, 512)
- assert lena.min() >= 0
- assert lena.max() <= 1
- assert lena.dtype == np.float32
+ def test_mandrill_loaded():
+ assert mandrill.shape == (512, 512)
+ assert mandrill.min() >= 0
+ assert mandrill.max() <= 1
+ assert mandrill.dtype == np.float32
- at raises(ValueError)
@skip_if_no_cl
def test_odd_filter():
- coldfilt(mandrill, (-1,2,-1), (-1,2,1))
+ with raises(ValueError):
- coldfilt(lena, (-1,2,-1), (-1,2,1))
++ coldfilt(mandrill, (-1,2,-1), (-1,2,1))
- at raises(ValueError)
@skip_if_no_cl
def test_different_size():
- coldfilt(mandrill, (-0.5,-1,2,1,0.5), (-1,2,-1))
+ with raises(ValueError):
- coldfilt(lena, (-0.5,-1,2,1,0.5), (-1,2,-1))
++ coldfilt(mandrill, (-0.5,-1,2,1,0.5), (-1,2,-1))
- at raises(ValueError)
@skip_if_no_cl
def test_bad_input_size():
- coldfilt(mandrill[:511,:], (-1,1), (1,-1))
+ with raises(ValueError):
- coldfilt(lena[:511,:], (-1,1), (1,-1))
++ coldfilt(mandrill[:511,:], (-1,1), (1,-1))
@skip_if_no_cl
def test_real_wavelet():
diff --cc tests/testopenclcolifilt.py
index 7c0ab74,f04a58d..90627c7
--- a/tests/testopenclcolifilt.py
+++ b/tests/testopenclcolifilt.py
@@@ -11,24 -11,24 +11,24 @@@ from .util import assert_almost_equal,
import tests.datasets as datasets
def setup():
- global lena
- lena = datasets.lena()
+ global mandrill
+ mandrill = datasets.mandrill()
- def test_lena_loaded():
- assert lena.shape == (512, 512)
- assert lena.min() >= 0
- assert lena.max() <= 1
- assert lena.dtype == np.float32
+ def test_mandrill_loaded():
+ assert mandrill.shape == (512, 512)
+ assert mandrill.min() >= 0
+ assert mandrill.max() <= 1
+ assert mandrill.dtype == np.float32
@skip_if_no_cl
- at raises(ValueError)
def test_odd_filter():
- colifilt(mandrill, (-1,2,-1), (-1,2,1))
+ with raises(ValueError):
- colifilt(lena, (-1,2,-1), (-1,2,1))
++ colifilt(mandrill, (-1,2,-1), (-1,2,1))
@skip_if_no_cl
- at raises(ValueError)
def test_different_size_h():
- colifilt(mandrill, (-1,2,1), (-0.5,-1,2,-1,0.5))
+ with raises(ValueError):
- colifilt(lena, (-1,2,1), (-0.5,-1,2,-1,0.5))
++ colifilt(mandrill, (-1,2,1), (-0.5,-1,2,-1,0.5))
@skip_if_no_cl
def test_zero_input():
@@@ -36,9 -36,9 +36,9 @@@
assert np.all(Y[:0] == 0)
@skip_if_no_cl
- at raises(ValueError)
def test_bad_input_size():
- colifilt(mandrill[:511,:], (-1,1), (1,-1))
+ with raises(ValueError):
- colifilt(lena[:511,:], (-1,1), (1,-1))
++ colifilt(mandrill[:511,:], (-1,1), (1,-1))
@skip_if_no_cl
def test_good_input_size():
diff --cc tests/testopenclxfm2.py
index 43a4c28,17fa5ba..1fd519b
--- a/tests/testopenclxfm2.py
+++ b/tests/testopenclxfm2.py
@@@ -30,13 -31,15 +30,13 @@@ def _compare_transforms(A, B)
assert_almost_equal(x, y, tolerance=GOLD_TOLERANCE)
@skip_if_no_cl
- at attr('transform')
def test_simple():
- _compare_transforms(dtwavexfm2_np(lena), dtwavexfm2_cl(lena))
+ _compare_transforms(dtwavexfm2_np(mandrill), dtwavexfm2_cl(mandrill))
@skip_if_no_cl
- at attr('transform')
def test_specific_wavelet():
- a = dtwavexfm2_np(lena, biort=biort('antonini'), qshift=qshift('qshift_06'))
- b = dtwavexfm2_cl(lena, biort=biort('antonini'), qshift=qshift('qshift_06'))
+ a = dtwavexfm2_np(mandrill, biort=biort('antonini'), qshift=qshift('qshift_06'))
+ b = dtwavexfm2_cl(mandrill, biort=biort('antonini'), qshift=qshift('qshift_06'))
_compare_transforms(a, b)
@skip_if_no_cl
@@@ -46,9 -49,9 +46,9 @@@ def test_1d()
_compare_transforms(a, b)
@skip_if_no_cl
- at raises(ValueError)
def test_3d():
- Yl, Yh = dtwavexfm2_cl(np.dstack((mandrill, mandrill)))
+ with raises(ValueError):
- Yl, Yh = dtwavexfm2_cl(np.dstack((lena, lena)))
++ Yl, Yh = dtwavexfm2_cl(np.dstack((mandrill, mandrill)))
@skip_if_no_cl
def test_simple_w_scale():
@@@ -84,9 -87,10 +84,9 @@@ def test_0_levels()
_compare_transforms(a, b)
@skip_if_no_cl
- at attr('transform')
def test_modified():
- a = dtwavexfm2_np(lena, biort=biort('near_sym_b_bp'), qshift=qshift('qshift_b_bp'))
- b = dtwavexfm2_cl(lena, biort=biort('near_sym_b_bp'), qshift=qshift('qshift_b_bp'))
+ a = dtwavexfm2_np(mandrill, biort=biort('near_sym_b_bp'), qshift=qshift('qshift_b_bp'))
+ b = dtwavexfm2_cl(mandrill, biort=biort('near_sym_b_bp'), qshift=qshift('qshift_b_bp'))
_compare_transforms(a, b)
# vim:sw=4:sts=4:et
diff --cc tests/testxfm2.py
index 317f95a,7c0f18d..3d8f620
--- a/tests/testxfm2.py
+++ b/tests/testxfm2.py
@@@ -9,30 -10,32 +9,30 @@@ import tests.datasets as dataset
TOLERANCE = 1e-12
def setup():
- global lena
- lena = datasets.lena()
+ global mandrill
+ mandrill = datasets.mandrill()
- def test_lena_loaded():
- assert lena.shape == (512, 512)
- assert lena.min() >= 0
- assert lena.max() <= 1
- assert lena.dtype == np.float32
+ def test_mandrill_loaded():
+ assert mandrill.shape == (512, 512)
+ assert mandrill.min() >= 0
+ assert mandrill.max() <= 1
+ assert mandrill.dtype == np.float32
- at attr('transform')
def test_simple():
- Yl, Yh = dtwavexfm2(lena)
+ Yl, Yh = dtwavexfm2(mandrill)
- at attr('transform')
def test_specific_wavelet():
- Yl, Yh = dtwavexfm2(lena, biort=biort('antonini'), qshift=qshift('qshift_06'))
+ Yl, Yh = dtwavexfm2(mandrill, biort=biort('antonini'), qshift=qshift('qshift_06'))
def test_1d():
- Yl, Yh = dtwavexfm2(lena[0,:])
+ Yl, Yh = dtwavexfm2(mandrill[0,:])
- at raises(ValueError)
def test_3d():
- Yl, Yh = dtwavexfm2(np.dstack((mandrill, mandrill)))
+ with raises(ValueError):
- Yl, Yh = dtwavexfm2(np.dstack((lena, lena)))
++ Yl, Yh = dtwavexfm2(np.dstack((mandrill, mandrill)))
def test_simple_w_scale():
- Yl, Yh, Yscale = dtwavexfm2(lena, include_scale=True)
+ Yl, Yh, Yscale = dtwavexfm2(mandrill, include_scale=True)
assert len(Yscale) > 0
for x in Yscale:
--
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