Search found 267 matches
- Thu Sep 29, 2016 12:00 pm
- Forum: NEURON + Python
- Topic: Python object as argument of hoc function
- Replies: 4
- Views: 12843
Re: Python object as argument of hoc function
Object arguments (doesn't matter if HOC objects or Python objects) to HOC functions are accessed using positional notation with $o instead of just $. e.g. $o1 instead of $1. A complete example, where for laziness I define the HOC function via h(): from neuron import h # declare a HOC function that j...
- Fri Jun 10, 2016 9:41 am
- Forum: Employment and educational opportunities
- Topic: Postdoc Postion: Multiscale Modeling Methods & Simulator Dev
- Replies: 0
- Views: 35405
Postdoc Postion: Multiscale Modeling Methods & Simulator Dev
Mosaic Multiscale Modeling Postdoctoral Fellowship available for combining cell biology (reaction-diffusion) and electrophysiology in the NEURON simulator (neuron.yale.edu). The position involves an unusual mix of software engineering and science, depending on the candidate’s background and interest...
- Fri May 20, 2016 2:51 pm
- Forum: Anatomically detailed models
- Topic: Guidance on plotting cell's geometry in Python?
- Replies: 4
- Views: 18461
Re: Guidance on plotting cell's geometry in Python?
where I expect methods to be associated with the section objects and instead they're accessed through the hoc object (my terminology here might be wrong). Is there some guiding rule as to why this is the case? This is a legacy artifact of NEURON's transition from a HOC-based interface which did not...
- Fri May 20, 2016 9:08 am
- Forum: NEURON + Python
- Topic: import swc file for network simulation
- Replies: 2
- Views: 10200
Re: import swc file for network simulation
For an example addressing both (1) and (2), see the load_swc function in https://github.com/ahwillia/PyNeuron-Toolbox/blob/master/PyNeuronToolbox/morphology.py You linked to a prior thread about using SWC morphologies. Remember Ted's cautions : always check the morphology to make sure it is reasonab...
- Thu May 05, 2016 10:32 am
- Forum: NEURON + Python
- Topic: AP propagates too slow
- Replies: 7
- Views: 7650
Re: AP propagates too slow
To set the temperature via Python:
With important exceptions, the Python interface is essentially the same as the HOC interface, but prefaced with an "h."
Code: Select all
h.celsius = 20
- Mon May 02, 2016 4:38 pm
- Forum: UNIX/Linux
- Topic: Issue compiling ...geometry3d/surfaces.cpp NEURON v7.4
- Replies: 3
- Views: 11897
Re: Issue compiling ...geometry3d/surfaces.cpp NEURON v7.4
Here's a patch that fixes the issue present when compiling with newer versions of cython: it changes the tuple position into a list. diff -r b8295be34ae5 share/lib/python/neuron/rxd/geometry3d/surfaces.pyx --- a/share/lib/python/neuron/rxd/geometry3d/surfaces.pyx Mon May 02 14:29:44 2016 +0200 +++ b...
- Sat Apr 30, 2016 9:27 am
- Forum: NEURON + Python
- Topic: AP propagates too slow
- Replies: 7
- Views: 7650
Re: AP propagates too slow
Is the morphology (in particular, the diameter) the same?
- Tue Apr 26, 2016 3:41 pm
- Forum: NEURON + Python
- Topic: Export a subset of loaded morphology
- Replies: 3
- Views: 7035
Re: Export a subset of loaded morphology
Almost. In my example, parent is the index of the parent section; parent_loc is the normalized position within that section. Thus: parent_sec = sec_list[sd['parent']] # not parent_loc, grab from sec_list not sec sec.connect(parent_sec(sd['parent_loc']), sd['section_orientation']) This last line is i...
- Tue Apr 26, 2016 10:31 am
- Forum: NEURON + Python
- Topic: Export a subset of loaded morphology
- Replies: 3
- Views: 7035
Re: Export a subset of loaded morphology
To the best of my knowledge, there is no built-in 1-line solution, but: The key functions and classes are h.parent_connection , h.section_orientation , and h.SectionRef . It's a little tricky to do this right because of the distinction between a "true parent" and a mere "parent"....
- Fri Mar 11, 2016 6:00 pm
- Forum: MSWin
- Topic: Neuron as a Python Module Redux
- Replies: 8
- Views: 26456
Re: Neuron as a Python Module Redux
Try permanently setting the PATH environment variable for the system instead of through the command line. (See below.) In addition, make sure you are using the 32 bit NEURON to match your 32 bit Python. For completeness, I just tried the following on a machine starting from no OS, and it worked: Ins...
- Sat Mar 05, 2016 10:59 am
- Forum: MSWin
- Topic: Neuron as a Python Module Redux
- Replies: 8
- Views: 26456
Re: Neuron as a Python Module Redux
Open a DOS prompt (cmd) and try running: set PATH=c:\nrn\bin;%PATH% Then (in the same window), type "python" and "import neuron". Does that work? If so, you can make the change permanent by adding c:\nrn\bin to the PATH environment variable; instructions are available here and el...
- Wed Dec 30, 2015 10:40 pm
- Forum: Reaction-diffusion in NEURON
- Topic: calcium diffusion in different shells
- Replies: 8
- Views: 9888
Re: calcium diffusion in different shells
You are right that cai as defined in those models is not the average calcium concentration. That is by design. cai and cao are the two calcium concentrations made available to ion channel, pump, etc mechanisms defined in NMODL via USEION. As such, they are the concentrations that the mechanism can &...
- Fri Oct 02, 2015 11:07 am
- Forum: NEURON + Python
- Topic: Problem with hclass in NEURON 7.4
- Replies: 5
- Views: 4358
Re: Problem with hclass in NEURON 7.4
One more change should fix that, this time in share/lib/python/neuron/__init__.py : Replace the __new__ method (starts at line 168) with def __new__(cls, *args, **kwds): kwds2 = {'hocbase': cls.htype} if 'sec' in kwds: kwds2['sec'] = kwds['sec'] return hoc.HocObject.__new__(cls, *args, **kwds2) (Dep...
- Thu Oct 01, 2015 11:40 am
- Forum: NEURON + Python
- Topic: Problem with hclass in NEURON 7.4
- Replies: 5
- Views: 4358
Re: Problem with hclass in NEURON 7.4
Sorry about that; ironically, this was caused by an attempt to improve error checking in the hocobj_call function. A fix is to add the line: PyDict_DelItemString(kwds, "hocbase"); at line 182 in src/nrnpython/nrnpy_hoc.cpp (right before the call to hocobj_call). We'll try to update the rep...
- Tue Jun 16, 2015 4:23 pm
- Forum: Adding new mechanisms and functions to NEURON
- Topic: Segmentation Violation when loading new mechanism
- Replies: 2
- Views: 6650
Re: Segmentation Violation when loading new mechanism
From the comment, note that: Pointers specified at the hoc level must be used to connect the extracellular mechanism's e_extracellular and i_membrane to this mechanism's ex and im, respectively. If you're not setting the pointers, then they won't point anywhere meaningful. When the model tries to us...