Page 1 of 1

Loading NMODL mechanisms....

Posted: Mon Mar 24, 2008 9:07 pm
by gartland
I have been initializing hoc objects, loading in NMODL mechanisms and inserting the mechanisms semi-successfully using the lines:

Code: Select all

h('create soma')
h('access soma')
h('insert spike')
I can also use this syntax:

Code: Select all

But I can't mix and match (which would be fine and understandable), and I can't do this:

Code: Select all

This syntax is extremely useful for setting and getting the values of range variables and parameters later, but when I try to soma.insert() I receive the following error:
argument not a density mechanism name
It seems like maybe the mechanisms added with load_dll aren't visible to the insert command accessed with python dot notation? I also get similar errors when I try to do:

Code: Select all

h('insert spike')
Unfortunately I don't have a ton of NEURON experience in hoc so I can't tell if this is a problem with the way I'm trying to use the mechanism or the way that new mechanisms are imported into python. Do you have any idea why I can't insert mechanisms that I've loaded using nrn_load_dll()? Thanks for the help!


Posted: Sun Apr 06, 2008 4:03 pm
by hines
You're right. The python part is not updating its list of mechanisms after
nrn_load_dll. I'll fix that as soon as I can.
Are you happy merely with a subversion repository commit or do you need an installer.

Posted: Sun Apr 06, 2008 4:12 pm
by gartland
Cool thanks! I bet turning NEURON into a python module isn't much fun, but it sure does make it easier for me to use and integrate with other analysis routines etc.

I can probably figure out the subversion repository if you give me a couple pointers. I shouldn't have any trouble building the code once i get it on my machine though.

Posted: Sun Apr 06, 2008 4:32 pm
by hines
I should mention that you can avoid the
nrn_load_dll call by launching in the directory where you ran nrnivmodl. Or if you launch using nrniv (instead of ipython) then you can also use the -dll path args
to get things loaded early enough so python will know the mechanism names.

Posted: Sun Apr 06, 2008 5:49 pm
by hines
The changeset ... geset/2046
contains the fix. You can get the repository version using the instructions half way down at