Skip to content
Snippets Groups Projects
Commit 50d6cfe3 authored by Denis Arrivault's avatar Denis Arrivault
Browse files

Merge branch 'bugs_i686'

parents afc7c94f fb1b1e1a
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -143,7 +143,7 @@ class TestGabphasegrad(unittest.TestCase): ...@@ -143,7 +143,7 @@ class TestGabphasegrad(unittest.TestCase):
msg = 'wrong output in gabphasegrad with inputs ' + str(inputs) msg = 'wrong output in gabphasegrad with inputs ' + str(inputs)
assert_allclose(tgrad, outputs[0], rtol=4e-15, err_msg=msg) assert_allclose(tgrad, outputs[0], rtol=4e-15, err_msg=msg)
assert_allclose(fgrad, outputs[1], rtol=1e-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': elif method == 'phase':
cphase, a = (inputs[var] for var in ('cphase', 'a')) cphase, a = (inputs[var] for var in ('cphase', 'a'))
tgrad, fgrad = gabphasegrad(method, cphase, a) tgrad, fgrad = gabphasegrad(method, cphase, a)
......
...@@ -107,8 +107,9 @@ class TestInstfreqplot(unittest.TestCase): ...@@ -107,8 +107,9 @@ class TestInstfreqplot(unittest.TestCase):
for inputs, outputs in data: for inputs, outputs in data:
out = instfreqplot(**inputs) out = instfreqplot(**inputs)
msg = ('Wrong value in output of instfreqplot with inputs ' + msg = ('Wrong value in output of instfreqplot with inputs ' +
str(inputs)) str(inputs) +
assert_allclose(out, outputs[0], rtol=2e-15, err_msg=msg) '\nMaximal error: ' + str(np.max(np.abs(outputs[0] - out))))
assert_allclose(out, outputs[0], atol=1e-13, err_msg=msg)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -102,7 +102,7 @@ class TestPhaseplot(unittest.TestCase): ...@@ -102,7 +102,7 @@ class TestPhaseplot(unittest.TestCase):
out = phaseplot(**inputs) out = phaseplot(**inputs)
msg = ('Wrong value in output of phaseplot with inputs ' + msg = ('Wrong value in output of phaseplot with inputs ' +
str(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__': if __name__ == '__main__':
......
...@@ -114,7 +114,7 @@ class TestSgram(unittest.TestCase): ...@@ -114,7 +114,7 @@ class TestSgram(unittest.TestCase):
out = sgram(**inputs) out = sgram(**inputs)
msg = ('Wrong value in output of sgram with inputs ' + msg = ('Wrong value in output of sgram with inputs ' +
str(inputs)) str(inputs))
assert_array_equal(out, outputs[0], msg) assert_allclose(out, outputs[0], atol=1e-14, err_msg=msg)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -63,6 +63,7 @@ from __future__ import print_function, division ...@@ -63,6 +63,7 @@ from __future__ import print_function, division
import unittest import unittest
import numpy as np import numpy as np
from numpy.testing import assert_array_equal from numpy.testing import assert_array_equal
import matplotlib.pyplot as plt
from ltfatpy.gabor.tfplot import tfplot from ltfatpy.gabor.tfplot import tfplot
...@@ -175,6 +176,11 @@ class TestTfplot(unittest.TestCase): ...@@ -175,6 +176,11 @@ class TestTfplot(unittest.TestCase):
def test_plot(self): def test_plot(self):
"""Check that the all the plotting sections of tfplot can be run """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)) coef = np.random.random((5, 4))
step = 1 step = 1
yr = np.array([0., 1.]) yr = np.array([0., 1.])
......
...@@ -103,7 +103,7 @@ def postpad(x, L, C=0., dim=None): ...@@ -103,7 +103,7 @@ def postpad(x, L, C=0., dim=None):
if dim is None: if dim is None:
# by default, dim is the first non-singleton dimension # 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) x, L, Ls, W, dim, permutedsize, order = assert_sigreshape_pre(x, L, dim)
......
  • Florent Jaillet @florent.jaillet

    mentioned in issue #8 (closed)

    By Denis Arrivault on 2017-06-29T13:06:37 (imported from GitLab project)

    ·

    mentioned in issue #8 (closed)

    By Denis Arrivault on 2017-06-29T13:06:37 (imported from GitLab project)

    Toggle commit list
  • Florent Jaillet @florent.jaillet

    mentioned in issue #8 (closed)

    By Denis Arrivault on 2017-06-29T13:06:37 (imported from GitLab project)

    ·

    mentioned in issue #8 (closed)

    By Denis Arrivault on 2017-06-29T13:06:37 (imported from GitLab project)

    Toggle commit list
  • Florent Jaillet @florent.jaillet

    mentioned in issue #10 (closed)

    By Denis Arrivault on 2017-06-29T13:08:51 (imported from GitLab project)

    ·

    mentioned in issue #10 (closed)

    By Denis Arrivault on 2017-06-29T13:08:51 (imported from GitLab project)

    Toggle commit list
  • Florent Jaillet @florent.jaillet

    mentioned in issue #10 (closed)

    By Denis Arrivault on 2017-06-29T13:08:51 (imported from GitLab project)

    ·

    mentioned in issue #10 (closed)

    By Denis Arrivault on 2017-06-29T13:08:51 (imported from GitLab project)

    Toggle commit list
  • Florent Jaillet @florent.jaillet

    mentioned in issue #11 (closed)

    By Denis Arrivault on 2017-06-29T13:09:08 (imported from GitLab project)

    ·

    mentioned in issue #11 (closed)

    By Denis Arrivault on 2017-06-29T13:09:08 (imported from GitLab project)

    Toggle commit list
  • Florent Jaillet @florent.jaillet

    mentioned in issue #11 (closed)

    By Denis Arrivault on 2017-06-29T13:09:08 (imported from GitLab project)

    ·

    mentioned in issue #11 (closed)

    By Denis Arrivault on 2017-06-29T13:09:08 (imported from GitLab project)

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