Commit Graph

1804 Commits

Author SHA1 Message Date
Mark Towers
08fbbf0e6c Mujoco metadata (#2904) 2022-06-19 16:50:31 -04:00
Mark Towers
f5f8479b00 Add vector make tests (#2901) 2022-06-19 16:50:07 -04:00
Mark Towers
528d878d57 Fixed action dim check (#2899) 2022-06-19 16:49:47 -04:00
Mark Towers
dc39a4ef8e Pin pytest to 7.0.1 (#2898) 2022-06-19 16:49:28 -04:00
Omar Younis
a7e1861f5c Fix: add mujoco render arguments to init (#2891)
* fix: add render_mode getter to Wrappers

* fix: add render args to mujoco init

* reformat

* add type hints
2022-06-16 12:29:50 -04:00
Omar Younis
f2aeb823f7 check render_mode in make (#2896) 2022-06-16 12:29:44 -04:00
Mark Towers
ffbf971171 Rewrite env tests (#2867) 2022-06-16 09:29:13 -04:00
Antonin RAFFIN
71f11a0642 Fix CarRacing termination (#2890) 2022-06-15 09:34:42 -04:00
Omar Younis
a5afdb3f7a fix: allow mode as argument (#2893)
* allow mode as argument

* change Wrapper render doc
2022-06-15 09:33:03 -04:00
Antonin RAFFIN
3498617bf0 Fix TimeLimit wrapper and add tests (#2888)
* Fix TimeLimit wrapper and add tests

* Slip test
2022-06-15 09:21:53 -04:00
Omar Younis
053ee80932 fix: add render_mode getter to Wrappers (#2884) 2022-06-12 21:55:24 -04:00
Giovanni Minelli
1a7a727b40 Updated FrozenLakeEnv docstring (#2877) 2022-06-12 09:09:09 -04:00
Tony Tran
721153286e Env Step Check allow rewards to be np int (#2879) 2022-06-10 11:10:53 -04:00
Jet
a6274a55f0 Add Graph to Spaces (#2869) 2022-06-09 10:42:58 -04:00
Rodrigo de Lazcano
f9e2b92e00 remove xml_file from mujoco args (#2872) 2022-06-09 09:38:18 -04:00
Mark Towers
519dfd9117 fixed gym.vector.make where the checker was being applied in the opposite case than was intended to (#2871) 2022-06-08 09:55:07 -04:00
Omar Younis
9acf9cd367 Render API (#2671)
* 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

* test render api change on FrozenLake

* add render support for reset on frozenlake

* add clock on pygame render

* new render api for blackjack

* new render api for cliffwalking

* new render api for Env class

* update reset method, lunar and Env

* fix wrapper

* fix reset lunar

* new render api for box2d envs

* new render api for mujoco envs

* fix bug

* new render api for classic control envs

* fix tests

* add render_mode None for CartPole

* new render api for test fake envs

* pre-commit hook

* fix FrozenLake

* fix FrozenLake

* more render_mode to super - frozenlake

* remove kwargs from frozen_lake new

* pre-commit hook

* add deprecated render method

* add backwards compatibility

* fix test

* add _render

* move pygame.init() (avoid pygame dependency on init)

* fix pygame dependencies

* remove collect_render() maintain multi-behaviours .render()

* add type hints

* fix renderer

* don't call .render() with None

* improve docstring

* add single_rgb_array to all envs

* remove None from metadata["render_modes"]

* add type hints to test_env_checkers

* fix lint

* add comments to renderer

* add comments to single_depth_array and single_state_pixels

* reformat

* add deprecation warnings and env.render_mode declaration

* fix lint

* reformat

* fix tests

* add docs

* fix car racing determinism

* remove warning test envs, customizable modes on renderer

* remove commments and add todo for env_checker

* fix car racing

* replace render mode check with assert

* update new mujoco

* reformat

* reformat

* change metaclass definition

* fix tests

* implement mark suggestions (test, docs, sets)

* check_render

Co-authored-by: J K Terry <jkterry0@gmail.com>
2022-06-07 18:20:56 -04:00
Mark Towers
66c431d4b3 Incremented the version to v24.1 (#2870) 2022-06-07 09:50:07 -04:00
Mark Towers
734bd4b577 Rewrite setup (#2865)
* Updated testing requirements based off extra["testing"]

* Updated setup to check the version is valid, added testing and all dependency groups and collects the requirements from requirements.txt to keep everything standardized.

* Updated requirements.txt based on the current minimum gym requirements.txt to work

* Updated requirements.txt based on the current minimum gym requirements.txt to work

* Updated test_requirements.txt based on the current gym full testing requirements

* Pre-commit updates

* Add integer check for the `n` parameter

* The type of self.spaces is an Iterable which is absorbed by the tuple.

* Simplifies the environment checker to two files, env_checker.py and passive_env_checker.py with a new wrapper env_checker.py

* Adds the passive environment checker on `gym.make`

* Ignore the `check_env` warn parameter

* Ignore the `check_env` warn parameter

* Use the `data_equivalence` function

* Remove env_checker PR changes

* Move pip install pytest and mock to py 3.6

* Update setup.py and requirements.txt
2022-06-06 17:27:34 -04:00
Mark Towers
134de4a713 Updates the environment checker (#2864)
* Updated testing requirements based off extra["testing"]

* Updated setup to check the version is valid, added testing and all dependency groups and collects the requirements from requirements.txt to keep everything standardized.

* Updated requirements.txt based on the current minimum gym requirements.txt to work

* Updated requirements.txt based on the current minimum gym requirements.txt to work

* Updated test_requirements.txt based on the current gym full testing requirements

* Pre-commit updates

* Add integer check for the `n` parameter

* The type of self.spaces is an Iterable which is absorbed by the tuple.

* Simplifies the environment checker to two files, env_checker.py and passive_env_checker.py with a new wrapper env_checker.py

* Adds the passive environment checker on `gym.make`

* Ignore the `check_env` warn parameter

* Ignore the `check_env` warn parameter

* Use the `data_equivalence` function

* Revert rewrite setup.py changes

* Remove smart formatting for 3.6 support

* Fixed `check_action_space` and `check_observation_space`

* Added disable_env_checker to vector.make such that env_checker would only run on the first environment created.

* Removing check that different seeds would produce different initialising states

* Use the unwrapped environment np_random

* Fixed vector environment creator
2022-06-06 11:21:45 -04:00
Mark Towers
9fa7ede1e3 Forwards all np_random assignments to the actual environment and prevent access to the _np_random in wrappers (#2857) 2022-06-06 09:56:51 -04:00
Gianluca De Cola
fa01fdad9d fix docstring. (#2868) 2022-06-06 09:14:03 -04:00
J K Terry
6744d53aec remove unuseful comments 2022-06-06 09:04:16 -04:00
Rodrigo de Lazcano
8a323c9479 Fix issue #2860 (#2861)
* fix arguments key callback

	* close env in renderer

	* mujoco_rendering close base method
2022-06-04 14:28:31 -04:00
Mark Towers
9147790e96 Fixed the docstring to reflect the actual environment implementation (#2858) 2022-06-02 14:50:26 -04:00
Gianluca De Cola
83dac2c934 Test BipedalWalker hardcore kwargs. Refer to #2767 (#2841)
* test hardcore environment creation.

* add type hint.

* typo.
2022-06-02 14:19:17 -04:00
Mark Towers
53ff70eed8 Fixed doc strings for the website (#2846) 2022-06-02 08:01:21 -04:00
Jordan Terry
6b1e30dd4a show readme as pypi description 2022-06-01 00:24:11 -04:00
Jordan Terry
0e99e3c624 Added support for unpickling legacy Box (#2851) (#2854)
Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
2022-05-31 23:53:13 -04:00
Jordan Terry
34fba52e4b Update LICENSE.md 2022-05-30 20:05:04 -04:00
Ariel Kwiatkowski
6c8abeff15 Remove a redundant warning in registration (#2850)
* Update registration.py

* Style
2022-05-30 10:38:20 -04:00
Alessio Quaglino
1b09a7eb08 Remove operations from xml files (#2843)
Inserting operations in the xml file cases MuJoCo to ignore the operation and set to zero the following numbers
2022-05-27 18:53:00 -04:00
Mark Towers
e89b00c363 Updated the gym version to v0.24 (#2839) 2022-05-25 10:29:51 -04:00
Mark Towers
0263deb5ab Add support for python 3.6 (#2836)
* Add support for python 3.6

* Add support for python 3.6

* Added check for python 3.6 to not install mujoco as no version exists

* Fixed the install groups for python 3.6

* Re-added python 3.6 support for gym

* black

* Added support for dataclasses through dataclasses module in setup that backports the module

* Fixed install requirements

* Re-added dummy env spec with dataclasses

* Changed type for compatability for python 3.6

* Added a python 3.6 warning

* Fixed python 3.6 typing issue

* Removed __future__ import annotation for python 3.6 support

* Fixed python 3.6 typing
2022-05-25 10:28:19 -04:00
Mark Towers
273e3f22ce Updated docstrings using darglint (#2827)
* Updated docstrings using darglint, ignoring 402 and 202 plus shortened lines into multiple where they were overflowing

* Remove abstract method decorators, for a future PR

* Add __future__ import annotation for python 3.7+ notion

* Added missing bracket

* Fix minor docstring tables
2022-05-25 09:46:41 -04:00
Mark Towers
4487008ea9 Mujoco and Website Docstring fixes (#2834)
* Fixed minor docstring issues found on the website

* Updated the top docstrings with mujoco environments that fixed the observation and action tables. Added v4 gym.make code
2022-05-24 18:09:05 -04:00
Mark Towers
f2c3f73f3a Updated mujoco to 2.2.0 from 2.1.5 (#2835) 2022-05-24 18:08:57 -04:00
Ariel Kwiatkowski
2eca1199a4 Update registration.py (#2833) 2022-05-24 10:42:14 -04:00
Gianluca De Cola
49d8299a1e New info API for vectorized environments #2657 (#2773)
* WIP refactor info API sync vector.

* Add missing untracked file.

* Add info strategy to reset_wait.

* Add interface and docstring.

* info with strategy pattern on async vector env.

* Add default to async vecenv.

* episode statistics for asyncvecnev.

* Add tests info strategy format.

* Add info strategy to reset_wait.

* refactor and cleanup.

* Code cleanup. Add tests.

* Add tests for video recording with new info format.

* fix test case.

* fix camelcase.

* rename enum.

* update tests, docstrings, cleanup.

* Changes brax strategy to numpy. add_strategy method in StrategyFactory. Add tests.

* fix docstring and logging format.

* Set Brax info format as default. Remove classic info format. Update tests.

* breaking the wrong loop.

* WIP: wrapper.

* Add wrapper for brax to classic info.

* WIP: wrapper with nested RecordEpisodeStatistic.

* Add tests. Refactor docstrings. Cleanup.

* cleanup.

* patch conflicts.

* rebase and conflicts.

* new pre-commit conventions.

* docstring.

* renaming.

* incorporate info_processor in vecEnv.

* renaming. Create info dict only if needed.

* remove all brax references. update docstring. Update duplicate test.

* reviews.

* pre-commit.

* reviews.

* docstring.

* cleanup blank lines.

* add support for numpy dtypes.

* docstring fix.

* formatting.

* naming.

* assert correct info from wrappers chaining. Test correct wrappers chaining. naming.

* simplify episode_statistics.

* change args orer.

* update tests.

* wip: refactor episode_statistics.

* Add test for add_vecore_episode_statistics.
2022-05-24 10:36:35 -04:00
Mark Towers
bbf8f5a467 Bump the ale-py version (#2832)
* Up the ale-py version

* Updates the ale-py version
2022-05-24 10:27:22 -04:00
Rodrigo de Lazcano
3e006f3ea5 Add new MuJoCo bindings (#2762) 2022-05-24 08:47:51 -04:00
Andrew Tan
8f9b62f6a6 Fix scale for Car Racing (#2831)
* Shift relative position of coordinates in render

* Format file
2022-05-23 14:42:53 -04:00
Arjun KG
a37b956d57 Add support for including module with gym.make (#2815) 2022-05-23 08:53:59 -04:00
Mark Towers
e2266025e6 Pydocstyle utils vector docstring (#2788)
* Added pydocstyle to pre-commit

* Added docstrings for tests and updated the tests for autoreset

* Add pydocstyle exclude folder to allow slowly adding new docstrings

* Add docstrings for setup.py and gym/__init__.py, core.py, error.py and logger.py

* Check that all unwrapped environment are of a particular wrapper type

* Reverted back to import gym.spaces.Space to gym.spaces

* Fixed the __init__.py docstring

* Fixed autoreset autoreset test

* Updated gym __init__.py top docstring

* Fix examples in docstrings

* Add docstrings and type hints where known to all functions and classes in gym/utils and gym/vector

* Remove unnecessary import

* Removed "unused error" and make APIerror deprecated at gym 1.0

* Add pydocstyle description to CONTRIBUTING.md

* Added docstrings section to CONTRIBUTING.md

* Added :meth: and :attr: keywords to docstrings

* Added :meth: and :attr: keywords to docstrings

* Imported annotations from __future__ to fix python 3.7

* Add __future__ import annotations for python 3.7

* isort

* Remove utils and vectors for this PR and spaces for previous PR

* Update gym/envs/classic_control/acrobot.py

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

* Update gym/envs/classic_control/acrobot.py

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

* Update gym/envs/classic_control/acrobot.py

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

* Update gym/spaces/dict.py

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

* Update gym/utils/env_checker.py

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

* Update gym/utils/env_checker.py

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

* Update gym/utils/env_checker.py

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

* Update gym/utils/env_checker.py

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

* Update gym/utils/env_checker.py

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

* Update gym/utils/ezpickle.py

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

* Update gym/utils/ezpickle.py

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

* Update gym/utils/play.py

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

* Pre-commit

* Updated docstrings with :meth:

* Updated docstrings with :meth:

* Update gym/utils/play.py

* Update gym/utils/play.py

* Update gym/utils/play.py

* Apply suggestions from code review

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

* pre-commit

* Update gym/utils/play.py

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

* Updated fps and zoom parameter docstring

* Update play docstring

* Apply suggestions from code review

Added suggested corrections from @markus28

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

* Pre-commit magic

* Update the `gym.make` docstring with a warning for `env_checker`

* Updated and fixed vector docstrings

* Update test names for reflect the project filename style

Co-authored-by: Markus Krimmel <montcyril@gmail.com>
2022-05-20 09:49:30 -04:00
Ariel Kwiatkowski
1b09191535 Add a compatibility layer for the new registration mechanism (#2818)
* Added some compat methods

* Some missing methods

* Update registration.py

* Style fix
2022-05-20 09:47:43 -04:00
Ariel Kwiatkowski
fd9cffedfb Add a minimal env checker on gym.make (#2807)
* Add a minimal env checker on make

* Unpack the space checker for custom messages

* Update some dummy envs to use the right API

* Try to fix observation space checking

* And again

* Wrong env

* Swap the minimal env checker to the regular env checker.

Change the argument name

* Disable env checker for two test envs

* Conver env checker exception into warnings.

* Reenable env checker for test envs, it should only raise warning, no exceptions
2022-05-18 16:56:10 -04:00
Mark Towers
5f237ac1f8 Render order enforcing (#2805) 2022-05-18 10:07:54 -04:00
Andrew Tan
64b4b31d82 Fix edge case for out of bounds (#2822)
* Fix edge case for out of bounds

This deals with the edge case where an object's corner may not be in the screen, but the object still overlaps and should be drawn.

* Calculate maximum diagonal for out of bounds calculation
2022-05-16 12:37:43 -04:00
Gianluca De Cola
6112b0d9d2 Upgrade test_action_dim. Refer to #2767 (#2802)
* Add action in bound checks.

* add correct dtype to clip_action test.

* ensure correct dtype in tests.

* action check in car_racing no more needed.

* Prune PR. parametrize tests with spec_list.

* revert changes.

* remove file.

* remove magic number.

* test both upper and lower bound for every action.

* assert oob is really out of bound. also bugfix in action performed

* valide car racing discrete action. Add docstrings. Include car racing discrete in tests.

Co-authored-by: Gianluca De Cola <gianluca.decola@ags-it.com>
2022-05-16 11:54:58 -04:00
Travis Virgil
7fc2ebf9b5 [Proposal] Add turbulance disturbance to LunarLander (#2808)
* create torque function

* create comment for torque function

* remove second arg from ApplyTorque

* lower torque mag wind power to 20%

* Add torque_power as kwarg

* Use torque_power in ApplyTorque function

* Set torque_wind kwarg default to 1.5

* Update version history for torque_power

* Updated version 2 history for 0.24

* Updated arguments to include torque_power

* Update assert for wind_power and torque_power can equal 0.0

* Update version history for v2

* Change torque_wind to turbulance_wind

* Remove assert for wind_power, turbulence_power. Add warnings for wind_power, turbulence_power. Add recommendations for wind_power, turbulence_power to docs.

* Update docs definition/recommended values for wind_power, turbulence_power

* Add `v` before `0.24` version description
2022-05-16 11:54:48 -04:00