Search found 7 matches

by nicholasmg
Fri May 15, 2020 11:47 am
Forum: NEURON + Python
Topic: range morphology and mechanism syntax for sections in python
Replies: 9
Views: 5226

Re: range morphology and mechanism syntax for sections in python

thanks ted, here are the results: from neuron import h import numpy as np axon = h.Section(name="axon") axon.L = 10 axon.diam = 2 axon.nseg = 5 axon.insert("hh") axon.psection() # {'point_processes': {}, # 'density_mechs': {'hh': {'gnabar': [0.12, 0.12, 0.12, 0.12, 0.12], # 'gkba...
by nicholasmg
Tue May 12, 2020 11:57 pm
Forum: NEURON + Python
Topic: range morphology and mechanism syntax for sections in python
Replies: 9
Views: 5226

Re: range morphology and mechanism syntax for sections in python

Thanks a lot for the detailed responses and help ted and ramcdougal! Ted- it is encouraging to know that I am not the only one who found that syntax confusing! I agree with you and Guido (and the zen of python) that clarity is much more important than cleverness. I had no intention of using the conf...
by nicholasmg
Tue May 12, 2020 10:18 am
Forum: NEURON + Python
Topic: range morphology and mechanism syntax for sections in python
Replies: 9
Views: 5226

Re: range morphology and mechanism syntax for sections in python

thanks! that is helpful. So within a section, whatever nseg you set is as fine grained as you can get in terms of specifying morphology or mechanisms within a section? I see a lot of hoc code specifying seemingly arbitrary ranges for mechanisms and sizes like this: //hoc axon{ gbar_na16(0 : 0.168 ) ...
by nicholasmg
Mon May 11, 2020 11:26 pm
Forum: NEURON + Python
Topic: range morphology and mechanism syntax for sections in python
Replies: 9
Views: 5226

range morphology and mechanism syntax for sections in python

I am trying to replicate the hoc syntax for specifying a range along a section as described in the documentation for diam in hoc syntax. Specifically, if I want the diameter of a section to vary from 1.5um to 0.5um along the length, according to the link above I would specify this as: // hoc diam(0:...
by nicholasmg
Wed Apr 29, 2020 5:43 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: using compiled mod files from python script in a different direcory
Replies: 2
Views: 10387

using compiled mod files from python script in a different direcory

I am trying to organize my code for a simulation which uses several external mod files. I compile the mod files using nrnivmodl (Mac OS) and can use the channels without a problem as long as the nrnivmodl generated x86_64 directory is in the working directory from which I start my python script. How...
by nicholasmg
Sun Mar 01, 2020 1:15 pm
Forum: UNIX/Linux
Topic: Failed to run neuron inside virtual environment in Ubuntu18 with Anaconda (PATH issue?)
Replies: 3
Views: 14962

Re: Failed to run neuron inside virtual environment in Ubuntu18 with Anaconda (PATH issue?)

I just figured this out for myself, if you want to use NEURON from python and you do not want PYTHONPATH set globally (contaminating all your environments) you can remove the PYTHONPATH declaration from your .bashrc and set it automatically within your virtual environment upon activation and un-set ...