How to contribute#
Bug report and feature request#
We use benchopt GitHub repo to track all bugs and feature requests; feel free to open an issue if you have found a bug or wish to see a feature implemented.
Code contribution#
The preferred way to contribute to benchopt is to fork the main repository on GitHub, then submit a “Pull Request” (PR).
In the first few steps, we explain how to locally install benchopt, and how to set up your git repository:
Create an account on GitHub if you do not already have one.
Fork the project repository: click on the ‘Fork’ button near the top of the page. This creates a copy of the code under your account on the GitHub user account. For more details on how to fork a repository see this guide.
Clone your fork of the benchopt repo from your GitHub account to your local disk:
git clone git@github.com:YourLogin/benchopt.git cd benchopt
Add the
upstreamremote. This saves a reference to the main benchopt repository, which you can use to keep your repository synchronized with the latest changes:git remote add upstream https://github.com/benchopt/benchoptCheck that the upstream and origin remote aliases are configured correctly by running git remote -v which should display:
origin git@github.com:YourLogin/benchopt.git (fetch) origin git@github.com:YourLogin/benchopt.git (push) upstream https://github.com/benchopt/benchopt (fetch) upstream https://github.com/benchopt/benchopt (push)
You should now have a working installation of benchopt, and your git repository properly configured. The next steps now describe the process of modifying code and submitting a PR:
Synchronize your
mainbranch with theupstream/mainbranch, more details on GitHub Docs:git switch main git fetch upstream git merge upstream/main
Create a feature branch to hold your development changes:
git switch -c my_featureand start making changes. Always use a feature branch. It’s good practice to never work on the
mainbranch!Develop the feature on your feature branch on your computer, using Git to do the version control. When you’re done editing, add changed files using
git addand thengit commit:git add modified_files git commit
to record your changes in Git, then push the changes to your GitHub account with:
git push -u origin my_featureFollow these instructions to create a pull request from your fork.
Note
It is often helpful to keep your local feature branch synchronized with the latest changes of the main benchopt repository:
git fetch upstream
git merge upstream/main
Documentation#
We are glad to accept any sort of documentation: function docstrings,
reStructuredText documents (like this one), tutorials, etc. reStructuredText
documents live in the source code repository under the doc/ directory.
You can edit the documentation using any text editor, and then generate the HTML output by typing, in a shell:
pip install benchopt[doc]
cd doc/
make html
firefox _build/html/index.html