Пример #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
Пример #2
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
Пример #3
0
def document_eqnsets(individual_reports=True):

    all_redocs = []

    for f in TestLocations.getEqnSetFiles():
        f_basename = os.path.splitext( os.path.basename(f))[0]

        # Load the EqnSet:
        library_manager = NeuroUnitParser.File( open(f).read(), name=f_basename )

        # Create the documentation:
        local_redoc = MRedocWriterVisitor.build( library_manager)

        # Create a local documentation file:
        if individual_reports:
            doc = Document(TableOfContents(), local_redoc)
            doc.to_pdf( Join(TestLocations.getTestOutputDir(), 'eqnsets_%s.pdf' %f_basename  ) )

        # Add it to single large file:
        all_redocs.append( local_redoc )

    return all_redocs
Пример #4
0
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) ) )

            redocs.append(section)
        except NeuroUnitsImportNeuroMLNotImplementedException, e:

            pass

        if i > 1: