ltfatpy issueshttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues2018-04-16T13:37:49+02:00https://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/13Switch from nose to pytest for tests2018-04-16T13:37:49+02:00Florent JailletSwitch from nose to pytest for testsAs nose is in maintenance mode and might cease in the near future, we should switch to pytest to run the tests in continuous integration.
As some of the tests use random generation, we should also use pytest-randomly to manage the rando...As nose is in maintenance mode and might cease in the near future, we should switch to pytest to run the tests in continuous integration.
As some of the tests use random generation, we should also use pytest-randomly to manage the random seeds.https://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/6tfplot failed2018-04-12T09:07:41+02:00Florent Jaillettfplot failed```
Traceback (most recent call last):
File "/builds/dev/ltfatpy/ltfatpy/tests/gabor/test_tfplot.py", line 183, in test_plot
tfplot(coef, step, yr, plottype=plottype)
File "/builds/dev/ltfatpy/ltfatpy/gabor/tfplot.py", line 2...```
Traceback (most recent call last):
File "/builds/dev/ltfatpy/ltfatpy/tests/gabor/test_tfplot.py", line 183, in test_plot
tfplot(coef, step, yr, plottype=plottype)
File "/builds/dev/ltfatpy/ltfatpy/gabor/tfplot.py", line 244, in tfplot
ax = plt.gca(projection='3d')
File "/usr/local/lib/python3.4/dist-packages/matplotlib/pyplot.py", line 950, in gca
return gcf().gca(**kwargs)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/figure.py", line 1368, in gca
return self.add_subplot(1, 1, 1, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/figure.py", line 1020, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/axes/_subplots.py", line 73, in __init__
self._axes_class.__init__(self, fig, self.figbox, **kwargs)
File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 91, in __init__
*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/axes/_base.py", line 551, in __init__
self.cla()
File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 1045, in cla
Axes.cla(self)
File "/usr/local/lib/python3.4/dist-packages/matplotlib/axes/_base.py", line 1062, in cla
self.grid(False) # Disable grid on init to use rcParameter
File "/usr/lib/python3/dist-packages/mpl_toolkits/mplot3d/axes3d.py", line 1256, in grid
self._draw_grid = maxes._string_to_bool(b)
nose.proxy.AttributeError: 'module' object has no attribute '_string_to_bool'
```
------------
Is this a problem with the display set on gitlab-ci?Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/2VisibleDeprecationWarning2017-03-26T03:39:02+02:00Florent JailletVisibleDeprecationWarningThe use of ltftatpy raises:
> VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
I spotted five problematic lines (it might be a non-exhaustive list):
* ltfatpy/fou...The use of ltftatpy raises:
> VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
I spotted five problematic lines (it might be a non-exhaustive list):
* ltfatpy/fourier/middlepad.py:209: h = np.concatenate((f[:Lorig/2, :],
* ltfatpy/fourier/middlepad.py:211: f[Lorig/2:Lorig, :]))
* ltfatpy/fourier/middlepad.py:168: h = np.concatenate((f[:(Lorig+1)/2, :],
* ltfatpy/fourier/middlepad.py:170: f[(Lorig+1)/2:Lorig, :]))
* ltfatpy/gabor/gabframediag.py:113:d = np.tile(np.sum(glong2.reshape(N, a), axis=0), (N,)) * M
Applying int() on fractional expressions and on the sum should avoid the warning.https://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/9Latex formulae not processed in the documentation generated by the CI docker ...2017-05-15T19:47:41+02:00Florent JailletLatex formulae not processed in the documentation generated by the CI docker imageThe latex formulae in the documentation generated with the current Docker image for CI are not processed as expected.
For exemple, the formula for [ltfatpy.fourier.dft](http://dev.pages.lif.univ-mrs.fr/ltfatpy/ltfatpy.fourier.html#modul...The latex formulae in the documentation generated with the current Docker image for CI are not processed as expected.
For exemple, the formula for [ltfatpy.fourier.dft](http://dev.pages.lif.univ-mrs.fr/ltfatpy/ltfatpy.fourier.html#module-ltfatpy.fourier.dft) is displayed as:
```
c\left(k+1\right)=\frac{1}{\sqrt{L}} \sum_{l=0}^{L-1}f\left(l+1\right)e^{-2\pi ikl/L}
```
When generating the documentation in the Docker image with:
```
python3 setup.py build_sphinx
```
the following warning is displayed:
```
WARNING: LaTeX command 'latex' cannot be run (needed for math display), check the imgmath_latex setting
```
so installing some latex distribution in the image should solve the issue.Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/11TestInstfreqplot AssertionError (Debian bug 861091)2017-06-29T15:46:54+02:00Florent JailletTestInstfreqplot AssertionError (Debian bug 861091)On some platforms other than x86_64, test_working in ltfatpy.tests.gabor.test_instfreqplot fails due to the difference of the results not being in the tolerance range.
See the [Debian bug 861091](https://bugs.debian.org/cgi-bin/bugrepor...On some platforms other than x86_64, test_working in ltfatpy.tests.gabor.test_instfreqplot fails due to the difference of the results not being in the tolerance range.
See the [Debian bug 861091](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=861091) for details.Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/8Problem with some tests on i686 architecture (including Debian bug 861094)2017-06-29T15:47:35+02:00Florent JailletProblem with some tests on i686 architecture (including Debian bug 861094)see https://gitlab.lif.univ-mrs.fr/dev/ltfatpy/builds/3196see https://gitlab.lif.univ-mrs.fr/dev/ltfatpy/builds/3196Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/7test_ifftreal.py failed2018-04-16T13:42:38+02:00Florent Jaillettest_ifftreal.py failedOn ubuntu:X86_64 docker image this test fails sometimes :
```
======================================================================
FAIL: Check that ifftreal is the inverse of fftreal
------------------------------------------------...On ubuntu:X86_64 docker image this test fails sometimes :
```
======================================================================
FAIL: Check that ifftreal is the inverse of fftreal
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builds/dev/ltfatpy/ltfatpy/tests/fourier/test_ifftreal.py", line 121, in test_inversion
err_msg=msg)
File "/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 1183, in assert_allclose
verbose=verbose, header=header)
File "/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 644, in assert_array_compare
raise AssertionError(msg)
nose.proxy.AssertionError:
Not equal to tolerance rtol=1e-10, atol=1e-14
Result of inversion is not close enough to the original when composing fftreal and ifftreal with inputs {'dim': 0, 'N': 29}
(mismatch 100.0%)
x: array([[ 5.71722612e-01, 9.99076921e-01, 3.44226388e-01,
9.63619118e-01, 2.33269769e-02, 4.37636298e-01,
2.80571561e-01, 8.08747228e-01, 4.71364378e-01,...
y: array([[ 5.71722612e-01, 9.99076921e-01, 3.44226388e-01,
9.63619118e-01, 2.33269769e-02, 4.37636298e-01,
2.80571561e-01, 8.08747228e-01, 4.71364378e-01,...
-------------------- >> begin captured stdout << ---------------------
------------------------------
Precision is too tight.
```Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/5Missing usage in doc of dgtreal2017-04-13T11:33:31+02:00Florent JailletMissing usage in doc of dgtrealUsage `(c, Ls, g) = dgtreal(f, g, a, M, L, pt)` is missing while parameter `pt` is mentionnedUsage `(c, Ls, g) = dgtreal(f, g, a, M, L, pt)` is missing while parameter `pt` is mentionnedhttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/4Installation failed with anaconda under mac os2017-06-04T20:45:44+02:00Florent JailletInstallation failed with anaconda under mac osPython 3.5 + Anaconda + mac os
Installation failed with "ld: library not found for -lfftw3"Python 3.5 + Anaconda + mac os
Installation failed with "ld: library not found for -lfftw3"Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/10test_tfplot fails when no $DISPLAY environment variable is defined2017-06-29T15:47:17+02:00Florent Jaillettest_tfplot fails when no $DISPLAY environment variable is definedWhen running the tests with nosetests in an environment with no $DISPLAY variable defined (in particular in a Docker container) the following error occurs:
```
======================================================================
ERROR:...When running the tests with nosetests in an environment with no $DISPLAY variable defined (in particular in a Docker container) the following error occurs:
```
======================================================================
ERROR: Check that the all the plotting sections of tfplot can be run
----------------------------------------------------------------------
Traceback (most recent call last):
File "/ltfatpy/ltfatpy/tests/gabor/test_tfplot.py", line 183, in test_plot
tfplot(coef, step, yr, plottype=plottype)
File "/ltfatpy/ltfatpy/gabor/tfplot.py", line 230, in tfplot
interpolation='nearest', origin='lower')
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 2881, in imshow
ax = gca()
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 803, in gca
ax = gcf().gca(**kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 450, in gcf
return figure()
File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 423, in figure
**kwargs)
File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 79, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 87, in new_figure_manager_given_figure
window = Tk.Tk()
File "/usr/lib/python3.4/tkinter/__init__.py", line 1854, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
nose.proxy.TclError: no display name and no $DISPLAY environment variable
-------------------- >> begin captured stdout << ---------------------
```
This happens despite the fact that the tests are not doing any actual display with matplotlib (matplotlib.pyplot.show() is never called).
The solution is to force the use of a non-interactive backend for matplotlib, for example the backend ps. The function [matplotlib.pyplot.switch_backend](http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.switch_backend) can be used to switch the backend.Florent JailletFlorent Jaillethttps://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/1memory leak in functions using the C core2017-03-26T03:39:02+02:00Florent Jailletmemory leak in functions using the C coreThe following code shows the memory leak (~7 GB after 5000 iterations for dgt).
```python
import numpy as np
from ltfatpy.gabor.dgtreal import dgtreal
from ltfatpy.gabor.dgt import dgt
x = np.random.rand(10000)
g = np.random....The following code shows the memory leak (~7 GB after 5000 iterations for dgt).
```python
import numpy as np
from ltfatpy.gabor.dgtreal import dgtreal
from ltfatpy.gabor.dgt import dgt
x = np.random.rand(10000)
g = np.random.rand(256)
for _ in range(100000):
print(_)
# X, Ls, g = dgtreal(x, g=g, a=512, M=4096)
X, Ls, g = dgt(x, g=g, a=512, M=4096)
```
There is even a simpler example :
```python
from ltfatpy.fourier.pgauss import pgauss
for _ in range(100000):
print(_)
pgauss(100000000)
```
https://gitlab.lis-lab.fr/dev/ltfatpy/-/issues/3ImportError: No module named 'ltfatpy.comp.comp_dct'2017-03-26T03:39:02+02:00Florent JailletImportError: No module named 'ltfatpy.comp.comp_dct'When importing ltatpy 1.0.5
> import ltfatpy
```
ltfatpy/__init__.py in <module>()
29 from ltfatpy.comp.assert_sigreshape_post import assert_sigreshape_post
30 from ltfatpy.comp.assert_sigreshape_pre import assert_sigreshape_...When importing ltatpy 1.0.5
> import ltfatpy
```
ltfatpy/__init__.py in <module>()
29 from ltfatpy.comp.assert_sigreshape_post import assert_sigreshape_post
30 from ltfatpy.comp.assert_sigreshape_pre import assert_sigreshape_pre
---> 31 from ltfatpy.comp.comp_dct import comp_dct
32 from ltfatpy.comp.comp_dst import comp_dst
33 from ltfatpy.comp.comp_gabdual_long import comp_gabdual_long
ImportError: No module named 'ltfatpy.comp.comp_dct'
```