Commit c2f129fc authored by Florent Jaillet's avatar Florent Jaillet
Browse files

Fixing bugs and failing tests for architecture i686, solving issue #8

Note that the modifications include the fixes for issue #10 and issue #11
and should solve Debian bug 861091 and 861094.
parent abcaa649
Pipeline #295 passed with stage
in 4 minutes and 3 seconds
......@@ -143,7 +143,7 @@ class TestGabphasegrad(unittest.TestCase):
msg = 'wrong output in gabphasegrad with inputs ' + str(inputs)
assert_allclose(tgrad, outputs[0], rtol=4e-15, err_msg=msg)
assert_allclose(fgrad, outputs[1], rtol=1e-15, err_msg=msg)
assert_array_equal(c, outputs[2], msg)
assert_allclose(c, outputs[2], rtol=1e-15, err_msg=msg)
elif method == 'phase':
cphase, a = (inputs[var] for var in ('cphase', 'a'))
tgrad, fgrad = gabphasegrad(method, cphase, a)
......
......@@ -108,7 +108,7 @@ class TestInstfreqplot(unittest.TestCase):
out = instfreqplot(**inputs)
msg = ('Wrong value in output of instfreqplot with inputs ' +
str(inputs))
assert_allclose(out, outputs[0], rtol=2e-15, err_msg=msg)
assert_allclose(out, outputs[0], atol=1e-13, err_msg=msg)
if __name__ == '__main__':
......
......@@ -102,7 +102,7 @@ class TestPhaseplot(unittest.TestCase):
out = phaseplot(**inputs)
msg = ('Wrong value in output of phaseplot with inputs ' +
str(inputs))
assert_allclose(out, outputs[0], rtol=2e-15, err_msg=msg)
assert_allclose(out, outputs[0], atol=1e-14, err_msg=msg)
if __name__ == '__main__':
......
......@@ -114,7 +114,7 @@ class TestSgram(unittest.TestCase):
out = sgram(**inputs)
msg = ('Wrong value in output of sgram with inputs ' +
str(inputs))
assert_array_equal(out, outputs[0], msg)
assert_allclose(out, outputs[0], atol=1e-14, err_msg=msg)
if __name__ == '__main__':
......
......@@ -63,6 +63,7 @@ from __future__ import print_function, division
import unittest
import numpy as np
from numpy.testing import assert_array_equal
import matplotlib.pyplot as plt
from ltfatpy.gabor.tfplot import tfplot
......@@ -175,6 +176,11 @@ class TestTfplot(unittest.TestCase):
def test_plot(self):
"""Check that the all the plotting sections of tfplot can be run
"""
# NOTE: To avoid an error when running the tests in a environnement
# with no $DISPLAY variable defined, we switch matplotlib to a
# non-interactive backend
plt.switch_backend("ps")
coef = np.random.random((5, 4))
step = 1
yr = np.array([0., 1.])
......
......@@ -103,7 +103,7 @@ def postpad(x, L, C=0., dim=None):
if dim is None:
# by default, dim is the first non-singleton dimension
dim = np.nonzero(np.array(x.shape) > 1)[0][0]
dim = int(np.nonzero(np.array(x.shape) > 1)[0][0])
x, L, Ls, W, dim, permutedsize, order = assert_sigreshape_pre(x, L, dim)
......
  • Florent Jaillet @florent.jaillet

    mentioned in issue #8 (closed)

    By Florent Jaillet on 2017-06-29T11:59:37 (imported from GitLab project)

    ·

    mentioned in issue #8 (closed)

    By Florent Jaillet on 2017-06-29T11:59:37 (imported from GitLab project)

    Toggle commit list
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment