Unfortunately I can't post a concise test case since I'm having a lot of trouble with consistent reproducibility.
But I'd had a problem where I import some of my python code from hoc and end up having some trouble with the GUI. No errors or warnings show up, and the all hoc code after the python statement runs fine, but the panel associated with the code (created by a subsequent showopt call) simply doesn't show up.
I've narrowed it down to the python code calling "import neuron". Thus I have cases where I add the line
nrnpython("import neuron")
to my hoc code and do nothing else (I don't even call anymore python), and the panel doesn't show up. Are there some kind of side-effects going on when I import neuron that may be breaking the gui?
Note this isn't very reproducible, I've had a number of cases where I've thought I haven't changed anything and the bug simply vanishes for a while (on that note I'm running neuron straight from the repo and Ubuntu 10.10)
import neuron has side effects?
Moderator: hines
-
- Site Admin
- Posts: 6289
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: import neuron has side effects?
Does this mean you obtained the latest development code from the mercurial repository, and built NEURON from that?aluchko wrote:I'm running neuron straight from the repo
Re: import neuron has side effects?
My repo is based off of Tue Nov 02 12:23:11 2010 -0400ted wrote:Does this mean you obtained the latest development code from the mercurial repository, and built NEURON from that?aluchko wrote:I'm running neuron straight from the repo
476:3ad72b90db90
I'll pull a newer repo tomorrow but I can't tonight as I just realized my source repo is on a machine that can't reach the outside world :/
Re: import neuron has side effects?
So far things are too vague for me to form an opinion. The only condition I am aware of where there is a problem with the gui is when
one launches nrniv and in the python world invokes
from neuron import gui
That is intended only for launching python when the event loop is controlled by the python world instead of by InterViews. It starts a timer which
calls the InterViews event handler every 0.1 seconds. The problem is that when nrniv is launched, the InterViews event handler and hoc are already
running in thread 0, and suddenly calling the event handler from another thread can cause troubles.
one launches nrniv and in the python world invokes
from neuron import gui
That is intended only for launching python when the event loop is controlled by the python world instead of by InterViews. It starts a timer which
calls the InterViews event handler every 0.1 seconds. The problem is that when nrniv is launched, the InterViews event handler and hoc are already
running in thread 0, and suddenly calling the event handler from another thread can cause troubles.
Re: import neuron has side effects?
I've tried from neuron import gui, hoc, h, help, and test, and all cause the problem, "import numby" however doesn't cause an issue so it's definitely something going on with the import neuron. Is there somewhere in the code I should look to get a better idea of what's being executed under the hood?
My changes aren't really 7.2 specific so I'll try backporting to 7.1 and see if I still have the problem.
My changes aren't really 7.2 specific so I'll try backporting to 7.1 and see if I still have the problem.
Re: import neuron has side effects?
Why don't we take this to email. Send me <michael dot hines at yale.edu> all the code necessary to exhibit
the problem along with instructions about how to launch.
the problem along with instructions about how to launch.