Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce better contribution guide #154

Merged
merged 5 commits into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 72 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,77 @@
## Contributing to CleanRL

Thank you for being interested in contributing to our project. All kinds of contribution are welcome.
👍🎉 Thank you for taking the time to contribute! 🎉👍

Below are some steps to help you get started:

1. 👋 Join our discord channel at https://discord.gg/D6RCjA6sVT
to say hi!!
2. 🔨 Pick something you want to work at and let us know on slack. You could
* Tackle issues with the [`help wanted`](https://github.com/vwxyzjn/cleanrl/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) flag
* Bug fixes and various improvements on existing algorithms.
* **Contribute to the Open RL Benchmark**
* You could add new algorithms or new games to be featured in the Open RL Benchmark (http://benchmark.cleanrl.dev/)
* In this case, please contact me (Costa) directly on slack. I will add you to the CleanRL's Team at Weight and Biases (https://wandb.ai/cleanrl).
So if you would *like*, your experiments can be featured on the Open RL Benchmark (http://benchmark.cleanrl.dev/)
3. 🎇 Submit an PR and get marged!
Feel free to open an issue or a Pull Request if you have any questions or suggestions. You can also [join our Discord](https://discord.gg/D6RCjA6sVT) and ask questions there. If you plan to work on an issue, let us know in the issue thread to avoid duplicate work.

Good luck and have fun!

## Dev Setup

```bash
poetry install
poetry install -E atari
poetry install -E pybullet
```

Then you can run the scripts under the poetry environment in two ways: `poetry run` or `poetry shell`.

* `poetry run`:
By prefixing `poetry run`, your command will run in poetry's virtual environment. For example, try running
```bash
poetry run python ppo.py
```
* `poetry shell`:
First, activate the poetry's virtual environment by executing `poetry shell`. Then, the name of the poetry's
virtual environment (e.g. `(cleanrl-ghSZGHE3-py3.9)`) should appear in the left side of your shell.
Afterwards, you can directly run
```bash
python ppo.py


## Code Formatting

We use [Pre-commit](https://pre-commit.com/) to sort dependencies, remove unused variables and imports, format code using black, and check word spelling. You can run the following command:

```bash
poetry run pre-commit run --all-files
```

## Contributing new algorithms

We welcome the contributions of new algorithms.

**Before opening a pull request**, please open an issue first to discuss with us since this is likely a sizable effort. Once we agree on the plan, feel free to make a PR to include the new algorithm.

To help ease the review process, here is a checklist:

1. **Code style**: Make sure you match the code style used in other implemented algorithms in CleanRL. In particular, `poetry run pre-commit run --all-files` will help auto-format the code.
2. **Empirical analysis and benchmark**: we adopt a similar guide from [sb3-contrib](https://github.com/Stable-Baselines-Team/stable-baselines3-contrib/blob/master/CONTRIBUTING.md) with a bit of our spin. The implemented algorithm should come with **tracked** experiments that
* match the reported performance in the paper (if applicable)
* match the reported performance in a high-quality reference implementation (SB3, Tianshou, and others) (if applicable).
* We should also add documentation on how exactly we want the tracked experiments to be done (i.e., what W&B project? should they capture video recording?)
3. **Documentation**: the proposed algorithm should also come with documentation at https://docs.cleanrl.dev/rl-algorithms/ to
* explain crucial implementation details
* add links to the original paper and related papers (if applicable)
* add links to the PR related to the algorithm
* add links to the tracked experiments and benchmark results
4. **Tests**: the proposed algorithm should come with an end-to-end test (see examples [here](https://github.com/vwxyzjn/cleanrl/blob/master/tests/test_atari.py)) that ensures the algorithm does not crash. Other applicable tests are also welcome.


## Checklist:

Here is a checklist template when contributing a new algorithm. See https://github.com/vwxyzjn/cleanrl/pull/137 as an example.

- [ ] I've read the [CONTRIBUTION](https://github.com/vwxyzjn/cleanrl/blob/master/CONTRIBUTING.md) guide (**required**).
- [ ] I have ensured `pre-commit run --all-files` passes (**required**).
- [ ] I have contacted @vwxyzjn to obtain access to the [openrlbenchmark W&B team](https://wandb.ai/openrlbenchmark) (**required**).
- [ ] I have tracked applicable experiments in [openrlbenchmark/cleanrl](https://wandb.ai/openrlbenchmark/cleanrl) with `--capture-video` flag toggled on (**required**).
- [ ] I have updated the documentation and previewed the changes via `mkdocs serve`.
- [ ] I have explained note-worthy implementation details.
- [ ] I have explained the logged metrics.
- [ ] I have added links to the original paper and related papers (if applicable).
- [ ] I have added links to the PR related to the algorithm.
- [ ] I have created a table comparing my results against those from reputable sources (i.e., the original paper or other reference implementation).
- [ ] I have added the learning curves (in PNG format with `width=500` and `height=300`).
- [ ] I have added links to the tracked experiments.
- [ ] I have updated the tests accordingly (if applicable).
50 changes: 50 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,56 @@ furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---------------------------------------------------------------------------------
The CONTRIBUTING.md is adopted from https://github.com/entity-neural-network/incubator/blob/2a0c38b30828df78c47b0318c76a4905020618dd/CONTRIBUTING.md
and https://github.com/Stable-Baselines-Team/stable-baselines3-contrib/blob/master/CONTRIBUTING.md

MIT License

Copyright (c) 2021 Entity Neural Network developers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



MIT License

Copyright (c) 2020 Stable-Baselines Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down