intermittent 'numpy.bool_' object has no attribute '_mask' bug

Hi,

I am using matplotlib in a pyqt application, in which I am displaying an image on a FigureCanvas. My installation is Ubuntu 10.04-64bit.
This has been working like a charm for several months but recently my application has started crashing with the following trace:

File “/usr/lib/pymodules/python2.6/matplotlib/backends/backend_qt4agg.py”, line 83, in paintEvent
FigureCanvasAgg.draw(self)
File “/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py”, line 314, in draw
self.figure.draw(self.renderer)
File “/usr/lib/pymodules/python2.6/matplotlib/artist.py”, line 46, in draw_wrapper
draw(artist, renderer, *kl)
File “/usr/lib/pymodules/python2.6/matplotlib/figure.py”, line 773, in draw
for a in self.axes: a.draw(renderer)
File “/usr/lib/pymodules/python2.6/matplotlib/artist.py”, line 46, in draw_wrapper
draw(artist, renderer, *kl)
File “/usr/lib/pymodules/python2.6/matplotlib/axes.py”, line 1701, in draw
im.draw(renderer)
File “/usr/lib/pymodules/python2.6/matplotlib/artist.py”, line 46, in draw_wrapper
draw(artist, renderer, *kl)
File “/usr/lib/pymodules/python2.6/matplotlib/image.py”, line 237, in draw
im = self.make_image(renderer.get_image_magnification())
File “/usr/lib/pymodules/python2.6/matplotlib/image.py”, line 182, in make_image
x = self.to_rgba(self._A, self._alpha)
File “/usr/lib/pymodules/python2.6/matplotlib/cm.py”, line 166, in to_rgba
x = self.norm(x)
File “/usr/lib/pymodules/python2.6/matplotlib/colors.py”, line 763, in call
elif vmin==vmax:
File “/usr/lib/python2.6/dist-packages/numpy/ma/core.py”, line 3119, in eq
check.mask = mask
AttributeError: 'numpy.bool
’ object has no attribute ‘_mask’

Strangely the bug seems to be intermittent, i.e. rebooting seems to temporarily fix the issue, but it always returns.
Is this a known issue? Could I somehow fix this by reverting some of the Ubuntu packages to older versions?

Thanks.

Patrick

No idea, but if you post a complete, minimal example that reproduces
the problem, the odds of a developer fixing it are much higher.

Ryan

···

On Fri, Oct 22, 2010 at 6:07 AM, Patrick Sauer <pat05.mlst@...149...> wrote:

Hi,

I am using matplotlib in a pyqt application, in which I am displaying an
image on a FigureCanvas. My installation is Ubuntu 10.04-64bit.
This has been working like a charm for several months but recently my
application has started crashing with the following trace:

File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_qt4agg.py",
line 83, in paintEvent
FigureCanvasAgg.draw(self)
File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
line 314, in draw
self.figure.draw(self.renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in
draw_wrapper
draw(artist, renderer, *kl)
File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 773, in
draw
for a in self.axes: a.draw(renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in
draw_wrapper
draw(artist, renderer, *kl)
File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1701, in draw
im.draw(renderer)
File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in
draw_wrapper
draw(artist, renderer, *kl)
File "/usr/lib/pymodules/python2.6/matplotlib/image.py", line 237, in draw
im = self.make_image(renderer.get_image_magnification())
File "/usr/lib/pymodules/python2.6/matplotlib/image.py", line 182, in
make_image
x = self.to_rgba(self._A, self._alpha)
File "/usr/lib/pymodules/python2.6/matplotlib/cm.py", line 166, in to_rgba
x = self.norm(x)
File "/usr/lib/pymodules/python2.6/matplotlib/colors.py", line 763, in
__call__
elif vmin==vmax:
File "/usr/lib/python2.6/dist-packages/numpy/ma/core.py", line 3119, in
__eq__
check._mask = mask
AttributeError: 'numpy.bool_' object has no attribute '_mask'

Strangely the bug seems to be intermittent, i.e. rebooting seems to
temporarily fix the issue, but it always returns.
Is this a known issue? Could I somehow fix this by reverting some of the
Ubuntu packages to older versions?

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma