Installation

Installation#

PyPI package Conda package Supported Python versions

AmpForm is available on PyPI and conda-forge, so you can install it with your favorite package manager:

uv add ampform
pixi add ampform
python3 -m pip install ampform
conda install -c conda-forge ampform

This installs the latest release that you can find on the stable branch.

Optionally, you can install the dependencies required for visualizing topologies with the following optional dependency syntax:

uv add 'ampform[viz]'
pixi add ampform graphviz python-graphviz
pip install 'ampform[viz]'
conda install -c conda-forge ampform graphviz python-graphviz

The latest version on the main branch can be installed as follows:

uv add git+https://github.com/ComPWA/ampform --branch main
pixi add ampform --git https://github.com/ComPWA/ampform --branch main
python3 -m pip install git+https://github.com/ComPWA/ampform@main

Developer installation#

To contribute to the project, you need to install the package in a virtual environment. This can be done best with uv (see installation instructions here). For this, you first need to get the source code with Git:

git clone https://github.com/ComPWA/ampform
cd ampform

Now it’s simply a matter of creating and activating the virtual environment with uv sync. The dependencies for the project are ‘pinned’ in each commit through the uv.lock file.

uv sync --all-extras
source .venv/bin/activate

Formatting and linting checks are automatically performed when committing changes. This is done with pre-commit. To install the hooks in your local repository, run install pre-commit with uv:

uv tool install pre-commit --with pre-commit-uv --force-reinstall --python=3.13

and pre-commit install once:

pre-commit install --install-hooks

Poe the Poet is used as a task runner. Install it globally (within your home folder) with uv:

uv tool install poethepoet --force-reinstall --python=3.13

You can see which local CI checks it defines by running

poe

For instance, all style checks can be run with

poe style

That’s all! Have a look at Welcome to AmpForm! to try out the package. You can also have a look at Help developing for tips on how to work with this ‘editable’ developer setup!