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
Exporter
generates a.model
file in theEasyML
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 bypath
.A
myokit.ExportError
will be raised if any errors occur.Arguments:
path
The path to write the generated model to.
model
The
myokit.Model
to export.protocol
A protocol - this will be ignored!
convert_units
If 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.Model
and optionally amyokit.Protocol
to something that can be run or compiled.The output will be stored in the directory
path
. Amyokit.ExportError
will be raised if any errors occur.
- supports_model()¶
- supports_runnable()¶
Returns
True
if 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
ExpressionWriter
writes equations for variables in EasyML syntax.EasyML has a C-like syntax, and uses C operator precedence.
- eq(q)¶
Converts a
myokit.Equation
to a string.
- ex(e)¶
Converts a
myokit.Expression
to a string.
- set_lhs_function(f)¶
- 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 anLhsExpression
as input and returns a string.