EasyML (Carp/Carpentry)¶
Experimental export is provided for EasyML, the language used by Carp and
Carpentry.
Imports, exporters, and expression writers¶
- myokit.formats.easyml.exporters()¶
Returns a dict of all exporters available in this module.
- class myokit.formats.easyml.EasyMLExporter¶
This
Exportergenerates a.modelfile in theEasyMLformat used by CARP/CARPEntry.For details of the language, see https://carpentry.medunigraz.at/carputils/examples/tutorials/tutorials.01_EP_single_cell.04_limpet_fe.run.html
- model(path, model, protocol=None, convert_units=True)¶
Exports a
myokit.Modelin EasyML format, writing the result to the file indicated bypath.A
myokit.ExportErrorwill be raised if any errors occur.Arguments:
pathThe path to write the generated model to.
modelThe
myokit.Modelto export.protocolA protocol - this will be ignored!
convert_unitsIf set to
True, the metohd will attempt to convert to CARP’s preferred units for voltage (mV), current (A/F), and time (ms).
- post_export_info()¶
Optional method that returns a string containing information about this exporter, to be shown after the export is completed.
- runnable(path, model, protocol=None, *args)¶
Exports a
myokit.Modeland optionally amyokit.Protocolto something that can be run or compiled.The output will be stored in the directory
path. Amyokit.ExportErrorwill be raised if any errors occur.
- supports_model()¶
- supports_runnable()¶
Returns
Trueif this exporter supports export of a model and optional protocol to a runnable piece of code.
- myokit.formats.easyml.ewriters()¶
Returns a dict of all expression writers available in this module.
- class myokit.formats.easyml.EasyMLExpressionWriter¶
This
ExpressionWriterwrites equations for variables in EasyML syntax.EasyML has a C-like syntax, and uses C operator precedence.
- eq(q)¶
Converts a
myokit.Equationto a string.
- ex(e)¶
Converts a
myokit.Expressionto a string.
- set_lhs_function(f)¶
- Sets a naming function, will be called to get the variable name from a
myokit.LhsExpressionobject.
The argument
fshould be a function that takes anLhsExpressionas input and returns a string.