AttributeError: 'OrientationMarkerWidget' object has no attribute 'set_viewport' when running mayavi/examples/mayavi/interactive/subclassing_mayavi_application.py
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 316
- Avg merge
- 7h 44m
- Merged PRs (30d)
- 5
Description
when running mayavi/examples/mayavi/interactive/subclassing_mayavi_application.py an AttributeError: 'OrientationMarkerWidget' object has no attribute 'set_viewport' will rise, althought the window will show up properly
Replication: python mayavi/examples/mayavi/interactive/subclassing_mayavi_application.py
trace:
```
(py311) (base) cyliu@aus552cyliu mayavi % python3.11 examples/mayavi/interactive/mlab_visual.py
2023-05-11 15:42:28.665 Python[7105:179225] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/2z/kylzj9s92y71cxscmljmpqrh0000gt/T/org.python.python.savedState
Traceback (most recent call last):
File "/Users/cyliu/Documents/3.11_test/mayavi/examples/mayavi/interactive/mlab_visual.py", line 37, in
b2 = visual.box(x=4., color=visual.color.red)
^^^^^^^^^^^^
AttributeError: module 'tvtk.tools.visual' has no attribute 'color'
(py311) (base) cyliu@aus552cyliu mayavi % cd ..
(py311) (base) cyliu@aus552cyliu 3.11_test % python3.11 mayavi/examples/mayavi/interactive/subclassing_mayavi_application.py
2023-05-11 15:45:29.791 Python[7150:180823] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/2z/kylzj9s92y71cxscmljmpqrh0000gt/T/org.python.python.savedState
/Users/cyliu/Documents/3.11_test/pyface/pyface/ui/qt/workbench/split_tab_widget.py:125: UserWarning: Attempting to restore to a non-empty widget.
warnings.warn("Attempting to restore to a non-empty widget.")
Traceback (most recent call last):
File "/Users/cyliu/Documents/3.11_test/pyface/pyface/ui/qt/gui.py", line 190, in _dispatch
self._callable(*self._args, **self._kw)
File "/Users/cyliu/Documents/3.11_test/mayavi/examples/mayavi/interactive/subclassing_mayavi_application.py", line 67, in run
a.marker.set_viewport(0.0, 0.8, 0.2, 1.0)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'OrientationMarkerWidget' object has no attribute 'set_viewport'
```
env:
python3.11 MacOS
Package Version Editable project location
------------------ ----------- -----------------------------------------
apptools 5.2.0
attrdict 2.0.1
attrdict3 2.0.2
blosc2 2.0.0
celiagg 2.1.3
certifi 2022.12.7
chaco 5.1.0 /Users/cyliu/Documents/3.11_test/chaco
charset-normalizer 3.1.0
configobj 5.0.8
contourpy 1.0.7
cPython 0.0.6
cycler 0.11.0
Cython 0.29.34
dnspython 2.3.0
enable 5.4.0.dev38 /Users/cyliu/Documents/3.11_test/enable
envisage 7.0.3
fonttools 4.39.2
h5py 3.8.0
idna 3.4
joblib 1.2.0
kiwisolver 1.4.4
matplotlib 3.7.1
mayavi 4.8.2.dev0 /Users/cyliu/Documents/3.11_test/mayavi
msgpack 1.0.5
numexpr 2.8.4
numpy 1.24.2
packaging 23.1
pandas 1.5.3
Pillow 9.4.0
pip 23.1
py-cpuinfo 9.0.0
PyAudio 0.2.13
pyface 8.0.0 /Users/cyliu/Documents/3.11_test/pyface
pygarrayimage 1.0
pyglet 2.0.5 /Users/cyliu/Documents/3.11_test/pyglet
Pygments 2.14.0
pymongo 4.3.3
pyparsing 3.0.9
PySide6 6.4.3
PySide6-Addons 6.4.3
PySide6-Essentials 6.4.3
python-dateutil 2.8.2
pythonw 3.0.3
pytz 2023.2
reportlab 3.6.12
requests 2.28.2
scikit-learn 1.2.2
scipy 1.10.1
setuptools 65.6.3
shiboken6 6.4.3
six 1.16.0
tables 3.8.0
threadpoolctl 3.1.0
traits 6.4.1
traitsui 8.0.0.dev0 /Users/cyliu/Documents/3.11_test/traitsui
urllib3 1.26.15
vtk 9.2.6
wxPython 4.2.0
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with mayavi/examples/mayavi/interactive/subclassing_mayavi_application.py, focusing on line 67 where a.marker.set_viewport is called. Read the OrientationMarkerWidget API and the surrounding example code to identify the supported viewport interface. Done means the example runs without this AttributeError and the marker still appears in the intended viewport.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100