Skip to content
Projects

Installation

Create and activate a Python environment:

python -m venv env
source env/bin/activate
pip install --upgrade pip

Install the release from PyPI, where the package is called patchwork-amr (patchwork there is an unrelated project); the import is import patchwork:

pip install patchwork-amr

Or install the package and its requirements from a clone with pip:

pip install -e .

Run the code with:

patchwork
ExtraInstalls
mpimpi4py, for runs under mpiexec
petscpetsc4py, for NodalPoisson(backend="petsc"): the solve distributed over the ranks
pyccelPyccel, which compiles the kernels (locate) on their first call; without it their NumPy versions run
testpytest, coverage and the pyccel extra
docsthe notebook runner and griffe for the API reference
devformatters and linters, plus the test and docs extras
pip install -e ".[dev]"

Install Matplotlib with Patchwork when you want to use plot_patches or run the examples that save figures. SciPy, used by the composite Poisson solver, is installed as a core dependency:

pip install -e ".[plot]"

For multi-rank runs, install the optional MPI bindings too:

pip install -e ".[mpi,plot]"

mpiarray uses its serial communicator when MPI is not installed or no MPI launcher is active. The AMR examples therefore run as ordinary Python scripts.