Exemplo n.º 1
0
def get_section_properties(sec):
    out = OutputGrabber(sys.stdout)
    out.start()
    psection(sec)
    out.stop()
    raw_output = out.capturedtext

    lines = raw_output.split("\n")
    name, params = lines[0].split(" { ")
    for s in params.split():
        exec(s)  # nseg, L, Ra
    output = {name: {"nseg": nseg, "L": L, "Ra": Ra, "mechanisms": {}}}
    i = 1
    for line in lines[1:]:
        if "insert" in line:
            # consider doing this with a regexp
            start = line.find("insert") + 7
            lbracket = line.find("{")
            rbracket = line.find("}")
            mech_name = line[start:lbracket - 1]
            output[name]["mechanisms"][mech_name] = {}
            for s in line[lbracket + 1:rbracket].split():
                pname, value = s.split("=")
                output[name]["mechanisms"][mech_name][pname] = float(value)
    return output
Exemplo n.º 2
0
 def psection(self):
     if self.name != self.hoc_name:
         print "%s: " % self.name,
     neuron.psection(self)
Exemplo n.º 3
0
    def psection(cls):
        """Test neuron.psection(Section)"""

        s = h.Section(name='soma')
        neuron.psection(s)
Exemplo n.º 4
0
 def psection(self):
     if self.name != self.hoc_name:
         print "%s: " % self.name,
     neuron.psection(self)
Exemplo n.º 5
0
 def psection(self):
     if self.name != self.hoc_name:
         sys.stdout.write("%s:  " % self.name)
     neuron.psection(self)
Exemplo n.º 6
0
    def testpsection(self):
        """Test neuron.psection(Section)"""

        s = h.Section(name='soma')
        neuron.psection(s)
Exemplo n.º 7
0
 def psection(self):
     if self.name != self.hoc_name:
         sys.stdout.write("%s:  " % self.name)
     neuron.psection(self)