Skip to content
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
10 changes: 6 additions & 4 deletions .github/workflows/test_petab_sciml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install python package
run: scripts/installAmiciSource.sh

- name: Install petab
- name: Install Python dependencies
run: |
source ./venv/bin/activate \
&& pip3 install wheel pytest shyaml pytest-cov
Expand All @@ -65,14 +65,16 @@ jobs:
- name: Download and install PEtab SciML
run: |
source ./venv/bin/activate \
&& python -m pip install git+https://github.com/petab-dev/petab_sciml.git@main#subdirectory=src/python \

&& python -m pip install git+https://github.com/petab-dev/petab_sciml.git@main#subdirectory=src/python

- name: Install petab
# FIXME: Currently, an older version of petab that is required for
# these tests, because petab-sciml is currently a mix of petab v1
# and v2 functionality.
run: |
source ./venv/bin/activate \
&& python3 -m pip uninstall -y petab \
&& python3 -m pip install git+https://github.com/petab-dev/libpetab-python.git@sciml \
&& python3 -m pip install git+https://github.com/petab-dev/libpetab-python.git@sciml

- name: Run PEtab SciML testsuite
run: |
Expand Down
5 changes: 1 addition & 4 deletions binder/overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
"* [Efficient spline interpolation](../doc/examples/example_splines/ExampleSplines.ipynb)\n",
"\n",
" Shows how to add annotated spline formulas to existing SBML models to speed up AMICI's model import.\n",
"\n",
"* [A real-world application of splines](../doc/examples/example_splines_swameye/ExampleSplinesSwameye2003.ipynb)\n",
"\n",
" An illustration of how to apply AMICI's spline functionalities to parameter estimation for a reaction network.\n"
"\n"
]
}
],
Expand Down
16 changes: 10 additions & 6 deletions doc/examples/example_errors.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1863901917703506",
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"%matplotlib inline\n",
"import os\n",
Expand All @@ -34,8 +33,12 @@
" run_simulation,\n",
" simulation_status_to_str,\n",
")\n",
"from amici.petab.petab_import import import_petab_problem\n",
"from amici.petab.simulations import EDATAS, RDATAS, simulate_petab\n",
"from amici.importers.petab.v1 import (\n",
" EDATAS,\n",
" RDATAS,\n",
" import_petab_problem,\n",
" simulate_petab,\n",
")\n",
"from amici.plotting import plot_jacobian, plot_state_trajectories\n",
"from petab.v1.sbml import get_sbml_model\n",
"\n",
Expand All @@ -48,7 +51,8 @@
" import benchmark_models_petab\n",
" except ModuleNotFoundError:\n",
" print(\"** Please restart the kernel. **\")"
]
],
"id": "b9e6cb8843da8bc3"
},
{
"cell_type": "markdown",
Expand Down
27 changes: 10 additions & 17 deletions doc/examples/example_jax/ExampleJax.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -274,23 +274,16 @@
]
},
{
"metadata": {},
"cell_type": "code",
"execution_count": 4,
"id": "6ada3fb8",
"metadata": {
"ExecuteTime": {
"start_time": "2024-10-18T20:36:51.765461Z"
},
"jupyter": {
"is_executing": true
}
},
"outputs": [],
"execution_count": null,
"source": [
"from amici.petab.petab_import import import_petab_problem\n",
"from amici.importers.petab.v1 import import_petab_problem\n",
"\n",
"amici_model = import_petab_problem(petab_problem, compile_=True, verbose=False)"
]
],
"id": "4c510f3e65879888"
},
{
"cell_type": "markdown",
Expand All @@ -311,14 +304,13 @@
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "72053647",
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"import amici\n",
"from amici.petab.simulations import simulate_petab\n",
"from amici.importers.petab.v1 import simulate_petab\n",
"\n",
"amici_solver = amici_model.create_solver()\n",
"amici_solver.set_sensitivity_order(amici.SensitivityOrder.first)\n",
Expand All @@ -336,7 +328,8 @@
" tuple(ret[\"sllh\"][par_id] for par_id in petab_problem.x_free_ids)\n",
" )\n",
" return llh, sllh"
]
],
"id": "beb890bd2f3d0880"
},
{
"cell_type": "markdown",
Expand Down
4 changes: 2 additions & 2 deletions doc/examples/example_jax_petab/ExampleJaxPEtab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"outputs": [],
"source": [
"import petab.v1 as petab\n",
"from amici.petab.petab_import import import_petab_problem\n",
"from amici.importers.petab.v1 import import_petab_problem\n",
"\n",
"# Define the model name and YAML file location\n",
"model_name = \"Boehm_JProteomeRes2014\"\n",
Expand Down Expand Up @@ -566,7 +566,7 @@
"outputs": [],
"source": [
"import amici\n",
"from amici.petab import simulate_petab\n",
"from amici.importers.petab.v1 import simulate_petab\n",
"\n",
"# Import the PEtab problem as a standard AMICI model\n",
"amici_model = import_petab_problem(\n",
Expand Down
12 changes: 7 additions & 5 deletions doc/examples/example_petab/petab.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"import petab\n",
"from amici import run_simulation\n",
"from amici.petab.petab_import import import_petab_problem\n",
"from amici.petab.petab_problem import PetabProblem\n",
"from amici.petab.simulations import simulate_petab\n",
"from amici.importers.petab.v1 import (\n",
" import_petab_problem,\n",
" simulate_petab,\n",
")\n",
"from amici.importers.petab.v1.petab_problem import PetabProblem\n",
"from amici.plotting import plot_state_trajectories"
]
},
Expand Down
13 changes: 5 additions & 8 deletions doc/examples/example_petab/petab_v2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@
]
},
{
"metadata": {},
"cell_type": "code",
"id": "initial_id",
"metadata": {
"collapsed": true
},
"outputs": [],
"execution_count": null,
"source": [
"import logging\n",
"\n",
"import amici\n",
"from amici.petab.petab_importer import *\n",
"from amici.petab.simulations import RDATAS\n",
"from amici.importers.petab import *\n",
"from amici.plotting import *\n",
"from petab.v2 import Problem"
],
"outputs": [],
"execution_count": null
"id": "419616ae233de558"
},
{
"cell_type": "markdown",
Expand Down
4 changes: 3 additions & 1 deletion doc/examples/example_splines/ExampleSplines.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"source": [
"# AMICI Python example \"splines\"\n",
"\n",
"This is an example showing how to add spline assignment rules to a pre-existing SBML model."
"This is an example showing how to add spline assignment rules to a pre-existing SBML model.\n",
"\n",
"A full application example of using splines to parametrize time-dependent unknown inputs followed by parameter estimation with pypesto can be found in the [pypesto documentation](https://pypesto.readthedocs.io/en/latest/example.html#application-examples)."
]
},
{
Expand Down
Loading
Loading