Contributing#
We welcome contributions to the Neural Interactive Proofs codebase! This document provides a guide to contributing to the project.
Issues and Pull Requests#
If you find a bug or have a feature request, please open an issue on GitHub. If you would like to contribute a small fix (less than 30 minutes’ work), feel free to open a pull request directly. For larger changes, please open an issue first to discuss the change.
Pull requests require at least one review before they can be merged.
We use GitHub Actions for continuous integration. When you open a pull request, the tests will be run automatically, and must pass before the pull request can be merged.
Style Guide#
The code is formatted using black.
The line length is 88 (see rationale).
Docstrings are formatted using Numpydoc style.
Please add type hints to all functions.
Testing#
We use pytest for testing. To run the tests, use the following command:
python -m pytest
When developing a new feature, please add tests for the new functionality.
Documentation#
We use Sphinx to generate the documentation. To build the documentation, run the following command:
sphinx-build doc doc/_build/ -j auto
New features should be documented in the appropriate place in the documentation, located
in the doc
directory.
Pre-Commit Hooks#
We use pre-commit to run checks on the code before committing. To install the pre-commit hooks, run the following command:
pre-commit install
Development Workflow#
Make sure you have submitted an issue on GitHub first if the change is significant (will take more than 30 minutes to implement).
Follow the instructions to install the library, making sure you do the following:
Fork the repository on GitHub before cloning.
Install the development requirements (
requirements_dev.txt
).
Create a new branch for your feature or bug fix:
git checkout -b my_feature
Make your changes, add tests for the new functionality and update the documentation. Consult the guides and API reference for more information on how to do this.
Run the tests:
python -m pytest
If some tests fail, fix the issues before proceeding.
Format with black:
black .
Check for linting errors (if you have pre-commit hooks installed, this will be done automatically):
ruff check .
Check that the documentation builds without errors, and looks correct:
sphinx-build --builder html --fresh-env --verbose --fail-on-warning --jobs auto doc doc/_build
If there are errors, fix them before proceeding.
Commit your changes:
git add . git commit -m "My feature"
Push your changes to your fork:
git push origin my_feature
Create a pull request on GitHub. Make sure to include a description of the changes and any relevant context.