Skip to content

Commit

Permalink
Doc: Rename 'steadystate example' (#2174)
Browse files Browse the repository at this point in the history
New title + some minor updates

Closes #1990

Mark notebook to always execute it under nbsphinx
  • Loading branch information
dweindl authored Sep 20, 2023
1 parent 847a596 commit 5e5ec61
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion binder/overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"\n",
" Brief intro to AMICI for first-time users.\n",
"\n",
"* [Example \"steadystate\"](../python/examples/example_steadystate/ExampleSteadystate.ipynb)\n",
"* [SBML import, observation model, sensitivity analysis, data export and visualization](../python/examples/example_steadystate/ExampleSteadystate.ipynb)\n",
"\n",
" A more detailed introduction to the AMICI interface, demonstrating sensitivity analysis, various options, finite difference checks, ...\n",
"\n",
Expand Down
42 changes: 21 additions & 21 deletions python/examples/example_steadystate/ExampleSteadystate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# AMICI Python example \"steadystate\"\n",
"# SBML import, observation model, sensitivity analysis, data export and visualization\n",
"\n",
"This is an example using the [model_steadystate_scaled.sbml] model to demonstrate and test SBML import and AMICI Python interface."
"This is an example using the [model_steadystate_scaled.sbml] model to demonstrate:\n",
"\n",
"* SBML import\n",
"* specifying the observation model\n",
"* performing sensitivity analysis\n",
"* exporting and visualizing simulation results"
]
},
{
Expand All @@ -23,10 +28,7 @@
"model_output_dir = model_name\n",
"\n",
"import libsbml\n",
"import importlib\n",
"import amici\n",
"import os\n",
"import sys\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt"
]
Expand Down Expand Up @@ -145,7 +147,7 @@
"metadata": {},
"outputs": [],
"source": [
"constantParameters = [\"k0\"]"
"constant_parameters = [\"k0\"]"
]
},
{
Expand Down Expand Up @@ -341,7 +343,7 @@
" model_output_dir,\n",
" verbose=logging.INFO,\n",
" observables=observables,\n",
" constant_parameters=constantParameters,\n",
" constant_parameters=constant_parameters,\n",
" sigmas=sigmas,\n",
")"
]
Expand All @@ -361,8 +363,7 @@
"metadata": {},
"outputs": [],
"source": [
"sys.path.insert(0, os.path.abspath(model_output_dir))\n",
"model_module = importlib.import_module(model_name)"
"model_module = amici.import_model_module(model_name, model_output_dir)"
]
},
{
Expand Down Expand Up @@ -447,7 +448,7 @@
"print(\n",
" \"Simulation was run using model default parameters as specified in the SBML model:\"\n",
")\n",
"print(model.getParameters())"
"print(dict(zip(model.getParameterIds(), model.getParameters())))"
]
},
{
Expand Down Expand Up @@ -862,18 +863,14 @@
},
{
"cell_type": "code",
"execution_count": 13,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(1.0, 0.5, 0.4, 2.0, 0.1, 2.0, 3.0, 0.2)\n"
]
}
],
"execution_count": null,
"outputs": [],
"source": [
"print(model.getParameters())"
"# In particular for interactive use, ReturnDataView.by_id() and amici.evaluate provides a more convenient way to access slices of the result:\n",
"# Time trajectory of observable observable_x1\n",
"print(f\"{rdata.by_id('observable_x1')=}\")\n",
"# Time trajectory of state variable x2\n",
"print(f\"{rdata.by_id('x2')=}\")"
],
"metadata": {
"collapsed": false,
Expand Down Expand Up @@ -2037,6 +2034,9 @@
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"nbsphinx": {
"execute": "always"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 5e5ec61

Please sign in to comment.