Export a “flat” PySB model (
A module containing a class that exports a PySB model to a single Python source file that, when imported, will recreate the same model. This is intended for saving a dynamically generated model so that it can be reused without re-running the dynamic generation process. Note that any macro calls and other program structure in the original model are “flattened” in the process.
For information on how to use the model exporters, see the documentation
Structure of the Python code¶
The standalone Python code calls
Model(), then defines Monomers, Parameters,
Expressions (constant), Compartments, Observables, Expressions (dynamic), Rules
and initial conditions in that order. This can be considered a sort of “repr()”
for a full model.
If the output is saved as
foo.py then one may load the model with the
from foo import model
A class for generating PySB “flat” model source code from a model.
pysb.export.Exporter, which implements basic functionality for all exporters.
Export PySB source code from a model.
String containing the Python code.