##Equations: #eqns = [ # "alpha(V) = (A+BV)/(C+exp((V+D)/E))", # "beta(V) = (A+BV)/(C+exp((V+D)/E))", # ] #for eqn in eqns: # local_elements.append(Paragraph(eqn, reportlabconfig.styles['Normal'])) # Alpha Beta #ReportLabTools.buildInfTauInterpolatedTable(elements=local_elements, # reportlabconfig=reportlabconfig, # title="Alpha", params=params[0]) #ReportLabTools.buildInfTauInterpolatedTable(elements=local_elements, # reportlabconfig=reportlabconfig, # title="Beta1", params=params[1]) # Figures: if make_graphs: fig = cls.plot_state_curve_summary(alphabeta_chl, state, figsize=(7, 7)) local_elements.append(reportlabconfig.save_mpl_to_rl_image(fig, "somestate")) fig.close() return local_elements SummariserLibrary.register_summariser(channel_baseclass=MM_InfTauInterpolatedChannel, summariser_class=Summarise_MM_InfTauInterpolatedChannel)
from morphforge.simulationanalysis.summaries_new import SummariserLibrary from neurounits.writers import MRedocWriterVisitor import mredoc as mrd #import mredoc as mrd class NeuroUnitEqnsetMechanismSummariser(SummariserObject): @classmethod def build(cls, obj): return mrd.HierachyScope( #mrd.Section('Source:', # mrd.VerbatimBlock(obj.eqnset # ), MRedocWriterVisitor.build(obj.eqnset) ) SummariserLibrary.register_summariser(NeuroUnitEqnsetMechanism, NeuroUnitEqnsetMechanismSummariser) class Neuron_NeuroUnitEqnsetMechanism(NEURONChl_Base, NeuroUnitEqnsetMechanism): def __init__(self, **kwargs): super(Neuron_NeuroUnitEqnsetMechanism, self).__init__(**kwargs) self.nmodl_txt, self.buildparameters = WriteToNMODL(self.eqnset, neuron_suffix="NRNEQNSET"+ObjectLabeller.get_next_unamed_object_name(Neuron_NeuroUnitEqnsetMechanism, prefix=""))
from neurounits.writers import MRedocWriterVisitor import mredoc as mrd #import mredoc as mrd class NeuroUnitEqnsetMechanismSummariser(SummariserObject): @classmethod def build(cls, obj): return mrd.HierachyScope( #mrd.Section('Source:', # mrd.VerbatimBlock(obj.eqnset # ), MRedocWriterVisitor.build(obj.eqnset)) SummariserLibrary.register_summariser(NeuroUnitEqnsetMechanism, NeuroUnitEqnsetMechanismSummariser) class Neuron_NeuroUnitEqnsetMechanism(NEURONChl_Base, NeuroUnitEqnsetMechanism): def __init__(self, **kwargs): super(Neuron_NeuroUnitEqnsetMechanism, self).__init__(**kwargs) self.nmodl_txt, self.buildparameters = WriteToNMODL( self.eqnset, neuron_suffix="NRNEQNSET" + ObjectLabeller.get_next_unamed_object_name( Neuron_NeuroUnitEqnsetMechanism, prefix="")) assert self.buildparameters.mechanismtype == MechanismType.Distributed self.units = {}