As a scientific community-driven software project, PyMC4 welcomes contributions from users. This document describes how users can contribute to the PyMC4 project, and what workflow to follow to contribute as quickly and seamlessly as possible.
There are four main ways of contributing to PyMC4 (in descending order of difficulty or scope):
- Adding new or improved functionality to the codebase: these contributions directly extend PyMC4's functionality.
- Fixing outstanding issues or bugs with the codebase: these range from low-level software bugs to high-level design problems.
- Contributing to the documentation or examples: improving the documentation is just as important as improving the codebase itself.
- Submitting bug reports or feature requests via the GitHub issue tracker: even something as simple as leaving a "thumbs up" reaction to issues that are relevant to you!
The first three types of contributions involve opening a pull request, whereas the fourth involves creating an issue.
Finally, it also helps us if you spread the word: reference the project from your blog and articles, link to it from your website, or simply star it in GitHub to say "I use it"!
Creating your first GitHub issue? Check out the official GitHub documentation on how to do that!
We appreciate being notified of problems with the existing PyMC4 codebase. We prefer that issues be filed the on GitHub issue tracker, rather than on social media or by direct email to the developers.
Please check that your issue is not being currently addressed by other issues or pull requests by using the GitHub search tool.
While reporting issues is valuable, we welcome and encourage users to submit patches for new or existing issues via pull requests (a.k.a. "PRs"). This is especially the case for simple fixes, such as fixing typos or tweaking documentation, which do not require a heavy investment of time and attention.
The preferred workflow for contributing to PyMC4 is to fork the GitHub repository, clone it to your local machine, and develop on a feature branch.
-
Fork the project repository by clicking on the
Fork
button near the top right of the main repository page. This creates a copy of the code under your GitHub user account. -
Clone your fork of the PyMC4 repo from your GitHub account to your local computer, and add the base repository as an upstream remote.
$ git clone [email protected]:<your GitHub handle>/pymc4.git $ cd pymc4 $ git remote add upstream [email protected]:pymc-devs/pymc4.git
-
Check out a
feature
branch to contain your edits.$ git checkout -b my-feature
Always create a new
feature
branch. It's best practice to never work on themaster
branch of any repository. -
To set up your development environment, you can use the
make
command line utility. Depending on whether you want to develop using a Python virtual environment, conda environment or Docker image, you can run one ofmake venv
,make conda
ormake docker
, respectively, and follow the resulting instructions (in blue) after the setup is finished. -
Develop the feature on your feature branch. This is the fun part!
-
Once you are done developing, run
make black
andmake check
from the rootpymc4/
directory to blackify, lint and test the codebase. If you like, you can runmake lint
andmake test
to lint and test separately. Work through and fix any lint errors or failing tests. Don't hesitate to reach out to us through the GitHub issue tracker if you run into problems! -
Add changed files using
git add
and thengit commit
:$ git add your_modified_file.py $ git commit
to record your changes locally.
Then push the changes to your GitHub account with:
$ git push -u origin my-feature
-
Go to the GitHub web page of your fork of the PyMC4 repo. Click the
Pull request
button to send your changes to the project's maintainers for review. This will notify the PyMC4 developers.
The PyMC4 project abides by the Contributor Covenant. You can find our code of conduct here.