Contributions are welcome, and they are greatly appreciated. Every little bit helps, and credit will always be given.
Ready to contribute? Here's how to set up your environment for local development.
-
Clone the fork locally and change directory:
# With SSH: git clone [email protected]:itsdawei/dpvis.git # Without SSH: git clone https://github.com/itsdawei/dpvis.git cd dpvis
-
There are a few options to managing virtual environment:
-
(Recommended) Install Conda and run:
conda create -n dpvis python=3.11 conda activate dpvis pip install -e .[dev]
-
Alternatively, install Poetry and run:
poetry install
-
Although highly recommended, a virtual environment is not necessary as long as you have Python 3.9+ and a Python package manager such as pip. In this case, you can install the library directly with:
pip install -e .[dev]
-
-
(Optional) Run knapsack demo to verify installation:
poetry shell python demos/knapsack.py exit
-
Create a branch for local development:
git checkout -b name-of-bugfix-or-feature
Now make the appropriate changes locally.
-
Please follow the Google Style Guide (particularly when writing docstrings).
-
Make sure to auto-format the code using YAPF. We highly recommend installing an editor plugin that auto-formats on save, but YAPF also runs on the command line:
yapf -i FILES
-
-
After making changes, check that the changes pass the tests:
pytest tests/ make test # ^ same as above
Finally, to lint the code:
pylint dp tests make lint # ^ same as above
To get pytest and pylint, pip install them into the environment. However, they should already install with
pip install -e .[dev]
. -
Add your change to the changelog for the current version in
HISTORY.md
. -
Commit the changes and push the branch to GitHub:
git add . git commit -m "Detailed description of changes." git push origin name-of-bugfix-or-feature
-
Submit a pull request through the GitHub website.
Before submitting a pull request, check that it meets these guidelines:
- Style: Code should follow the Google Style Guide and be auto-formatted with YAPF.
- The pull request should include tests.
- If the pull request adds functionality, corresponding docstrings and other documentation should be updated.
- The pull request should work for Python 3.7 and higher. GitHub Actions will display test results at the bottom of the pull request page. Check there for test results.
To run a subset of tests, use pytest
with the directory name, such as:
pytest tests/core/test1
The documentation is compiled with mkdocs-material and mkdocstrings
To serve the documentation locally, run
poetry install --with docs
poetry run make servedocs
When referencing papers, refer to them as Lastname YEAR
, e.g. Smith 2004
.
Also, prefer to link to the paper's website, rather than just the PDF. This is
particularly relevant when linking to arXiv papers.