Installation
Create and activate a Python environment:
python -m venv envsource env/bin/activatepip install --upgrade pipInstall the package and its requirements with pip:
pip install -e .Run the code with:
patchworkOptional extras
Section titled “Optional extras”| Extra | Installs |
|---|---|
test | pytest and coverage |
docs | the notebook runner and griffe for the API reference |
dev | formatters and linters, plus the test and docs extras |
pip install -e ".[dev]"Optional plotting tools
Section titled “Optional plotting tools”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.