示例#1
0
def test__parse_sections():
    string_section = textwrap.dedent(u'''(FilledCircle
           (Color RGB (64, 0, 128))
           (Name "Marker 11")
           (Set "axons")
           ( -189.59    55.67    28.68     0.12)  ; 1
           )  ;  End of markers

           ( (Color Yellow)
           (Axon)
           (Set "axons")
           (  -40.54  -113.20   -36.61     0.12)  ; Root
           (  -40.54  -113.20   -36.61     0.12)  ; 1, R
           Generated
           )  ;  End of tree
        ''')
    morph_fd = StringIO(string_section)
    sections = nasc._parse_sections(morph_fd)
    eq_(len(sections), 1)  # FilledCircle is ignored
    eq_(sections[0], [['Axon'], ['-40.54', '-113.20', '-36.61', '0.12'],
                      ['-40.54', '-113.20', '-36.61', '0.12'], 'Generated'])
示例#2
0
def test__parse_sections():
    string_section = textwrap.dedent(
        '''(FilledCircle
           (Color RGB (64, 0, 128))
           (Name "Marker 11")
           (Set "axons")
           ( -189.59    55.67    28.68     0.12)  ; 1
           )  ;  End of markers
           
           ( (Color Yellow)
           (Axon)
           (Set "axons")
           (  -40.54  -113.20   -36.61     0.12)  ; Root
           (  -40.54  -113.20   -36.61     0.12)  ; 1, R
           Generated
           )  ;  End of tree
        ''')
    morph_fd = StringIO(string_section)
    sections = nasc._parse_sections(morph_fd)
    eq_(len(sections), 1)  # FilledCircle is ignored
    eq_(sections[0], [['Axon'],
                      ['-40.54', '-113.20', '-36.61', '0.12'],
                      ['-40.54', '-113.20', '-36.61', '0.12'],
                      'Generated'])