Ejemplo n.º 1
0
def load_neuroml():

    redocs = []

    for i, xmlfile in enumerate(
            NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel()):

        try:
            print "XMLFILE:", xmlfile
            eqnset, chl_info, default_filename = ChannelMLReader.BuildEqnset(
                xmlfile)

            # Build the pdf for the channel:
            eqnset_redoc = MRedocWriterVisitor.build(eqnset)

            #Build the NModl for the channel:
            txt, buildparameters = nmodl.WriteToNMODL(eqnset)

            section = SectionNewPage(
                "Import from: %s" % "/".join(xmlfile.split('/')[-3:]),
                Section("Original XML:", VerbatimBlock(open(xmlfile).read())),
                eqnset_redoc, Section("Generated Modfile", VerbatimBlock(txt)))

            redocs.append(section)

        except NeuroUnitsImportNeuroMLNotImplementedException, e:
            pass

        if i > 1:
            break
Ejemplo n.º 2
0
def main():

    # Clear out the old directory:
    if os.path.exists(html_output_dir):
        shutil.rmtree(html_output_dir)
    LocMgr.ensure_dir_exists(html_output_dir)

    root_html = Join(html_output_dir, "index.html")

    data = []
    for xmlfile in NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel():


        #class NeuroMLDataLibrary(object):
#
#            def get_channelMLV1Files(self):


        #if xmlfile != "/home/michael/hw_to_come/morphforge/src/test_data/NeuroML/V1/example_simulations/GranCellLayer_NeuroML/Golgi_NaF_CML.xml":
        #        continue


        #if xmlfile != "/home/michael/hw_to_come/morphforge/src/test_data/NeuroML/V1/example_simulations/MainenEtAl_PyramidalCell_NeuroML/K_ChannelML.xml":
        #        continue
        #if xmlfile != "/home/michael/hw_to_come/morphforge/src/test_data/NeuroML/V1/example_simulations/CA1PyramidalCell_NeuroML/kdr.xml":
        #    continue

        # Compare:
        data.append(compareNeuroMLChl(xmlfile))

        # Re-update the html:
        with open(root_html, "w") as f:
            f.write(Template(root_html_tmpl, {'data': data}).respond())
Ejemplo n.º 3
0
def load_neuroml():

    redocs = []

    for i, xmlfile in enumerate(NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel()):

        try:
            print "XMLFILE:", xmlfile
            eqnset, chl_info, default_filename = ChannelMLReader.BuildEqnset(xmlfile)

            # Build the pdf for the channel:
            eqnset_redoc = MRedocWriterVisitor.build(eqnset)

            # Build the NModl for the channel:
            txt, buildparameters = nmodl.WriteToNMODL(eqnset)

            section = SectionNewPage(
                "Import from: %s" % "/".join(xmlfile.split("/")[-3:]),
                Section("Original XML:", VerbatimBlock(open(xmlfile).read())),
                eqnset_redoc,
                Section("Generated Modfile", VerbatimBlock(txt)),
            )

            redocs.append(section)

        except NeuroUnitsImportNeuroMLNotImplementedException, e:
            pass

        if i > 1:
            break
Ejemplo n.º 4
0
def main():

    # Clear out the old directory:
    if os.path.exists(html_output_dir):
        shutil.rmtree(html_output_dir)
    LocMgr.ensure_dir_exists(html_output_dir)

    root_html = Join(html_output_dir, "index.html")

    data = []
    for xmlfile in NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel():

        # Compare:
        data.append(compareNeuroMLChl(xmlfile))

        # Re-update the html:
        with open(root_html, "w") as f:
            f.write(Template(root_html_tmpl, {'data': data}).respond())

        #break
    print 'Done'
Ejemplo n.º 5
0

from neurounits.writers.writer_ast_to_mredoc import MRedocWriterVisitor
from neurounits.tools import nmodl

from util_test_locations import TestLocations

from os.path import join as Join


def load_neuroml():
	from mredoc.objects.core import Document, TableOfContents, SectionNewPage, Section, VerbatimBlock

    redocs = []

    for (i, xmlfile) in enumerate(NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel()):

        try:
            print 'XMLFILE:', xmlfile
            (eqnset, chl_info, default_filename) = ChannelMLReader.BuildEqnset(xmlfile)

            # Build the pdf for the channel:
            eqnset_redoc = MRedocWriterVisitor.build(eqnset)

            # Build the NModl for the channel:
            (txt, buildparameters) = nmodl.WriteToNMODL(eqnset)

            section = SectionNewPage("Import from: %s"% "/".join(xmlfile.split('/')[-3:]),
                        Section("Original XML:", VerbatimBlock(open(xmlfile).read() ) ),
                        eqnset_redoc,
                        Section("Generated Modfile",VerbatimBlock(txt) ) )



i=0

ok = []
fail1 = []
fail2 = []
fail3 = []





for xmlfile in NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel():



        #print i, xmlfile
        if xmlfile in [
                       # has a suffix: pas, which neuron chokes on:
                       "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/CA1PyramidalCell_NeuroML/pas.xml",
                       "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/Thalamocortical_NeuroML/pas.xml",
                       # Choked on build for some reason:
                       "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/SolinasEtAl_GolgiCell_NeuroML/KAHP_CML.xml",
                       "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/VervaekeEtAl-GolgiCellNetwork_NeuroML/KAHP_CML.xml",

                       "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/CA1PyramidalCell_NeuroML/na3.xml",

                       "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/Thalamocortical_NeuroML/ar.xml",
                                   simtype="_NeuroUnit")

    return {
        SimMode.XSL: resA,
        SimMode.NeuroUnit: resB,
    }


i = 0

ok = []
fail1 = []
fail2 = []
fail3 = []

for xmlfile in NeuroMLDataLibrary.get_channelMLV1FilesWithSingleChannel():

    #print i, xmlfile
    if xmlfile in [
            # has a suffix: pas, which neuron chokes on:
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/CA1PyramidalCell_NeuroML/pas.xml",
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/Thalamocortical_NeuroML/pas.xml",
            # Choked on build for some reason:
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/SolinasEtAl_GolgiCell_NeuroML/KAHP_CML.xml",
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/VervaekeEtAl-GolgiCellNetwork_NeuroML/KAHP_CML.xml",
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/CA1PyramidalCell_NeuroML/na3.xml",
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/Thalamocortical_NeuroML/ar.xml",

            # Funny alpha term that I don't get:
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/Thalamocortical_NeuroML/kc_fast.xml",
            "/home/michael/hw/morphforge/src/test_data/NeuroML/V1/example_simulations/Thalamocortical_NeuroML/kc.xml",