Contribution Guideline#
Set up the environment#
Fork the repo and then clone it.
⚠️ Install python >= 3.8.
Install pre-commit hooks:
pip install pre-commitand thenpre-commit install. The hooks will be automatically triggered when running git commit. One can also manually trigger the hooks withpre-commit run --all-files.(Optional) Install
torch.Install the requirements for development:
pip install -r requirements_dev.txt.Install the package in editable mode
pip install -e ..(Optional) Add custom directories in
.git/info/excludeto make them ignored by git. Note that some common directories like.idea,.vscodeare already in the.gitignorefile.
Code linting, type hints, and unit tests#
We use flake8, isort, and black for the code linting, and mypy for checking type hints. We write the unit tests with pytest.
Build docs locally#
Go to
docs/and install the requirements:cd docs/ && pip install -r requirements_doc.txt.Now the current directory should be under
docs/. Build the html webpage:make html.Go to
docs/build/and then host the webpage locally:cd build/ && python -m http.server <port>, whereportis a number (e.g., 1234).Open the webpage
localhost:<port>in a browser.