Commit Graph

1762 Commits

Author SHA1 Message Date
Mark Towers
1061949d0c Update to v0.25.2 (#3033) 2022-08-18 14:24:42 -04:00
Mark Towers
a8d4dd7b14 Add testing for step api compatibility functions and wrapper (#3028)
* Initial commit

* Fixed tests and forced TimeLimit.truncated to always exist when truncated or terminated

* Fix CI issues

* pre-commit

* Revert back to old language

* Revert changes to step api wrapper
2022-08-18 10:25:46 -04:00
Xuehai Pan
aa43d135eb Consider key order in spaces.Dict.__eq__ (#3024) 2022-08-18 08:49:02 -04:00
Ariel Kwiatkowski
51c2026f19 Fix unpickling Box2D and MuJoCo envs (#3025)
* Try to fix car racing unpickling

* Fix EzPickle for BipedalWalker and LunarLander

* Shamelessly steal the pickle-unpickle test from Mark, with slight modifications

* CarRacing EzPickle fix

* Mujoco ezpickle fix
2022-08-16 12:05:36 -04:00
Mark Towers
f54319e742 Type hint mujoco_env.py and update pyright (#3015)
* Investigated the pyright attributes and removed mujoco from ignored

* Fixed pyright CI
2022-08-16 11:59:18 -04:00
Olaf Lipinski
a6b87f1ae1 Reduce memory consumption and hanging for Dict and Tuple spaces (#3011)
* Reduce memory consumption and hanging.

Signed-off-by: Olaf Lipinski <o.lipinski@soton.ac.uk>

* Use len(subseeds) instead of x.
Clearer error message

Signed-off-by: Olaf Lipinski <o.lipinski@soton.ac.uk>

* Allow for non-unique seeds in subspaces

Signed-off-by: Olaf Lipinski <o.lipinski@soton.ac.uk>

* Update docstrings

Signed-off-by: Olaf Lipinski <o.lipinski@soton.ac.uk>

* Update doc for Tuple

Signed-off-by: Olaf Lipinski <o.lipinski@soton.ac.uk>

Signed-off-by: Olaf Lipinski <o.lipinski@soton.ac.uk>
2022-08-16 11:59:10 -04:00
YouJiacheng
e24877a870 Avoid metaclass conflicts when inheriting from gym.Env (#3001)
Using __init_subclass__ instead of metaclass, suggested by PEP 487(introduced in python3.6).
As a result, downstream package can safely inherit from gym.Env and abc.ABC/Protocol/...(classes with metaclass != type), or set their own metaclass without making a intermediate metaclass inherited from custom metaclass and type(gym.Env).
2022-08-16 11:19:31 -04:00
Raja Grewal
3303783811 Corrected episode end description for mujoco/ant (#3029) 2022-08-16 09:21:51 -04:00
Arjun KG
3da6b6e143 handle no info mask (#3026) 2022-08-15 11:23:00 -04:00
Markus Krimmel
63ea5f2517 Add Sequence space, update flatten functions (#2968)
* Added Sequence space, updated flatten functions to work with Sequence, Graph. WIP.

* Small fixes, added Sequence space to tests

* Replace Optional[Any] by Any

* Added tests for flattening of non-numpy-flattenable spaces

* Return all seeds
2022-08-15 11:11:32 -04:00
Mark Towers
8b744130bc Fixed all environment close issues in testing (#3020) 2022-08-08 17:41:15 -04:00
Andrea PIERRÉ
607602b531 Add swig as a Box2D dependency (#3009) 2022-08-03 07:40:29 -04:00
Alexander Zhang
dce35dfa92 Add type annotations for metadata and render_mode (#3007) 2022-08-01 07:53:41 -04:00
Mark Towers
96e6cd66df Version v0.25.1 (#2988) 2022-07-26 18:29:43 -04:00
Omar Younis
9d35dc8746 fix render popping when render is called internally for Wrappers (#2998)
* fix render popping when render is called internally

* move _render workaround from Wrapper to PixelObservation
2022-07-26 18:20:51 -04:00
Omar Younis
cb3df610e3 Add pygame GUI for Cliffwalking (#2997)
* fix typo

* add pygame render cliffwalking

* refactor frozen lake, new images for cliffwalking

* backto old images

* improve graphics

* use old images

* refactor frozen lake

* reformat
2022-07-26 16:31:18 -04:00
I-Ju Lin
b8115b0b07 Update swimmer_v4.py (#2993)
Fix the type-o of rotors
2022-07-26 16:23:28 -04:00
Mark Towers
3ea8819803 backward compatibility when metadata doesn't include render mode (#2990) 2022-07-26 08:40:35 -04:00
Georg Reich
ddd441953d fixed bipedal walker render rgb_array (#2991)
(returning uncropped width)
2022-07-24 14:57:02 -04:00
Vangelis
39b8661cb0 Rephrase observations' definition in Lunar Lander Environment (#2987) 2022-07-23 10:39:15 -04:00
Mark Towers
3c60ae97d1 Remove pytest.importorskip (#2976) 2022-07-23 10:38:52 -04:00
Ice1187
8461425286 Fix typo (#2980) 2022-07-21 09:00:57 -04:00
Vincent Moens
8e812e1de5 Raise warning in PixelObservationWrapper if render_mode is None (#2978)
* init

* adapt PixelObservationWrapper to new API

* reformat

Co-authored-by: younik <omar.younis98@gmail.com>
2022-07-18 11:30:12 -04:00
Zhiqing Xiao
ce6bad7185 Bug fix: Revert an incorrect edition on wrapper.FrameStack (#2973) 2022-07-18 09:25:00 -04:00
Tim Gates
e741d4203a docs: Fix a few typos (#2971) 2022-07-17 16:50:56 -04:00
Mark Towers
5dc2076285 Updating the docstring disable_env_checker (#2967) 2022-07-17 16:50:40 -04:00
Pablo Samuel Castro
98a929303f Fix reset bounds for mountain car (#2965)
* Fix reset bounds for mountain car

This was a typo bug that was introduced in ca39816943

* Fix reset bounds for mountain_car

This was a typo bug that was introduced in ca39816943

* Fixing formatting of files with pre-commit
2022-07-15 05:22:34 -04:00
Mark Towers
f3f8a970b7 Fixed tests for Car racing v2 (#2964) 2022-07-14 08:35:02 -04:00
Mark Towers
ddce4a56c8 Bump Car racing and Remove Car Racing Discrete (#2963)
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset

* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"

This reverts commit 519dfd9117.

* Remove bad pushed commits

* Fixed spelling in core.py

* Pins pytest to the last py 3.6 version

* Allow Box automatic scalar shape

* Add test box and change default from () to (1,)

* update Box shape inference with more strict checking

* Update the box shape and add check on the custom Box shape

* Removed incorrect shape type and assert shape code

* Update the Box and associated tests

* Move dependency error to inside the atari environment

* Update the gym version to v0.25.0

* Bump car racing and remove car racing discrete
2022-07-13 15:52:43 -04:00
Mark Towers
aeda7eb358 Version v0.25.0 release (#2949) 2022-07-13 09:47:08 -04:00
Mark Towers
634afec9bc Text space (#2959)
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset

* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"

This reverts commit 519dfd9117.

* Remove bad pushed commits

* Fixed spelling in core.py

* Pins pytest to the last py 3.6 version

* Add Text space

* Add Text space

* Added Text space

* Updated comment

* Allow Box automatic scalar shape

* Add test box and change default from () to (1,)

* Refactored conditional

* Refactored contains()

* update Box shape inference with more strict checking

* Update the box shape and add check on the custom Box shape

* Removed incorrect shape type and assert shape code

* Update the Box and associated tests

* Move dependency error to inside the atari environment

* Update the gym version to v0.25.0

* Fixed bugs in Text space and tests

* Code review by Drew

Co-authored-by: Ryan Rudes <ryanrudes@gmail.com>
2022-07-11 11:39:04 -04:00
Mark Towers
015b31fa76 Bug fix, add tests for environment checker and passive environment checker wrapper (#2903) 2022-07-10 21:45:24 -04:00
Arjun KG
907b1b20dd New Step API with terminated, truncated bools instead of done (#2752) 2022-07-09 16:48:06 -04:00
Rodrigo de Lazcano
e3c05c2b59 split base mujoco env class (#2946) 2022-07-06 11:18:03 -04:00
Denis Khoshaba
571fcd6f9f improve docker image size (#2953) 2022-07-06 09:49:28 -04:00
Giovanni Minelli
c292d35d87 RecordVideo wrapper revived (#2894) 2022-07-06 07:10:56 -04:00
Pablo Samuel Castro
ca39816943 Add reset params (with np support) (#2926) 2022-07-06 07:08:01 -04:00
Mark Towers
071f0bf9c0 Fix error with import gym without cv2 (#2948) 2022-07-05 08:25:13 -04:00
Mark Towers
2ede09074f Full type hinting (#2942)
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset

* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"

This reverts commit 519dfd9117.

* Remove bad pushed commits

* Fixed spelling in core.py

* Pins pytest to the last py 3.6 version

* Allow Box automatic scalar shape

* Add test box and change default from () to (1,)

* update Box shape inference with more strict checking

* Update the box shape and add check on the custom Box shape

* Removed incorrect shape type and assert shape code

* Update the Box and associated tests

* Remove all folders and files from pyright exclude

* Revert issues

* Push RedTachyon code review

* Add Python Platform

* Remove play from pyright check

* Fixed CI issues

* remove mujoco env type hinting

* Fixed pixel observation test

* Added some new type hints

* Fixed CI errors

* Fixed CI errors

* Remove play.py from exlucde pyright

* Fixed pyright issues
2022-07-04 13:19:25 -04:00
Markus Krimmel
9e66399b4e Try to fetch keys_to_action from environment, made tests stronger (#2945) 2022-07-01 18:08:01 -04:00
Markus Krimmel
cc7552f6de Properly check whether AttributeError is caused by render_mode (#2941) 2022-07-01 09:47:10 -04:00
Jet
f042d0beb9 Add option to change colour on carracing through "options" argument, remove carracingdomainrandomize registration (#2931)
* add option to change colour on carracing through "option"

* fix dict bug

* black

* add docs for reset arg

* fix thing

* remove randomize from registration

* update doc

* update docs

* update docs

* remove unnecessary argument

* fix thing

* fix thing

* f

* update docs

* add test

* remove unused import

* Update registration.py
2022-06-30 12:06:51 -04:00
Ariel Kwiatkowski
9c1d288a2d [WIP] Typing fixes (#2939)
* Update pyproject.toml

* Maybe fix typing for frozen lake and taxi

* Clean up pyproject a bit

* Reenable box2d pyright

* Disable box2d pyright

* Fix typing for toy text envs

* Narrow down pyright excludes for almost everything except mujoco

* Fix a wrapper test typing

* Remove env checker from excludes

* Remove redundant type hints which mess up pyright. And a typo fix.

* Remove test_spaces exclude

* Remove some redundant warnings

* Change pyright ignore to more specific

* Fix a weird private variable which gets explicitly exported for whatever reason. It's still exported for backwards compatibility, but internal code now uses a public variable.

* re-export the private variable

* Fix lunar_lander typing

* Remove lunar lander from excludes

* Small fix
2022-06-30 12:04:14 -04:00
KexianShen
2017f3ed9e Fix the initialization of render mode set (#2938) 2022-06-30 11:00:47 -04:00
Rodrigo de Lazcano
61a39f41bc Initialize observation spaces and pytest (#2929)
* Remove step initialization for mujoco obs spaces

	* remove step initialization for mujoco obs space

	* pre-commit

pytest obs space mujoco
2022-06-30 10:59:59 -04:00
Mark Towers
7f6effbc0d Inferring Box scalar shape (#2911)
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset

* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"

This reverts commit 519dfd9117.

* Remove bad pushed commits

* Fixed spelling in core.py

* Pins pytest to the last py 3.6 version

* Allow Box automatic scalar shape

* Add test box and change default from () to (1,)

* update Box shape inference with more strict checking

* Update the box shape and add check on the custom Box shape

* Removed incorrect shape type and assert shape code

* Update the Box and associated tests
2022-06-29 11:17:25 -04:00
Rodrigo de Lazcano
0dba072046 remove sys.exit(0) mujoco render (#2930) 2022-06-28 08:54:10 -04:00
Mark Towers
024b0f5160 Added Action masking for Space.sample() (#2906)
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset

* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"

This reverts commit 519dfd9117.

* Remove bad pushed commits

* Fixed spelling in core.py

* Pins pytest to the last py 3.6 version

* Add support for action masking in Space.sample(mask=...)

* Fix action mask

* Fix action_mask

* Fix action_mask

* Added docstrings, fixed bugs and added taxi examples

* Fixed bugs

* Add tests for sample

* Add docstrings and test space sample mask Discrete and MultiBinary

* Add MultiDiscrete sampling and tests

* Remove sample mask from graph

* Update gym/spaces/multi_discrete.py

Co-authored-by: Markus Krimmel <montcyril@gmail.com>

* Updates based on Marcus28 and jjshoots for Graph.py

* Updates based on Marcus28 and jjshoots for Graph.py

* jjshoot review

* jjshoot review

* Update assert check

* Update type hints

Co-authored-by: Markus Krimmel <montcyril@gmail.com>
2022-06-26 18:23:15 -04:00
J K Terry
d750eb8df0 fix some pixel art credits 2022-06-26 10:27:36 -04:00
Omar Younis
2fb6043a62 Fix: warning for mode in render with python 3.6 (#2927) 2022-06-25 14:10:55 -04:00