Installation#

PyPI package Conda package Supported Python versions

Quick installation#

The fastest way of installing this package is through PyPI or Conda:

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:

pip install ampform[viz]  # installs ampform with graphviz

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

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

and pre-commit install once:

pre-commit install --install-hooks

Poe the Poet is used as a task runner. 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 Usage 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!