Skip to content

Commit a725f88

Browse files
committed
update env
1 parent 46ea6d0 commit a725f88

File tree

304 files changed

+31539
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

304 files changed

+31539
-1
lines changed

2022/FA22/intro-ai-series/workshop-1-ai-search-algorithms/frozen_lake.py

+421
Large diffs are not rendered by default.
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Bug Report
3+
about: Submit a bug report
4+
title: "[Bug Report] Bug title"
5+
6+
---
7+
8+
If you are submitting a bug report, please fill in the following details and use the tag [bug].
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**Code example**
14+
Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful.
15+
16+
**System Info**
17+
Describe the characteristic of your environment:
18+
* Describe how Gym was installed (pip, docker, source, ...)
19+
* What OS/version of Linux you're using. Note that while we will accept PRs to improve Window's support, we do not officially support it.
20+
* Python version
21+
22+
**Additional context**
23+
Add any other context about the problem here.
24+
25+
### Checklist
26+
27+
- [ ] I have checked that there is no similar [issue](https://github.com/openai/gym/issues) in the repo (**required**)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Proposal
3+
about: Propose changes that are not fixes bugs
4+
title: "[Proposal] Proposal title"
5+
---
6+
7+
8+
9+
### Proposal
10+
11+
A clear and concise description of the proposal.
12+
13+
### Motivation
14+
15+
Please outline the motivation for the proposal.
16+
Is your feature request related to a problem? e.g.,"I'm always frustrated when [...]".
17+
If this is related to another GitHub issue, please link here too.
18+
19+
### Pitch
20+
21+
A clear and concise description of what you want to happen.
22+
23+
### Alternatives
24+
25+
A clear and concise description of any alternative solutions or features you've considered, if any.
26+
27+
### Additional context
28+
29+
Add any other context or screenshots about the feature request here.
30+
31+
### Checklist
32+
33+
- [ ] I have checked that there is no similar [issue](https://github.com/openai/gym/issues) in the repo (**required**)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: Question
3+
about: Ask a question
4+
title: "[Question] Question title"
5+
---
6+
7+
8+
### Question
9+
10+
If you're a beginner and have basic questions, please ask on [r/reinforcementlearning](https://www.reddit.com/r/reinforcementlearning/) or in the [RL Discord](https://discord.com/invite/xhfNqQv) (if you're new please use the beginners channel). Basic questions that are not bugs or feature requests will be closed without reply, because GitHub issues are not an appropriate venue for these.
11+
12+
Advanced/nontrivial questions, especially in areas where documentation is lacking, are very much welcome.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] This change requires a documentation update
15+
16+
### Screenshots
17+
Please attach before and after screenshots of the change if applicable.
18+
19+
<!--
20+
Example:
21+
22+
| Before | After |
23+
| ------ | ----- |
24+
| _gif/png before_ | _gif/png after_ |
25+
26+
27+
To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections.
28+
-->
29+
30+
# Checklist:
31+
32+
- [ ] I have run the [`pre-commit` checks](https://pre-commit.com/) with `pre-commit run --all-files` (see `CONTRIBUTING.md` instructions to set it up)
33+
- [ ] I have commented my code, particularly in hard-to-understand areas
34+
- [ ] I have made corresponding changes to the documentation
35+
- [ ] My changes generate no new warnings
36+
- [ ] I have added tests that prove my fix is effective or that my feature works
37+
- [ ] New and existing unit tests pass locally with my changes
38+
39+
<!--
40+
As you go through the checklist above, you can mark something as done by putting an x character in it
41+
42+
For example,
43+
- [x] I have done this task
44+
- [ ] I have not done this task
45+
-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Configuration for probot-stale - https://github.com/probot/stale
2+
3+
# Number of days of inactivity before an Issue or Pull Request becomes stale
4+
daysUntilStale: 60
5+
6+
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
7+
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
8+
daysUntilClose: 14
9+
10+
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
11+
onlyLabels:
12+
- more-information-needed
13+
14+
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
15+
exemptLabels:
16+
- pinned
17+
- security
18+
- "[Status] Maybe Later"
19+
20+
# Set to true to ignore issues in a project (defaults to false)
21+
exemptProjects: true
22+
23+
# Set to true to ignore issues in a milestone (defaults to false)
24+
exemptMilestones: true
25+
26+
# Set to true to ignore issues with an assignee (defaults to false)
27+
exemptAssignees: true
28+
29+
# Label to use when marking as stale
30+
staleLabel: stale
31+
32+
# Comment to post when marking as stale. Set to `false` to disable
33+
markComment: >
34+
This issue has been automatically marked as stale because it has not had
35+
recent activity. It will be closed if no further activity occurs. Thank you
36+
for your contributions.
37+
38+
# Comment to post when removing the stale label.
39+
# unmarkComment: >
40+
# Your comment here.
41+
42+
# Comment to post when closing a stale Issue or Pull Request.
43+
# closeComment: >
44+
# Your comment here.
45+
46+
# Limit the number of actions per hour, from 1-30. Default is 30
47+
limitPerRun: 30
48+
49+
# Limit to only `issues` or `pulls`
50+
only: issues
51+
52+
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
53+
# pulls:
54+
# daysUntilStale: 30
55+
# markComment: >
56+
# This pull request has been automatically marked as stale because it has not had
57+
# recent activity. It will be closed if no further activity occurs. Thank you
58+
# for your contributions.
59+
60+
# issues:
61+
# exemptLabels:
62+
# - confirmed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: build
2+
on: [pull_request, push]
3+
4+
permissions:
5+
contents: read # to fetch code (actions/checkout)
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
13+
steps:
14+
- uses: actions/checkout@v2
15+
- run: |
16+
docker build -f py.Dockerfile \
17+
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
18+
--tag gym-docker .
19+
- name: Run tests
20+
run: docker run gym-docker pytest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://pre-commit.com
2+
# This GitHub Action assumes that the repo contains a valid .pre-commit-config.yaml file.
3+
name: pre-commit
4+
on:
5+
pull_request:
6+
push:
7+
branches: [master]
8+
permissions:
9+
contents: read # to fetch code (actions/checkout)
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-python@v2
16+
- run: pip install pre-commit
17+
- run: pre-commit --version
18+
- run: pre-commit install
19+
- run: pre-commit run --all-files
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
*.swp
2+
*.pyc
3+
*.py~
4+
.DS_Store
5+
.cache
6+
.pytest_cache/
7+
8+
# Setuptools distribution and build folders.
9+
/dist/
10+
/build
11+
12+
# Virtualenv
13+
/env
14+
15+
# Python egg metadata, regenerated from source files by setuptools.
16+
/*.egg-info
17+
18+
*.sublime-project
19+
*.sublime-workspace
20+
21+
logs/
22+
23+
.ipynb_checkpoints
24+
ghostdriver.log
25+
26+
junk
27+
MUJOCO_LOG.txt
28+
29+
rllab_mujoco
30+
31+
tutorial/*.html
32+
33+
# IDE files
34+
.eggs
35+
.tox
36+
37+
# PyCharm project files
38+
.idea
39+
vizdoom.ini
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
repos:
3+
- repo: https://github.com/python/black
4+
rev: 22.3.0
5+
hooks:
6+
- id: black
7+
- repo: https://github.com/codespell-project/codespell
8+
rev: v2.1.0
9+
hooks:
10+
- id: codespell
11+
args:
12+
- --ignore-words-list=nd,reacher,thist,ths, ure, referenc
13+
- repo: https://gitlab.com/PyCQA/flake8
14+
rev: 4.0.1
15+
hooks:
16+
- id: flake8
17+
args:
18+
- '--per-file-ignores=*/__init__.py:F401 gym/envs/registration.py:E704'
19+
- --ignore=E203,W503,E741
20+
- --max-complexity=30
21+
- --max-line-length=456
22+
- --show-source
23+
- --statistics
24+
- repo: https://github.com/PyCQA/isort
25+
rev: 5.10.1
26+
hooks:
27+
- id: isort
28+
args: ["--profile", "black"]
29+
- repo: https://github.com/pycqa/pydocstyle
30+
rev: 6.1.1 # pick a git hash / tag to point to
31+
hooks:
32+
- id: pydocstyle
33+
exclude: ^(gym/version.py)|(gym/envs/)|(tests/)
34+
args:
35+
- --source
36+
- --explain
37+
- --convention=google
38+
additional_dependencies: ["toml"]
39+
- repo: https://github.com/asottile/pyupgrade
40+
rev: v2.32.0
41+
hooks:
42+
- id: pyupgrade
43+
# TODO: remove `--keep-runtime-typing` option
44+
args: ["--py36-plus", "--keep-runtime-typing"]
45+
- repo: local
46+
hooks:
47+
- id: pyright
48+
name: pyright
49+
entry: pyright
50+
language: node
51+
pass_filenames: false
52+
types: [python]
53+
additional_dependencies: ["pyright"]
54+
args:
55+
- --project=pyproject.toml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
OpenAI Gym is dedicated to providing a harassment-free experience for
2+
everyone, regardless of gender, gender identity and expression, sexual
3+
orientation, disability, physical appearance, body size, age, race, or
4+
religion. We do not tolerate harassment of participants in any form.
5+
6+
This code of conduct applies to all OpenAI Gym spaces (including Gist
7+
comments) both online and off. Anyone who violates this code of
8+
conduct may be sanctioned or expelled from these spaces at the
9+
discretion of the OpenAI team.
10+
11+
We may add additional rules over time, which will be made clearly
12+
available to participants. Participants are responsible for knowing
13+
and abiding by these rules.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Gym Contribution Guidelines
2+
3+
At this time we are currently accepting the current forms of contributions:
4+
5+
- Bug reports (keep in mind that changing environment behavior should be minimized as that requires releasing a new version of the environment and makes results hard to compare across versions)
6+
- Pull requests for bug fixes
7+
- Documentation improvements
8+
9+
Notably, we are not accepting these forms of contributions:
10+
11+
- New environments
12+
- New features
13+
14+
This may change in the future.
15+
If you wish to make a Gym environment, follow the instructions in [Creating Environments](https://github.com/openai/gym/blob/master/docs/creating_environments.md). When your environment works, you can make a PR to add it to the bottom of the [List of Environments](https://github.com/openai/gym/blob/master/docs/third_party_environments.md).
16+
17+
18+
Edit July 27, 2021: Please see https://github.com/openai/gym/issues/2259 for new contributing standards
19+
20+
# Development
21+
This section contains technical instructions & hints for the contributors.
22+
23+
## Type checking
24+
The project uses `pyright` to check types.
25+
To type check locally, install `pyright` per official [instructions](https://github.com/microsoft/pyright#command-line).
26+
It's configuration lives within `pyproject.toml`. It includes list of included and excluded files currently supporting type checks.
27+
To run `pyright` for the project, run the pre-commit process (`pre-commit run --all-files`) or `pyright --project=pyproject.toml`
28+
Alternatively, pyright is a built-in feature of VSCode that will automatically provide type hinting.
29+
30+
### Adding typing to more modules and packages
31+
If you would like to add typing to a module in the project,
32+
the list of included, excluded and strict files can be found in pyproject.toml (pyproject.toml -> [tool.pyright]).
33+
To run `pyright` for the project, run the pre-commit process (`pre-commit run --all-files`) or `pyright`
34+
35+
## Git hooks
36+
The CI will run several checks on the new code pushed to the Gym repository. These checks can also be run locally without waiting for the CI by following the steps below:
37+
1. [install `pre-commit`](https://pre-commit.com/#install),
38+
2. Install the Git hooks by running `pre-commit install`.
39+
40+
Once those two steps are done, the Git hooks will be run automatically at every new commit.
41+
The Git hooks can also be run manually with `pre-commit run --all-files`, and if needed they can be skipped (not recommended) with `git commit --no-verify`.
42+
**Note:** you may have to run `pre-commit run --all-files` manually a couple of times to make it pass when you commit, as each formatting tool will first format the code and fail the first time but should pass the second time.
43+
44+
Additionally, for pull requests, the project runs a number of tests for the whole project using [pytest](https://docs.pytest.org/en/latest/getting-started.html#install-pytest).
45+
These tests can be run locally with `pytest` in the root folder.
46+
47+
## Docstrings
48+
Pydocstyle has been added to the pre-commit process such that all new functions follow the [google docstring style](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html).
49+
All new functions require either a short docstring, a single line explaining the purpose of a function
50+
or a multiline docstring that documents each argument and the return type (if there is one) of the function.
51+
In addition, new file and class require top docstrings that should outline the purpose of the file/class.
52+
For classes, code block examples can be provided in the top docstring and not the constructor arguments.
53+
54+
To check your docstrings are correct, run `pre-commit run --all-files` or `pydocstyle --source --explain --convention=google`.
55+
If all docstrings that fail, the source and reason for the failure is provided.

0 commit comments

Comments
 (0)