We are happy to accept contributions to pyhf
via Pull Requests to the GitHub repository and welcome Issues.
To get started fork the repo.
Making Issues is very helpful to the project — they help the dev team form the development roadmap and are where most important discussion takes place. If you have suggestions, questions that you can't find answers to on the documentation website or on the GitHub Discussions, or have found a bug please open an Issue!
Unless your Pull Request is an obvious 1 line fix, please first open an Issue to discuss your PR with the dev team.
The Issue allows for discussion on the usefulness and scope of the PR to be publicly discussed and also allows for the PR to then be focused on the code review.
The pyhf
dev team wants to encourage contributions and community involvement in the project and also avoid low quality PRs that don't actually fix an issue or contribute towards the current roadmap.
PRs that don't follow these guidelines might be rejected.
If you're looking for some examples of high quality contributed pull requests we recommend you take a look at these:
- PR #902 by Nikolai Hartmann (@nikoladze)
Many thanks goes out to our contributors!
Unless you are making a single commit pull request please create a draft pull request. Outline the work that will be done in this ongoing pull request. When you are close to being done please tag someone with Approver permissions to follow the pull request.
If you would like to make a pull request please:
- Make a fork of the project.
- Open an Issue to discuss the planned PR with the project maintainers.
- Commit your changes to a feature branch on your fork and push to your branch.
- Start a pull request to let the project maintainers know you're working on it.
- Test your changes with
pytest
. - Update your fork to make sure your changes don't conflict with the current state of the main branch.
- Make sure that you've added your name to
docs/contributors.rst
. If you haven't please do so by simply appending your name to the bottom of the list. We are thankful for and value your contributions topyhf
, not matter the size. - Request your PR be reviewed by the project maintainers.
If you have found a bug please report it by filling out the bug report template.
We recommend first reading the "Developing" page on the pyhf website and the coming back here.
You can install the development environment (which includes a number of extra) libraries and all others needed to run the tests via pip
:
python -m pip install --upgrade --editable '.[develop]'
To make the PR process much smoother we also strongly recommend that you setup the Git pre-commit hook for Black by running
pre-commit install
This will run black
over your code each time you attempt to make a commit and warn you if there is an error, canceling the commit.
You can run the unit tests (which should be fast!) via the following command.
pytest --ignore=tests/test_notebooks.py
Note: This ignores the notebook tests (which are run via papermill which run somewhat slow. Make sure to run the complete suite before submitting a PR
pytest
We try to follow Conventional Commit for commit messages and PR titles. Since we merge PR's using squash commits, it's fine if the final commit messages (proposed in the PR body) follow this convention.
New baseline visuals can be generated using this command:
pytest tests/contrib/test_viz.py --mpl-generate-path=tests/contrib/baseline