Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Rename 'steadystate example' #2174

Merged
merged 3 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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