In [2]:
import cobra
from cobra.io import read_sbml_model
from cobra.test import create_test_model
from cobra import Model
In [3]:
cobra.__path__
Out[3]:
In [4]:
cobra.__version__
Out[4]:
In [5]:
benchmark_results = {}
In [6]:
m = create_test_model('ecoli')
In [7]:
%%timeit -o
m2 = Model()
for r in m.reactions:
m2.add_reaction(r)
Out[7]:
In [8]:
benchmark_results['add_reaction'] = _
In [9]:
%%timeit -o
m2 = Model()
m2.add_reactions(m.reactions)
Out[9]:
In [10]:
benchmark_results['add_reactions'] = _
In [15]:
%%timeit -o
model = read_sbml_model("/Users/niso/Dev/cobrapy-fork/cobra/test/data/iJO1366.xml")
for reaction in model.reactions:
model.remove_reactions([reaction])
Out[15]:
In [12]:
benchmark_results['remove_reaction'] = _
In [8]:
%%timeit -o
model = read_sbml_model("/Users/niso/Dev/cobrapy-fork/cobra/test/data/iJO1366.xml")
Out[8]:
In [9]:
benchmark_results['read_sbml_model'] = _
In [20]:
model = read_sbml_model("/Users/niso/Dev/cobrapy-fork/cobra/test/data/iJO1366.xml")
In [ ]:
%%timeit -o
for reaction in model.reactions:
model.objective = reaction
solution = model.optimize()
solution.f
In [ ]:
benchmark_results['iteratete_all_reactions_set_objective_solve'] = _
In [13]:
%%timeit -o
model.copy()
Out[13]:
In [14]:
benchmark_results['model_copy'] = _
In [ ]: