Пример #1
0


from morphforge.simulationanalysis.summaries.summariser_library import SummariserLibrary
from morphforgecontrib.simulation.membranemechanisms.hh_style.core.mmleak import MM_LeakChannel


class Summarise_MM_LeakChannel(object):
    
    @classmethod
    def toReportLab(cls, leakChannel, reportlabconfig, make_graphs):
        from reportlab.platypus import Paragraph, Table
        chl = leakChannel
    
        localElements = []
        localElements.append( Paragraph("Overview",reportlabconfig.styles['Heading3']) )
        
        # Summary:
        overviewTableData = [
                             ["Conductance", chl.conductance],
                             ["Reversal Potential",  chl.reversalpotential],
                            ]
        
        localElements.append( Table(overviewTableData, style=reportlabconfig.listTableStyle) )
        
        return localElements
    
    
    
SummariserLibrary.registerSummariser(channelBaseClass=MM_LeakChannel, summariserClass=Summarise_MM_LeakChannel)
Пример #2
0
            
                #Equations:
                eqns = [
                        "alpha(V) = (A+BV)/(C+exp( (V+D)/E) )",
                        "beta(V) = (A+BV)/(C+exp( (V+D)/E) )",
                        ]
                for eqn in eqns:
                    localElements.append( Paragraph(eqn,reportlabconfig.styles['Normal']) )  
                # Alpha Beta
                ReportLabTools.buildAlphaBetaTable( elements=localElements, 
                                         reportlabconfig=reportlabconfig, 
                                         title="Alpha", params=params[0] )   
                ReportLabTools.buildAlphaBetaTable( elements=localElements, 
                                         reportlabconfig=reportlabconfig, 
                                         title="Beta1", params=params[1] )
                
                
                if make_graphs:
                    # Figures:
                    fig = cls.PlotStateCurveSummary(alphaBetaChl, state, figsize=(5,5))
                    localElements.append( reportlabconfig.saveMPLToRLImage(fig, "somestate") )
                    import pylab
                    pylab.close( fig.fig )

            
            return localElements



SummariserLibrary.registerSummariser(channelBaseClass=MM_AlphaBetaChannel, summariserClass=Summarise_MM_AlphaBetaChannel)