If you are interested in contributing to Stable-Baselines, your contributions will fall into two categories:
Once you finish implementing a feature or bug-fix, please send a Pull Request to https://github.com/DLR-RM/stable-baselines3
If you are not familiar with creating a Pull Request, here are some guides:
To develop Stable-Baselines3 on your machine, here are some tips:
git clone https://github.com/DLR-RM/stable-baselines3
cd stable-baselines3/
pip install -e .[docs,tests,extra]
We are using black codestyle (max line length of 127 characters) together with isort to sort the imports.
Please run make format
to reformat your code. You can check the codestyle using make check-codestyle
and make lint
.
Please document each function/method and type them using the following template:
def my_function(arg1: type1, arg2: type2) -> returntype:
"""
Short description of the function.
:param arg1: describe what is arg1
:param arg2: describe what is arg2
:return: describe what is returned
"""
...
return my_variable
Before proposing a PR, please open an issue, where the feature will be discussed. This prevent from duplicated PR to be proposed and also ease the code review process.
Each PR need to be reviewed and accepted by at least one of the maintainers (@hill-a, @araffin, @ernestum, @AdamGleave or @Miffyli). A PR must pass the Continuous Integration tests to be merged with the master branch.
All new features must add tests in the tests/
folder ensuring that everything works fine.
We use pytest.
Also, when a bug fix is proposed, tests should be added to avoid regression.
To run tests with pytest
:
make pytest
Type checking with pytype
:
make type
Codestyle check with black
, isort
and flake8
:
make check-codestyle
make lint
To run pytype
, format
and lint
in one command:
make commit-checks
Build the documentation:
make doc
Check documentation spelling (you need to install sphinxcontrib.spelling
package for that):
make spelling
Please do not forget to update the changelog (docs/misc/changelog.rst
) and add documentation if needed.
You should add your username next to each changelog entry that you added. If this is your first contribution, please add your username at the bottom too.
A README is present in the docs/
folder for instructions on how to build the documentation.
Credits: this contributing guide is based on the PyTorch one.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。