EasyML (Carp/Carpentry)

Experimental export is provided for EasyML, the language used by Carp and Carpentry.

Imports, exporters, and expression writers


Returns a dict of all exporters available in this module.

class myokit.formats.easyml.EasyMLExporter

This Exporter generates a .model file in the EasyML format 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.Model in EasyML format, writing the result to the file indicated by path.

A myokit.ExportError will be raised if any errors occur.



The path to write the generated model to.


The myokit.Model to export.


A protocol - this will be ignored!


If set to True, the metohd will attempt to convert to CARP’s preferred units for voltage (mV), current (A/F), and time (ms).


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.Model and optionally a myokit.Protocol to something that can be run or compiled.

The output will be stored in the directory path. A myokit.ExportError will be raised if any errors occur.


See myokit.formats.Exporter.supports_model().


Returns True if this exporter supports export of a model and optional protocol to a runnable piece of code.


Returns a dict of all expression writers available in this module.

class myokit.formats.easyml.EasyMLExpressionWriter

This ExpressionWriter writes equations for variables in EasyML syntax.


Converts an equation to a string


Converts an Expression to a string.

Sets a naming function, will be called to get the variable name from a

myokit.LhsExpression object.

The argument f should be a function that takes an LhsExpression as input and returns a string.