Skip to content

Commit bc0781b

Browse files
author
uri.akavia
committed
fixed faq.ipynb and removed irrelevant section
1 parent 148d26f commit bc0781b

File tree

1 file changed

+2
-36
lines changed

1 file changed

+2
-36
lines changed

documentation_builder/faq.ipynb

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"model = cobra.io.load_model(\"iYS1720\")\n",
7979
"\n",
8080
"for metabolite in model.metabolites:\n",
81-
" metabolite.id = \"test_\" + metabolite.id\n",
81+
" metabolite.id = f\"test_{metabolite.id}\"\n",
8282
"\n",
8383
"try:\n",
8484
" model.metabolites.get_by_id(model.metabolites[0].id)\n",
@@ -289,7 +289,7 @@
289289
"cell_type": "markdown",
290290
"metadata": {},
291291
"source": [
292-
"With optlang solvers, the LP formulation of a model is obtained by it's string representation. All solvers behave the same way."
292+
"With optlang solvers, the LP formulation of a model is obtained by its string representation. All solvers behave the same way."
293293
]
294294
},
295295
{
@@ -302,40 +302,6 @@
302302
" out.write(str(model.solver))"
303303
]
304304
},
305-
{
306-
"cell_type": "markdown",
307-
"metadata": {},
308-
"source": [
309-
"### For cobrapy's internal solvers"
310-
]
311-
},
312-
{
313-
"cell_type": "markdown",
314-
"metadata": {},
315-
"source": [
316-
"With the internal solvers, we first create the problem and use functions bundled with the solver. \n",
317-
"\n",
318-
"Please note that unlike the LP file format, the MPS file format does not specify objective direction and is always a minimization. Some (but not all) solvers will rewrite the maximization as a minimization."
319-
]
320-
},
321-
{
322-
"cell_type": "code",
323-
"execution_count": 8,
324-
"metadata": {},
325-
"outputs": [],
326-
"source": [
327-
"model = cobra.io.load_model(\"iYS1720\")\n",
328-
"\n",
329-
"# glpk through cglpk\n",
330-
"glpk = cobra.solvers.cglpk.create_problem(model)\n",
331-
"glpk.write(\"test.lp\")\n",
332-
"glpk.write(\"test.mps\") # will not rewrite objective\n",
333-
"# cplex\n",
334-
"cplex = cobra.solvers.cplex_solver.create_problem(model)\n",
335-
"cplex.write(\"test.lp\")\n",
336-
"cplex.write(\"test.mps\") # rewrites objective"
337-
]
338-
},
339305
{
340306
"cell_type": "markdown",
341307
"metadata": {},

0 commit comments

Comments
 (0)