enthought / enthought/mayavi

f.scene.light_manager.light_mode AttributeError when using %run in ipython

Open
#550 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

I saved the following python script in a file called `light_manager-test.py`:
```python
import mayavi.mlab as mlab
f=mlab.figure()
f.scene.light_manager.light_mode='vtk'
```
When from the ipython prompt I type `%run light_manager-test.py`, I get an AttributeError. `f.scene.light_manager` returns `none`.

However, the same commands work fine if I enter them into ipython line by line:

![image](https://user-images.githubusercontent.com/4534080/31252736-2989dfa8-a9f0-11e7-8ed7-73875f1925c7.png)

Why might this be? Should I try different backends? This is using qt.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the commands in light_manager-test.py through IPython's `%run` with the Qt backend, then compare that with entering them line by line. Investigate why `f.scene.light_manager` is `None` only during `%run`; done means the cause and a concrete fix or supported backend guidance are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.