File: test_coeffs.py

package info (click to toggle)
python-dtcwt 0.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,588 kB
  • sloc: python: 6,287; sh: 29; makefile: 13
file content (79 lines) | stat: -rw-r--r-- 1,846 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from dtcwt.coeffs import biort, qshift

from pytest import raises

def test_antonini():
    h0o, g0o, h1o, g1o = biort('antonini')
    assert h0o.shape[0] == 9
    assert g0o.shape[0] == 7
    assert h1o.shape[0] == 7
    assert g1o.shape[0] == 9

def test_legall():
    h0o, g0o, h1o, g1o = biort('legall')
    assert h0o.shape[0] == 5
    assert g0o.shape[0] == 3
    assert h1o.shape[0] == 3
    assert g1o.shape[0] == 5

def test_near_sym_a():
    h0o, g0o, h1o, g1o = biort('near_sym_a')
    assert h0o.shape[0] == 5
    assert g0o.shape[0] == 7
    assert h1o.shape[0] == 7
    assert g1o.shape[0] == 5

def test_near_sym_a():
    h0o, g0o, h1o, g1o = biort('near_sym_b')
    assert h0o.shape[0] == 13
    assert g0o.shape[0] == 19
    assert h1o.shape[0] == 19
    assert g1o.shape[0] == 13

def test_qshift_06():
    coeffs = qshift('qshift_06')
    assert len(coeffs) == 8
    for v in coeffs:
        assert v.shape[0] == 10

def test_qshift_a():
    coeffs = qshift('qshift_a')
    assert len(coeffs) == 8
    for v in coeffs:
        assert v.shape[0] == 10

def test_qshift_b():
    coeffs = qshift('qshift_b')
    assert len(coeffs) == 8
    for v in coeffs:
        assert v.shape[0] == 14

def test_qshift_c():
    coeffs = qshift('qshift_c')
    assert len(coeffs) == 8
    for v in coeffs:
        assert v.shape[0] == 16

def test_qshift_d():
    coeffs = qshift('qshift_d')
    assert len(coeffs) == 8
    for v in coeffs:
        assert v.shape[0] == 18

def test_non_exist_biort():
    with raises(IOError):
        biort('this-does-not-exist')

def test_non_exist_qshift():
    with raises(IOError):
        qshift('this-does-not-exist')

def test_wrong_type_a():
    with raises(ValueError):
        biort('qshift_06')

def test_wrong_type_b():
    with raises(ValueError):
        qshift('antonini')

# vim:sw=4:sts=4:et