Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Installation

DOLFINx first

simcardemsx is built on DOLFINx, which is not installable from PyPI on its own. The simplest way to get it is the official container image:

docker run -ti -v $(pwd):/home/shared -w /home/shared ghcr.io/fenics/dolfinx/dolfinx:stable

DOLFINx is also available from conda-forge (conda install -c conda-forge fenics-dolfinx) and Spack. See the DOLFINx installation instructions.

simcardemsx assumes that dolfinx, mpi4py, petsc4py, basix and ufl are already installed, and that they are recent enough for the versions of fenicsx-pulse and fenicsx-beat it requires.

simcardemsx

From PyPI:

python3 -m pip install simcardemsx

From source:

git clone https://github.com/ComputationalPhysiology/simcardemsx.git
cd simcardemsx
python3 -m pip install -e .

One dependency, scifem, is compiled against the DOLFINx you have. If pip fails to build it, install its build requirements and build it without isolation first:

python3 -m pip install --group build
python3 -m pip install scifem --no-build-isolation

Extras

ExtraWhat it adds
demoWhat the examples need: matplotlib, cardiac-geometriesx, the circulation model, and the mesh and fibre generators of the BiV example
testpytest, and what the tests read
docsMyST and jupytext, to build this site
devpre-commit, mypy and the type stubs
allAll of the above
python3 -m pip install "simcardemsx[demo]"

The development container

The repository has a dev container in .devcontainer/, built on the DOLFINx image, which installs everything (pip install -e .[all]). VS Code and GitHub Codespaces open the repository in it directly.

Checking the installation

python3 -c "import simcardemsx; print(simcardemsx.__version__)"
python3 -m pytest -m "not slow"     # from a source checkout, with the test extra