Contributing to machin-like.org

Making suggestions

If you want to report a mistake, suggest a new formula, or suggest any other improvement, you can open an issue on the GitHub issue tracker.

Contributing directly

Submitting a pull request

If you want to directly submit changes to machin-like.org, you can do this by forking the GitHub repository, making changes, then submitting a pull request. If you want to contribute, but are unsure where to start, have a look at the issue tracker for issues labelled "good first issue".

Defining an formula

Formulae on machin-like.org are defined using files in the formulae/ folder with the .pi extension. This file begins with metadata (im yaml format) between two lines containing only ‑‑, then has the terms of the formula (/in compact notation) on the following lines. The entries in the metadata are:

NameRequiredDescription
nameThe name of the formula (if it has a given name).
alt‑namesAlternative names of the formula.
notesNotes about the formula.
referencesReferences to where the formula is defined.

Testing your contribution

When you open a pull request, a series of tests and style checks will run via GitHub Actions. (You may have to wait for manual approval for these to run.) These tests and checks must pass before the pull request can be merged. If the tests and checks fail, you can click on them on the pull request page to see where the failure is happening.

The style checks will check that the Python scripts that generate machin-like.org pass ruff checks. If you've changed these scripts, you can run these checks locally by running:

python3 -m ruff format --check .
python3 -m ruff check .

Before you can run the tests or do a test build, you'll need to install the requirements:

python3 -m pip install -r requirements.txt

The tests can be run using:

python3 -m pytest test/

Code of conduct

We expect all our contributors to follow our code of conduct. Any unacceptable behaviour can be reported to Matthew (machin@mscroggs.co.uk).