Contributing

Install Develop Version

To install Tianshou in an “editable” mode, run

pip3 install -e .

in the main directory. This installation is removable by

python3 setup.py develop --uninstall

Additional dependencies for developments can be installed by

pip3 install ".[dev]"

PEP8 Code Style Check

We follow PEP8 python code style. To check, in the main directory, run:

flake8 . --count --show-source --statistics

Test Locally

This command will run automatic tests in the main directory

pytest test --cov tianshou -s

Test by GitHub Actions

  1. Click the Actions button in your own repo:

_images/action1.jpg
  1. Click the green button:

_images/action2.jpg
  1. You will see Actions Enabled. on the top of html page.

  2. When you push a new commit to your own repo (e.g. git push), it will automatically run the test in this page:

_images/action3.png

Documentation

Documentations are written under the docs/ directory as ReStructuredText (.rst) files. index.rst is the main page. A Tutorial on ReStructuredText can be found here.

API References are automatically generated by Sphinx according to the outlines under docs/api/ and should be modified when any code changes.

To compile documentation into webpages, run

make html

under the docs/ directory. The generated webpages are in docs/_build and can be viewed with browsers.