Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def ptype():
msname = h.ref('')
propList = {}
for i, mechtype in enumerate(['mechs','pointps']):
mt = h.MechanismType(i) # either distributed mechs (0) or point process (1)
propList[mechtype] = {}
for j in range(int(mt.count())):
mt.select(j)
mt.selected(msname)
print('\n\n', msname[0], ' mechanismtype=%d' % j)
pname(msname[0])
ms = h.MechanismStandard(msname[0], 1) # PARAMETER (modifiable)
propList[mechtype][msname[0]] = []
propName = h.ref('')
for prop in range(int(ms.count())):
k = ms.name(propName, prop)
propList[mechtype][msname[0]].append(propName[0])
print(propList)
def get_rangevars(mech_name):
ms = h.MechanismStandard(mech_name)
suffix = '_' + mech_name
lensuffix = len(suffix)
mname = h.ref('')
result = []
for i in range(int(ms.count())):
ms.name(mname, i)
my_mname = mname[0]
if my_mname.endswith(suffix):
my_mname = my_mname[:-lensuffix]
result.append({'type': 'NEURONMECH', 'mech': mech_name, 'var': my_mname, 'name': mech_name + '.' + my_mname})
return result
def mechVarList ():
msname = h.ref('')
varList = {}
for i, mechtype in enumerate(['mechs','pointps']):
mt = h.MechanismType(i) # either distributed mechs (0) or point process (1)
varList[mechtype] = {}
for j in range(int(mt.count())):
mt.select(j)
mt.selected(msname)
ms = h.MechanismStandard(msname[0], 1) # PARAMETER (modifiable)
varList[mechtype][msname[0]] = []
propName = h.ref('')
for var in range(int(ms.count())):
k = ms.name(propName, var)
varList[mechtype][msname[0]].append(propName[0])
return varList
def mechVarList ():
msname = h.ref('')
varList = {}
for i, mechtype in enumerate(['mechs','pointps']):
mt = h.MechanismType(i) # either distributed mechs (0) or point process (1)
varList[mechtype] = {}
for j in xrange(int(mt.count())):
mt.select(j)
mt.selected(msname)
ms = h.MechanismStandard(msname[0], 1) # PARAMETER (modifiable)
varList[mechtype][msname[0]] = []
propName = h.ref('')
for var in xrange(int(ms.count())):
k = ms.name(propName, var)
varList[mechtype][msname[0]].append(propName[0])
return varList
def mechVarList ():
msname = h.ref('')
varList = {}
for i, mechtype in enumerate(['mechs','pointps']):
mt = h.MechanismType(i) # either distributed mechs (0) or point process (1)
varList[mechtype] = {}
for j in range(int(mt.count())):
mt.select(j)
mt.selected(msname)
ms = h.MechanismStandard(msname[0], 1) # PARAMETER (modifiable)
varList[mechtype][msname[0]] = []
propName = h.ref('')
for var in range(int(ms.count())):
k = ms.name(propName, var)
varList[mechtype][msname[0]].append(propName[0])
return varList
def ptype():
msname = h.ref('')
propList = {}
for i, mechtype in enumerate(['mechs','pointps']):
mt = h.MechanismType(i) # either distributed mechs (0) or point process (1)
propList[mechtype] = {}
for j in range(int(mt.count())):
mt.select(j)
mt.selected(msname)
print('\n\n', msname[0], ' mechanismtype=%d' % j)
pname(msname[0])
ms = h.MechanismStandard(msname[0], 1) # PARAMETER (modifiable)
propList[mechtype][msname[0]] = []
propName = h.ref('')
for prop in range(int(ms.count())):
k = ms.name(propName, prop)
propList[mechtype][msname[0]].append(propName[0])
print(propList)
def mechVarList():
msname = h.ref('')
varList = {}
for i, mechtype in enumerate(['mechs', 'pointps']):
# either distributed mechs (0) or point process (1)
mt = h.MechanismType(i)
varList[mechtype] = {}
for j in range(int(mt.count())):
mt.select(j)
mt.selected(msname)
ms = h.MechanismStandard(msname[0], 1) # PARAMETER (modifiable)
varList[mechtype][msname[0]] = []
propName = h.ref('')
for var in range(int(ms.count())):
k = ms.name(propName, var)
varList[mechtype][msname[0]].append(propName[0])
return varList
def psection(sec):
from neuron import h
try:
from neuron import rxd
from neuron.rxd import region, species
from neuron.rxd import rxd as rxd_module
have_rxd = True
except:
have_rxd = False
results = {}
mname = h.ref('')
# point processes
pps = {}
mt = h.MechanismType(1)
for i in range(int(mt.count())):
mt.select(i)
mypps = set()
pp = mt.pp_begin(sec=sec)
while pp is not None:
mypps.add(pp)
pp = mt.pp_next()
if mypps:
mt.selected(mname)
pps[mname[0]] = mypps
results['point_processes'] = pps