DINKIN / winpython

Automatically exported from code.google.com/p/winpython
0 stars 0 forks source link

Matplotlib Fails Unit Tests #61

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run matplotlib.test()

What is the expected output? What do you see instead?
I expect the test not fail 50% of the routines. I also expect my local miktex 
install not to ask for missing packages during the test.

What version of the product are you using? On what operating system?
2.7.5.1 64bit on Win7

Please provide any additional information below.
See attachments, ran test in ipython after unanticipated failure of plotting 
script, and then in a clean python console.

in the ipython test, I did not install missing tex packages.
in the python test, I elected to install the missing packages.

Original issue reported on code.google.com by redou...@gmail.com on 17 Jun 2013 at 3:28

Attachments:

GoogleCodeExporter commented 9 years ago
There should be no custom modules installed, but here's a pip freeze:

C:\WinPython\python-2.7.5.amd64>pip freeze
Cython==0.19.1
Jinja2==2.7
MarkupSafe==0.18
Pillow==2.0.0
Polygon==2.0.5
PyOpenGL==3.0.2
PyQtdoc==4.8.4
PySide==1.1.2
PyVISA==1.4
PyWavelets==0.2.2
Pygments==1.6
SQLAlchemy==0.7.9
Scidoc==1.7.1
Sphinx==1.1.3
TTFQuery==1.0.5
VPython==5.74
VTK==5.10.1
ViTables==2.1
colorama==0.2.5
cvxopt==1.1.6
cx-Freeze==4.3.1
distribute==0.6.43
docutils==0.10
egenix-mx-base==3.2.5
fonttools==2.3
formlayout==1.0.13
guidata==1.6.1
guiqwt==2.3.0
h5py==2.1.3
ipython==0.13.2
logilab-astng==0.24.3
logilab-common==0.59.1
mahotas==1.0
matplotlib==1.2.1
networkx==1.7
nose==1.3.0
numexpr==2.1
numpy==1.7.1
pandas==0.11.0
psutil==0.7.1
pydicom==0.9.7
pyhdf==0.8.3
pylint==0.28.0
pyreadline==2.0
pyserial==2.6
pywin32==218
pyzmq==13.1.0
reportlab==2.7
rst2pdf==0.93.dev
scikit-image==0.8.2
scikit-learn==0.13.1
scikits.audiolab==0.11.0
scipy==0.12.0
simplejson==3.3.0
spyder==2.2.0
statsmodels==0.4.3
sympy==0.7.2
tables==3.0.0rc3
tornado==2.4.1
winpython==0.15
xlrd==0.9.2
xlwt==0.7.5

C:\WinPython\python-2.7.5.amd64>

Original comment by redou...@gmail.com on 17 Jun 2013 at 3:32

GoogleCodeExporter commented 9 years ago
Example alert below. I don't think it actually installs the dependency, since 
every new test asks for it.

Original comment by redou...@gmail.com on 17 Jun 2013 at 4:24

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry for spreading everything out. Here's the same issue, with WinPython on a 
32bit XP machine.

Original comment by redou...@gmail.com on 17 Jun 2013 at 5:38

Attachments:

GoogleCodeExporter commented 9 years ago
1) The matplotlib test data are no longer included in the official release 
versions of the matplotlib binaries because of their size. You can manually 
install the test data from the matplotlib source distribution.
2) Matplotlib tests require Inkscape, GhostScript and MikTeX to be installed 
and in the PATH. 
3) MikTeX must be recent and should be fully installed or configured not to ask 
for missing packages during the test. 
4) Due to the large number of open files, it might be necessary to 
`ctypes.cdll.msvcr[90|100]._setmaxstdio(2000)` before running the tests. 

Original comment by cjgoh...@gmail.com on 17 Jun 2013 at 6:06

GoogleCodeExporter commented 9 years ago
Interesting. I ran the tests to investigate a failure of the pdf backend to 
save several figures from my script. This script ran fine in 2.7.3 python(x,y), 
and runs fine under Xubuntu 13.04 with the same python component versions.

A simple script to save a plot as a pdf works fine, so I'll see if I can 
sanitize and upload my special case that's causing the issue.

Specific error here:
    Generating report at 8585testlog_2013-05-10_00-08-54_report.pdf
    Traceback (most recent call last):
      File "C:\Users\plthompson\Documents\py8585\reportGenerator.py", line 926, in <module>
        produceReport(logfilename, config)
      File "C:\Users\plthompson\Documents\py8585\reportGenerator.py", line 796, in produceReport
        pp.savefig(BiasTimeSeries[0])
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backends\backend_pdf.py", line 2284, in savefig
        figure.savefig(self, format='pdf', **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\figure.py", line 1370, in savefig
        self.canvas.print_figure(*args, **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line 161, in print_figure
        FigureCanvasAgg.print_figure(self, *args, **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backend_bases.py", line 2117, in print_figure
        **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backend_bases.py", line 1868, in print_pdf
        return pdf.print_pdf(*args, **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backends\backend_pdf.py", line 2327, in print_pdf
        self.figure.draw(renderer)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\artist.py", line 54, in draw_wrapper
        draw(artist, renderer, *args, **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\figure.py", line 1006, in draw
        func(*args)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\artist.py", line 54, in draw_wrapper
        draw(artist, renderer, *args, **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\axes.py", line 2089, in draw
        a.draw(renderer)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\artist.py", line 54, in draw_wrapper
        draw(artist, renderer, *args, **kwargs)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\collections.py", line 262, in draw
        self._offset_position)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backends\backend_pdf.py", line 1570, in draw_path_collection
        self.check_gc(gc0, rgbFace)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backends\backend_pdf.py", line 1446, in check_gc
        delta = self.gc.delta(gc)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\matplotlib\backends\backend_pdf.py", line 2171, in delta
        ours = np.asarray(ours)
      File "C:\WinPython\python-2.7.5.amd64\lib\site-packages\numpy\core\numeric.py", line 320, in asarray
        return array(a, dtype, copy=False, order=order)
    ValueError: setting an array element with a sequence.

Original comment by redou...@gmail.com on 17 Jun 2013 at 7:55

GoogleCodeExporter commented 9 years ago
I'm attaching a .7z of the script, datafile, and expected result. This causes 
the error above, but only for this version of winpython (2.7.5.1 x64 on Win7, 
and 2.7.5.1 x86 on WinXP).

It's not clear to me why this is happening. The plotting function produces the 
graphs correctly. It seems that the line pp.savefig(fig) fails in this special 
case.

Original comment by redou...@gmail.com on 17 Jun 2013 at 9:41

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by pierre.raybaut on 18 Jun 2013 at 6:59

GoogleCodeExporter commented 9 years ago
So, I guess I just uninstall and wait for a rebuild?

Original comment by redou...@gmail.com on 18 Jun 2013 at 2:00

GoogleCodeExporter commented 9 years ago
Uninstalling, and reinstalling a 1.2.1 binary through the WPPM seemed to fix 
the problem. But there is nothing "done" about this error, and it's not a bug 
in matplotlib.
 Please verify the integrity of your matplotlib release when you get the chance.

Original comment by redou...@gmail.com on 18 Jun 2013 at 6:40

GoogleCodeExporter commented 9 years ago
It is a bug in matplotlib:v1.2.x. I submitted a PR at 
https://github.com/matplotlib/matplotlib/pull/2144

Original comment by cjgoh...@gmail.com on 21 Jun 2013 at 7:28