Ejemplo n.º 1
0
    def writingAndReadingExecution(self):

        antimonyStr = '''
        model myModel
          S1 -> S2; k1*S1;
          S1 = 10; S2 = 0;
          k1 = 1;
        end
        '''
        phrasedmlStr = '''
          model1 = model "myModel"
          sim1 = simulate uniform(0, 5, 100)
          task1 = run sim1 on model1
          plot "Figure 1" time vs S1, S2
          report time vs S1, S2
        '''
        import tellurium as te

        # Create experiment
        exp = te.experiment(antimonyStr, phrasedmlStr)
        # Run and store with results
        tmpdir = tempfile.mkdtemp()
        exp.exportAsCombineWithOutputs(os.path.join(tmpdir, 'test.omex'))
        # Execute the created archive
        te.executeOMEX('test.omex', workingDir=tmpdir)
        shutil.rmtree(tmpdir)
Ejemplo n.º 2
0
"""
Running the Combine Showcase.
https://github.com/SemsProject/CombineArchiveShowCase
"""

# redirect backend, so plots only in files and not shown
import matplotlib.pyplot
matplotlib.pyplot.switch_backend("Agg")

# running all SED-ML simulations in archive
# outputs are stored next to the respective SED-ML files in the workingDir
import os.path
import tellurium as te

omexDir = os.path.dirname(os.path.realpath(__file__))
omexPath = os.path.join(omexDir, "CombineArchiveShowCase.omex")
workingDir = os.path.join(omexDir, "_te_CombineArchiveShowCase")

te.executeOMEX(omexPath, workingDir=workingDir)