How to create hoc_func_table in NEURON + Python

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
bwjmbb17
Posts: 16
Joined: Mon Apr 10, 2017 10:09 am

How to create hoc_func_table in NEURON + Python

Post by bwjmbb17 » Tue May 02, 2017 1:06 pm

I am curious how to create a hoc_func_table in Python. I am getting this error which I believe is due to me not creating the hoc_func_table properly. This error happens when I try to run my model:

NEURON: table not specified in hoc_func_table
 near line 0
 ^
        fadvance()
      advance()
    step()
  continuerun(5)
and others
Traceback (most recent call last):
  File "/home/neurosci3/Desktop/Cocaine_Model/src/main.py", line 158, in <module>
    h.run(t_stop)
RuntimeError: hoc error

The way a table was created in HOC was like this:

objref taum_
objref tauh_
objref vtau_
objref file_

file_ = new File ()

taum_ = new Vector(16,0)
tauh_ = new Vector(16,0)
vtau_ = new Vector(16,0)

sprint(dirstr, "taum_naf.txt")
file_.ropen (dirstr)
taum_.scanf(file_)
file_.close()

sprint(dirstr, "tauh_naf.txt")

file_.ropen (dirstr)
tauh_.scanf(file_)
file_.close()

sprint(dirstr, "vtau_naf.txt")
file_.ropen (dirstr)
vtau_.scanf(file_)
file_.close()

table_taumnaf_naf(taum_,vtau_)
table_tauhnaf_naf(tauh_,vtau_)

So I am wondering how to do these last two lines in python to link the tables and the mod files.
**table_taumnaf_naf()**

Any help is very appreciated.
bwjmbb17

hines
Site Admin
Posts: 1527
Joined: Wed May 18, 2005 3:32 pm

Re: How to create hoc_func_table in NEURON + Python

Post by hines » Tue May 02, 2017 8:28 pm

I expect the python statements

Code: Select all

from neuron import h
h.table_taumnaf_naf(taum_,vtau_)
h.table_tauhnaf_naf(tauh_,vtau_)
will suffice. if not, please send me the mod file and your python file that tries to construct the table.

Post Reply