mlab.axes() causes exception in Mayavi 4.5.0
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
Hi, recently, I updated Mayavi from 4.4.4 to 4.5.0. Following the update, I am observing an exception when I use the `mlab` function `axes()`. Here is a test code (the line causing error is indicated by the comment):
```python
from mayavi import mlab
from numpy import pi, sin, cos, mgrid
dphi, dtheta = pi/250.0, pi/250.0
[phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7
x = r*sin(phi)*cos(theta)
y = r*cos(phi)
z = r*sin(phi)*sin(theta)
s = mlab.mesh(x, y, z)
mlab.axes(color=(0.9,0.9,0.9)) # LINE CAUSING ERROR
mlab.show()
```
When the run the above code in Windows and anaconda environment, I see the following error messages:
**Pop-up message (box):**
```python
Exception
In c:\anaconda\lib\site-packages\mayavi-4.5.0-py2.7-win-amd64.egg\tvtk\tvtk_base.py:569
TypeError: SetInputData argument 1:method requires a vtkDataSet, a vtkPolyDataNormals was provided. (in _wrap_call)
```
**Message in console window:**
```python
No handlers could be found for logger "mayavi.core.common"
Exception occurred in traits notification handler.
Please check the log file for details.
Exception occurred in traits notification handler for object: , trait: extent, old value: [0 0 0 0 0 0], new value: [-1.53801118 1.53801118 -2. 2.27326963 -1.53801118 1.53801118]
Traceback (most recent call last):
File "C:\Anaconda\lib\site-packages\traits\trait_notifiers.py", line 340, in __call__
self.handler( *args )
File "C:\Anaconda\lib\site-packages\mayavi-4.5.0-py2.7-win-amd64.egg\mayavi\tools\decorations.py", line 373, in _extent_changed
axes.module_manager.source.outputs[0].bounds
AttributeError: 'PolyDataNormals' object has no attribute 'bounds'
```
**Extra information**
*Environment in which the above exception occurs*
OS: Windows 10
Python installation: Python 2.7 installed using Anaconda
Mayavi package: mayavi 4.5.0 py27_0 menpo
VTK package: vtk 7.0.0 py27_0 menpo
PyQt package: pyqt 5.6.0 py27_1
*Environment in which the above code runs OK*
OS: Windows 7
Python installation: Python 2.7 installed using Anaconda
Mayavi package: mayavi 4.4.4 py27_0 menpo
VTK package: vtk 7.0.0 py27_0 menpo
PyQt package: pyqt 4.11.4 py27_5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.