Search found 155 matches

by ramcdougal
Mon May 07, 2018 12:44 pm
Forum: Reaction-diffusion in NEURON
Topic: Negative concentrations
Replies: 5
Views: 2091

Re: Negative concentrations

Not directly. If you're not using mass-action, it's possible to write reactions that mathematically demand concentrations go negative. Can you tell us more about your reaction specification? Assuming some are not mass action, have you checked to make sure the reaction rates are not such that the con...
by ramcdougal
Tue Apr 24, 2018 11:01 am
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 2514

Re: gui not accessible and graphs not updating while running simulations from Python

This windows-specific bug also seems to only occur if the simulation is run from the terminal or from a script. If you were to click the "Run" button on the GUI (e.g. in Tools - Run Control), the graphs should update etc during the simulation. That may or may not be useful to you.
by ramcdougal
Tue Apr 24, 2018 10:53 am
Forum: Reaction-diffusion in NEURON
Topic: basic questions on RxD
Replies: 7
Views: 2405

Re: basic questions on RxD

(1) To get a concentration pointer in Python, use ._concentration_ref ; you can pass that to Vector.record . An example follows: from neuron import h, rxd from matplotlib import pyplot h.load_file('stdrun.hoc') dend = h.Section(name='dend') cyt = rxd.Region([dend], name='cyt', nrn_region='i') ca = r...
by ramcdougal
Thu Apr 19, 2018 9:29 am
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 2514

Re: gui not accessible and graphs not updating while running simulations from Python

Point of clarification: are you saying it runs without memory problems if you don't use that workaround, but crashes when you do? How long does each simulation run (h.tstop) for, and how many simulations are you running? If you would like, I can take a look at your code to try to track down the memo...
by ramcdougal
Wed Apr 18, 2018 4:43 pm
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 2514

Re: gui not accessible and graphs not updating while running simulations from Python

Both of your difficulties are due to a Windows-specific bug that keeps NEURON from releasing the GIL during integration, which blocks both the NEURON GUI and Matplotlib threads from executing... thus the graphs never get updated. Thanks for bringing this to our attention. A workaround for now (besid...
by ramcdougal
Tue Apr 17, 2018 9:45 am
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 2514

Re: gui not accessible and graphs not updating while running simulations from Python

Is this problem Spyder-specific, or does it also occur if you run the script from the regular Python prompt?

What operating system and NEURON version are you using?

The "from neuron import gui" is supposed to be all you need.
by ramcdougal
Tue Apr 10, 2018 10:16 pm
Forum: Reaction-diffusion in NEURON
Topic: Radial diffusion using RxD?
Replies: 2
Views: 1597

Re: Radial diffusion using RxD?

Yes but it's not currently anywhere near as clean as it should be. Diffusion between shells within a section can be implemented using MultiCompartmentReactions similarly to how one might do a leak between the ER and the cytosol. I don't have an example of this, but I'll try to make one tomorrow unle...
by ramcdougal
Tue Apr 03, 2018 9:04 pm
Forum: NEURON + Python
Topic: Recording Currents & Current Stimulation
Replies: 12
Views: 4031

Re: Recording Currents & Current Stimulation

The leak current in the hh mechanism is il_hh not ileak_hh.

Alternatively, a more Pythonic syntax is to access it via the mechanism; e.g. seg.hh.il (or seg.hh._ref_il if you need the pointer).
by ramcdougal
Fri Mar 23, 2018 2:02 pm
Forum: NEURON + Python
Topic: Truncation of floats upon loading .hoc file from ipython
Replies: 15
Views: 4668

Re: Truncation of floats upon loading .hoc file from ipython

In Spyder, if you store the value of the diam3d call and print it later, does that work? I'm wondering if you're seeing a return status and not the diameter itself.
by ramcdougal
Fri Mar 23, 2018 1:56 pm
Forum: NEURON + Python
Topic: Accessing neuron vectors stored in a python list
Replies: 3
Views: 1740

Re: Accessing neuron vectors stored in a python list

A quick clarification:

The underlying issue was that vector.record returns a status (typically 1.0) and not the vector, so the original version was simply recording all the statuses and discarding the vectors.
by ramcdougal
Wed Mar 21, 2018 12:21 pm
Forum: NEURON + Python
Topic: Truncation of floats upon loading .hoc file from ipython
Replies: 15
Views: 4668

Re: Truncation of floats upon loading .hoc file from ipython

This is puzzling because when you use h.load_file, the Python interpreter plays literally no role in loading the morphology (it's all done by the HOC interpreter instead). I was, unfortunately, not able to quickly reproduce your issue (details below), but I did have to modify the code slightly to ge...
by ramcdougal
Mon Mar 12, 2018 6:04 pm
Forum: NEURON + Python
Topic: pdb.set_trace() gives Segmentation Fault
Replies: 1
Views: 1676

Re: pdb.set_trace() gives Segmentation Fault

pdb works for me with your script if you run it with python hh_example.py instead of using nrngui. Make sure the neuron libraries are on your PYTHONPATH. (There are subtle differences about how console input etc is handled when you launch with nrngui instead of python directly, that I suspect is re...
by ramcdougal
Tue Jan 30, 2018 6:51 pm
Forum: NEURON + Python
Topic: Need Help Locating File + NEURON not reflecting changes
Replies: 4
Views: 1840

Re: Need Help Locating File + NEURON not reflecting changes

You should see the changes if you do Tools - RunControl. Does the window that opens up look as you expect? Not seeing the changes in whatever you're running is actually a good thing. It suggests that the window you're looking at is from a ses file (do you have any of those?) and can thus be modified...
by ramcdougal
Tue Jan 30, 2018 4:14 pm
Forum: NEURON + Python
Topic: Need Help Locating File + NEURON not reflecting changes
Replies: 4
Views: 1840

Re: Python Installation Issues + Need Help Locating File

The import failure means that Python can't find the neuron module. The easiest way to fix this is to reinstall NEURON, and when prompted be sure to agree to let NEURON update your PATH and PYTHONPATH. (If you just click through the install, this doesn't happen. You could also set the values manually...
by ramcdougal
Tue Nov 14, 2017 8:15 am
Forum: NEURON + Python
Topic: Finding Neuron install prefix from Python
Replies: 2
Views: 11370

Re: Finding Neuron install prefix from Python

To find the install directory use h.neuronhome() . This does not require the environment variable to be set, but it returns the value of the environment variable if it is set. The interpretation of the result is slightly system dependent, so be sure to read the documentation. To find the version us...