Additional Python packages¶
Python is a language with an extensive ecosystem of additional packages that can be used for various things. Here we list some key packages which can be useful for doing modelling.
Due to the vast amount of packages available, and different packages using different versions, we strongly recommend working in a virtual environment. You can find more on that in the virtual environment page.
Installing additional packages¶
Additional package are typically installed using pip
from the pypi.org repository. Simply run
pip install packagename
(with a relevant packagename) to install a package. It is also possible to install a bunch of packages using a requirements file (often named requirements.txt
). To do this, run
pip install -r requirements.txt
If you want to save the packages you have installed to such a requirements file, you can run
pip freeze > requirments.txt
NumPy and SciPy¶
NumPy and SciPy are staples when it comes to scientific computing in Python. You can install them using pip:
pip install numpy scipy
SUND¶
The SUND (Simulation Using Nonlinear Dynamic models) package is a package for simulating ODE models inspired by the MATLAB package IQM. It features a simple syntax for writing the model, and is able to combine models in a modular way by exposing inputs/outputs between models. It is also possible to give inputs in the form of predefined activities, which can contain constant outputs as well as more complex piecewise or interpolated outputs.
The easiest way is to install the sund package using pip:
pip install https://isbgroup.eu/sund-toolbox/releases/sund-1.2.18.tar.gz
It can then be used by importing the package sund
:
import sund
NEURON (not currently used for the courses on this page)¶
For Linux and Mac users, NEURON can be installed via pip install NEURON
.
Windows users should download the precompiled version listed on the official download page
AMICI (not currently used for the courses on this page)¶
AMICI is a package for simulating ODE models specified in the SBML format. It is using C in the background, and is able to both simulate the model and do parameter estimation.
Installing AMICI¶
For installing AMICI, we refer to the official install instructions available here.