Commit Graph

1515 Commits

Author SHA1 Message Date
trigaten
bdde1ede6c Fix Frozen Lake docstring (#2628)
* Update pendulum.py

* version warnings

* black

* try except

* update notices version

* Exception

* nosec

* black

* no loop, stderr

* black

* convert ## to ###

* correct subheader

* black

* despace

* spacing

* frozen lake fixes
2022-02-18 15:26:58 -05:00
trigaten
b5c0cd2894 ## to ### (#2623)
* Update pendulum.py

* version warnings

* black

* try except

* update notices version

* Exception

* nosec

* black

* no loop, stderr

* black

* convert ## to ###

* correct subheader

* black

* despace

* spacing
2022-02-17 19:43:36 -05:00
Ariel Kwiatkowski
29a093ad5a Setter-based approach for the fix (#2626) 2022-02-17 19:38:22 -05:00
J K Terry
e842a8f951 Update version.py 2022-02-17 17:56:09 -05:00
Markus
95063a0894 Updating MuJoCo docstrings (#2616)
* Changed Ant docstring

* Changed half cheetah docstring

* Changed Hopper docstring, modified formulations for Ant, HalfCheetah

* Changed humanoid docstring

* Changed HumanoidStandup, InvertedDoublependulum, InvertedPendulum docstrings

* Updated remaining docstrings, updated names of reward terms, added notes about info
2022-02-17 13:46:19 -05:00
Arcify
2c0358b73f update frozen_lake docs (#2619)
* update frozen_lake docs

* add version history to frozen lake
2022-02-17 13:46:05 -05:00
Daniel
2aa7639431 Update box2d/toy_text docs (#2622)
* Update box2d/toy_text docs

* md format and additional fixes

* grammar
2022-02-17 13:45:51 -05:00
trigaten
a1f14215f3 Enable Legacy Warnings (#2617)
* Update pendulum.py

* version warnings

* black

* try except

* update notices version

* Exception

* nosec

* black

* no loop, stderr

* black
2022-02-17 13:44:11 -05:00
Ariel Kwiatkowski
3fa10a2360 Fix return_info for wrappers (#2612)
* Fix `return_info` for Observation wrappers, Atari (?) and framestack

* Make type checkers and IDEs happier

* Merge in #2454

* Update the info dict based on no-op steps
Some type hints

* Bug fix

* Handle resets during frameskip
2022-02-17 12:03:35 -05:00
Jesse Farebrother
8dc1b52d21 Bump ale-py v0.7.4 (#2621) 2022-02-17 09:45:52 -05:00
Ilya Kamen
27108c98d9 Add types to gym.make("CartPole-v1") and such (#2594)
* Add typing to gym.make via literals

* Fix for type object not subscriptable

* Use Env[ObsType, ActType] instead of specific types to account for wrapping

* Move make and all overloads to `registration.py`

* Hack around py37 typing checks
2022-02-16 12:29:24 -05:00
Markus
1400cfbcac Changed docstrings (#2611) 2022-02-12 19:39:03 -05:00
Markus
936e606200 Improvements to Reacher Documentation (#2596)
* Made changes to Reacher docstring

* Removed [-1, 1]^2, added information on how to weight reward terms
2022-02-12 19:35:21 -05:00
Andrew Tan Jin Shen
87abbcc787 Fix minor bug with Cartpole (#2609)
* Refactor Car Racing to use pygame

* Refactor to clean up code and minor issues

* Black reformat

* Fix bug with state
2022-02-11 11:16:48 -05:00
Andrew Tan Jin Shen
6eba48db95 Refactor classic control rendering to use pygame (#2599)
* refactor classic control rendering to use pygame

* Rebase from upstream

* Revert deletion from rebasing

* Remove pyglet
2022-02-11 10:48:42 -05:00
Andrew Tan Jin Shen
d21dec1829 Refactor Car Racing to use pygame (#2598)
* Refactor Car Racing to use pygame

* Refactor to clean up code and minor issues

* Black reformat
2022-02-11 10:48:28 -05:00
trigaten
c50639cbff Update pendulum.py (#2607) 2022-02-11 10:01:28 -05:00
Omar Younis
334eb4e818 Add rgb_array support for frozen lake env (#2604)
* add pygame GUI for frozen_lake.py env

* add new line at EOF

* pre-commit reformat

* improve graphics

* new images and dynamic window size

* darker tile borders and fix ICC profile

* pre-commit hook

* adjust elf and stool size

* Update frozen_lake.py

* reformat

* fix #2600

* #2600

* add rgb_array support

* reformat

Co-authored-by: J K Terry <jkterry0@gmail.com>
2022-02-11 10:00:40 -05:00
Ilya Kamen
2be9e60a4d Typecheck classic control environments (#2589)
* Typecheck classic control environments

* consistent imports + comments

* Don't use seed method

Although this code is exact duplication, we at least don't call deprecated method.

* Update core.py
2022-02-10 12:24:41 -05:00
J K Terry
8819d56113 Update README.md 2022-02-08 11:20:18 -05:00
J K Terry
110626ee1c Update README.md 2022-02-08 11:18:31 -05:00
J K Terry
526e14e779 Update README.md 2022-02-08 11:18:11 -05:00
J K Terry
240e6bfd86 Update README.md 2022-02-08 11:17:57 -05:00
J K Terry
6f2fe46913 Update README.md 2022-02-08 11:15:50 -05:00
Rushiv Arora
2b6ec51580 Doc typos (#2597)
* Minor Mujoco Doc Typos

* Fixed precommit black
2022-02-07 22:53:47 -05:00
Omar Younis
80d28e5a9c fix #2600 (#2601)
* add pygame GUI for frozen_lake.py env

* add new line at EOF

* pre-commit reformat

* improve graphics

* new images and dynamic window size

* darker tile borders and fix ICC profile

* pre-commit hook

* adjust elf and stool size

* Update frozen_lake.py

* reformat

* fix #2600

* #2600

Co-authored-by: J K Terry <jkterry0@gmail.com>
2022-02-07 20:48:48 -05:00
John Balis
15049e22d7 Adding return_info argument to reset to allow for optional info dict as a second return value (#2546)
* initial draft of optional info dict in reset function, implemented for cartpole, tests seem to be passing

* merged core.py

* updated return type annotation for reset function in core.py

* optional metadata with return_info from reset added for all first party environments, with corresponding tests. Incomplete implementation for wrappers and vector wrappers

* removed Optional type for return_info arguments

* added tests for return_info to normalize wrapper and sync_vector_env

* autoformatted using black

* added optional reset metadata tests to several wrappers

* added return_info capability to async_vector_env.py and test to verify functionality

* added optional return_info test for record_video.py

* removed tests for mujoco environments

* autoformatted

* improved test coverage for optional reset return_info

* re-removed unit test envs accidentally reintroduced in merge

* removed unnecessary import

* changes based on code-review

* small fix to core wrapper typing and autoformatted record_epsisode_stats

* small change to pass flake8 style
2022-02-06 18:28:27 -05:00
Carlos Luis
62e52727d5 Fix jerky camera angle in car racing env (#2525)
* Fix jerky camera angle in car racing env

* Bump the version of CarRacing

* Fix episode termination criterion in car racing env

* Improve lap detection and add argument

* Fix pre-commit

Co-authored-by: J K Terry <justinkterry@gmail.com>
2022-02-06 17:13:11 -05:00
Omar Younis
c6b6754b12 add pygame GUI for frozen_lake.py env (#2568)
* add pygame GUI for frozen_lake.py env

* add new line at EOF

* pre-commit reformat

* improve graphics

* new images and dynamic window size

* darker tile borders and fix ICC profile

* pre-commit hook

* adjust elf and stool size

* Update frozen_lake.py

* reformat

Co-authored-by: J K Terry <jkterry0@gmail.com>
2022-02-05 11:52:02 -05:00
Ilya Kamen
cf634bb444 Add typing to Wrapper signatures (#2590) 2022-02-05 11:25:47 -05:00
Andrew Tan Jin Shen
2e36cde12e Refactor Lunar Lander and Bipedal Walker to use Pygame (#2552)
* Refactor lunar lander to use pygame

* Fix minor rendering inconsistency

* Refactor bipedal walker to use pygame

* Reformat with black

* Remove viewer

* Fix color for obstacles

* Update dependencies for box2d

* Optimize screen initialization
2022-02-05 09:42:45 -05:00
trigaten
11760cd0b0 More richer reacher (#2591) 2022-02-03 08:13:26 -05:00
Rushiv Arora
3f753d75a3 documentation for Mujoco Envs as Docstrings (#2588) 2022-02-02 09:00:27 -05:00
Markus28
2b993c8b98 Supress PyGame import message (#2585) 2022-02-02 09:00:19 -05:00
Adil Zouitine
58aeddb62f Fix RecordEpisodeStatistics wrapper for AsyncEnv (#2586) 2022-01-29 20:44:31 -05:00
trigaten
079c4c9527 Add version histories (#2587)
* docs+credits

* docs: refactor box2d + comment version history

* fix mujoco line lengths

* fix more env line lengths

* black

* typos

* put docstrings in base environments rather than highest version

* fix richer reacher

* black

* correct black version

* continuous mountain car docstring to markdown

* remove unneeded images

* black

* fix quote

* docs: add version history to Box2D envs

* Update lunar_lander.py

Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
2022-01-29 17:53:28 -05:00
Tristan Deleu
39ba73ff17 Add call, get_attr and set_attr methods to VectorEnv (#1600)
* Add call, get_attr and set_attr methods

* Use f-strings and remove assert

* Allow tuples in set_attr and move docstrings

* Replace CubeCrash by CartPole in tests
2022-01-29 12:33:00 -05:00
Tristan Deleu
081c5c1e80 Add call, get_attr and set_attr methods to VectorEnv (#1600)
* Add call, get_attr and set_attr methods

* Use f-strings and remove assert

* Allow tuples in set_attr and move docstrings

* Replace CubeCrash by CartPole in tests
2022-01-29 12:32:35 -05:00
trigaten
b9e8b6c587 Reformat some docstrings, remove unneeded image links (#2578)
* docs+credits

* docs: refactor box2d + comment version history

* fix mujoco line lengths

* fix more env line lengths

* black

* typos

* put docstrings in base environments rather than highest version

* fix richer reacher

* black

* correct black version

* continuous mountain car docstring to markdown

* remove unneeded images

* black

Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
2022-01-27 15:36:50 -05:00
Jared
91d278f2dd Add 'MIT' to license metadata field in setup.py (#2576) 2022-01-26 21:26:54 -05:00
trigaten
b5b40b17bd richer reacher fix and small docstring reorganization (#2577)
* docs+credits

* docs: refactor box2d + comment version history

* fix mujoco line lengths

* fix more env line lengths

* black

* typos

* put docstrings in base environments rather than highest version

* fix richer reacher

* black

* correct black version

Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
2022-01-26 21:21:10 -05:00
trigaten
a149869bcb docs+credits (#2574)
* docs+credits

* docs: refactor box2d + comment version history

* fix mujoco line lengths

* fix more env line lengths

* black

* typos

Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
2022-01-26 16:02:42 -05:00
Ilya Kamen
ad79b0ad0f typing in gym.spaces (#2541)
* typing in spaces.Box and spaces.Discrete

* adds typing to dict and tuple spaces

* Typecheck all spaces

* Explicit regex to include all files under space folder

* Style: use native types and __future__ annotations

* Allow only specific strings for Box.is_bounded args

* Add typing to changes from #2517

* Remove Literal as it's not supported by py3.7

* Use more recent version of pyright

* Avoid name clash for type checker

* Revert "Avoid name clash for type checker"

This reverts commit 1aaf3e0e0328171623a17a997b65fe734bc0afb1.

* Ignore the error. It's reported as probable bug at https://github.com/microsoft/pyright/issues/2852

* rebase and add typing for `_short_repr`
2022-01-24 17:22:11 -05:00
Rushiv Arora
fcbff7de12 Added singledispatch utility to vector.utils & changed order of space argument. (#2536)
* Fixed ordering of space. Added singledispatch utility.

* Added singledispatch utility to vector.utils & changed order of space argument

* Fixed Error from _BaseGymSpaces

* Minor adjustment for Discrete Spaces

* Fixed Tests/ to reflect changes

* Fixed precommit error - custom namespaces

* Concrete Implementations start with _
2022-01-21 11:28:34 -05:00
Ariel Kwiatkowski
925823661d Add options to the signature of env.reset (#2515)
* First find/replace, now tests

* Fixes to the vector env

* Make seed keyword only in wrappers

* (try to) fix the bug with old environments using new wrappers (with the seed keyword)

* black

* Change **kwargs to options, try to make it work; black

* Add OrderEnforcing wrapper to wrapper exports
Add a test for compatibility with old (pybullet-like) envs

* Add OrderEnforcing wrapper to wrapper exports
Add a test for compatibility with old (pybullet-like) envs
black

* Update the env checker

* Update the env checker

* Update the env checker to use inspect (might fail tests, let's see)

* Allow the signature to include kwargs in env_checker

* Minor fix
2022-01-19 17:28:59 -05:00
Ariel Kwiatkowski
186934562f Attempt to fix blackjack rendering tests (#2565)
* Consistently use os.path.join

* Update setup.py

Try to fix tests again
2022-01-19 17:28:43 -05:00
J K Terry
95d649fdec fix pygame rendering dependency 2022-01-19 14:54:20 -05:00
Georg Reich
0bbef5f0fb Added blackjack toytext rendering support (#2550) 2022-01-19 14:52:00 -05:00
Andrea PIERRÉ
d653ebf3b7 Remove mandatory version in environment name (#2535)
* refactor: required version in env name

* refactor: rename env_id function

* refactor: regex + function logic

* test: some more edge cases + error

* refactor: version max/comparison

- Move version max/comparison in a method
- Remove type ignore to improve type checking

* fix: failing tests & error introduced in rebasing

* refactor: simplify map and remove type ignore

* refactor: remove _is_lesser_version() method

* refactor: _versions() to return NamedTuples

* chore: remove minor changes

* Refactor registration EnvSpec and EnvSpecTree

* test: move tests from #2513 here

* fix: typing

* test: try to fix unregistered env

* refactor: change InitVar id name for typing

Changed InitVar id name to fix the following typing error:
error: Declaration "id" is obscured by a declaration of the same name

* refactor: return only the first difflib match

* test: improve tear down of added test env

* refactor: dataclass fields

* refactor: compile regex pattern only once

* refactor: `_assert_version_exists()`

`_assert_version_exists()` rewritten from @JesseFarebro:
https://github.com/openai/gym/pull/2535#discussion_r777573839

* refactor: latest_spec -> latest_versioned_spec

* fix: bug + typing + test

* Add default/versioned tests

* Fix Env field defaults

* feat: improve versioned/unversioned env handling

* Disallow versioned/unversioned registration/lookup

* test: remove warning + check default suggestion

Co-authored-by: Jesse Farebrother <jessefarebro@gmail.com>
2022-01-19 13:50:25 -05:00
Costa Huang
4424278917 Remove reset enforceing in the TimeLimit wrapper (#2556)
* Remove reset enforceing in the `TimeLimit` wrapper

* push changes

* Always enforce order
2022-01-13 15:59:55 -05:00