Commit Graph

1491 Commits

Author SHA1 Message Date
J K Terry
e5d1ba9a4c Update README.md 2021-12-09 00:40:07 -05:00
Tristan Deleu
fbe3631aa9 Batch action_space in VectorEnv (#2280)
* Batch the action space in VectorEnv and add iterate utility function

* Add tests for iterate

* Add tests for action spaces in SyncVectorEnv and AsyncVectorEnv

* Black formatting

* Use singledispatch for iterate utility function

* Update the ordering of the arguments in the docstring

* Fix ordering in docstring example of iterate

* Check for same action spaces in vectorized environments

* Separate Discrete from other space types in iterate singledispatch
2021-12-08 21:31:41 -05:00
Tristan Deleu
cdb72ea552 Fix close_extras not implemented by default in VectorEnv (#2507) 2021-12-08 19:55:09 -05:00
Ariel Kwiatkowski
c364506710 Seeding update (#2422)
* Ditch most of the seeding.py and replace np_random with the numpy default_rng. Let's see if tests pass

* Updated a bunch of RNG calls from the RandomState API to Generator API

* black; didn't expect that, did ya?

* Undo a typo

* blaaack

* More typo fixes

* Fixed setting/getting state in multidiscrete spaces

* Fix typo, fix a test to work with the new sampling

* Correctly (?) pass the randomly generated seed if np_random is called with None as seed

* Convert the Discrete sample to a python int (as opposed to np.int64)

* Remove some redundant imports

* First version of the compatibility layer for old-style RNG. Mainly to trigger tests.

* Removed redundant f-strings

* Style fixes, removing unused imports

* Try to make tests pass by removing atari from the dockerfile

* Try to make tests pass by removing atari from the setup

* Try to make tests pass by removing atari from the setup

* Try to make tests pass by removing atari from the setup

* First attempt at deprecating `env.seed` and supporting `env.reset(seed=seed)` instead. Tests should hopefully pass but throw up a million warnings.

* black; didn't expect that, didya?

* Rename the reset parameter in VecEnvs back to `seed`

* Updated tests to use the new seeding method

* Removed a bunch of old `seed` calls.

Fixed a bug in AsyncVectorEnv

* Stop Discrete envs from doing part of the setup (and using the randomness) in init (as opposed to reset)

* Add explicit seed to wrappers reset

* Remove an accidental return

* Re-add some legacy functions with a warning.

* Use deprecation instead of regular warnings for the newly deprecated methods/functions
2021-12-08 16:14:15 -05:00
J K Terry
b84b69c872 Update lint_python.yml 2021-11-22 16:39:00 -05:00
Yodogawa Mikio
08c73e0485 Update lint_python.yml (#2495)
Hello, I have implemented this per my understanding of issue #2494 .
2021-11-22 16:38:33 -05:00
J K Terry
42a4a09f5b 3.10 support (#2493)
* test again

* typo
2021-11-20 11:41:27 -05:00
Jesse Farebrother
3f5b46dfc1 Add warnings when using outdated versions of environments (#2481)
This introduces a new tree-like storage structures for environments
which allows for efficient lookups of what versions of an environment
are registered. Using this new data-structure we can give warnings
to users about outdated environments when `make` is called.
2021-11-20 10:43:36 -05:00
Elijah K
590f2504a7 Adds type checks via pyright to CI (#2477)
* Adds type checks via `pyright` to CI

* Move developer instructions into CONTRIBUTING.md

* black formatting

* Explicit list of strictly checked files

Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-17 18:16:57 -05:00
Minghuan Liu
01b4519d9d Fix action dimension check bugs (#2469)
* fix action dimension check bugs

* black codes, add test function

* clear codes for simplicity

* update check mujoco install
2021-11-17 18:11:40 -05:00
Tristan Deleu
01cc8a3a16 Add documentation for Vectorized environments (#2327) 2021-11-14 08:59:04 -05:00
Costa Huang
778d3c2473 [gym.vector]: add terminal_observation to info (#2484)
* [gym.vector]: add `terminal_observation` to `info`

* add test cases

* quick format fix
2021-11-14 08:57:44 -05:00
Elijah K
cb79c763bb Py36+ syntax in gym/vector: derived by running pyupgrade --py36-plus gym/vector/**.py and flynt gym --ll 120 (#2474)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-14 08:51:32 -05:00
Elijah K
61d9f266bc Py36+ syntax in gym/utils: derived by running pyupgrade --py36-plus gym/utils/**.py and flynt gym --ll 120 (#2472)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-14 08:50:53 -05:00
Elijah K
a4da53c210 Py36+ syntax in gym/*.py: derived by running pyupgrade --py36-plus gym/*.py and flynt gym --ll 120 (#2473)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-14 08:50:40 -05:00
Elijah K
8e5ae02ab1 Py36+ syntax in gym/spaces: derived by running pyupgrade --py36-plus gym/spaces/**.py and flynt gym --ll 120 (#2466)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-14 08:50:23 -05:00
Elijah K
eec6167440 Py36+ syntax in gym/envs: derived by running pyupgrade --py36-plus gym/envs/**.py and flynt gym --ll 120 (#2465)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-13 19:53:32 -05:00
Elijah K
9ae4331dfd Py36+ syntax in gym/wrappers: derived by running pyupgrade --py36-plus gym/wrappers/**.py and flynt gym --ll 120 (#2464)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-13 19:53:06 -05:00
Joji
598813e824 Fix the broken link to Creating Environments (#2482)
* Fix the broken link to Creating Environments

Changed *Creating Environments* link from https://github.com/openai/gym/blob/master/docs/creating-environments.md to https://github.com/openai/gym/blob/master/docs/creating_environments.md, as the change in file name isn't reflected in CONTRIBUTING.md.

* Fix broken link to *List of Environments*
2021-11-13 19:44:54 -05:00
Ishan Manchanda
103b7633f5 Readded overwritten changes for offset functionality for Discrete spaces (#2470)
Co-authored-by: J K Terry <justinkterry@gmail.com>
2021-10-30 12:12:01 -04:00
J K Terry
531d4d02db Revert "Update pendulum.py (#2444)" (#2475)
This reverts commit 7869eca817.
2021-10-30 11:52:01 -04:00
Zeeshan Ali
7869eca817 Update pendulum.py (#2444)
* Update pendulum.py

I have added the description of the class as much as I could, it needs to be completed.

* Update pendulum.py

* Update pendulum.py

* Update pendulum.py

* Update pendulum.py

* Update pendulum.py

I think the observation space is Box(1) as per the __init__ func.
2021-10-29 16:45:54 -04:00
J K Terry
a5c0608efb Update setup.py 2021-10-25 16:13:38 -04:00
Gaétan Lepage
a9a175312a Removed useless call to inexisting gym.Env.__init__() in gym.vector.VectorEnv.__init__(). (#2461) 2021-10-25 14:42:52 -04:00
J K Terry
8ad5b016e9 docs typo 2021-10-23 05:58:33 -04:00
ksdata
bf30bf4937 Typo in comment at Line #41 (#2457) 2021-10-21 20:03:18 -04:00
Ariel Kwiatkowski
3eb6992280 Test refactoring (#2436)
* Remove a redundant (?) helpers file, moved the video wrapper test to other wrapper tests

* Deleted an ancient hash-random-rollout feature that hasn't been maintained in years and (hopefully) hasn't been used in years. Also deleted a test that was disabled anyways.
2021-10-16 21:37:34 -04:00
Alexis DUBURCQ
3fedd514b8 gym.spaces.Dict inherits from collections.abc.Mapping (#2446)
* gym.spaces.Dict inherits from collections.abc.Mapping

It would be very convenient to have `gym.spaces.Dict` inheriting from `collections.abc.Mapping` so that it can be used in conjunction with [dmtree](https://github.com/deepmind/tree) to perform operations on complex spaces conveniently. It also simplifies the implementation which is good.

I just don't like the fact that the `contains` method behavior is not consistent with what it should be doing if it was a proper mapping...

* Update dict.py

* Update dict.py
2021-10-16 21:22:29 -04:00
J K Terry
bfe4273c58 remove python 3.6 support (#2448) 2021-10-16 11:33:49 -04:00
J K Terry
b6b4fc3838 typo 2021-10-13 23:12:46 -04:00
J K Terry
77a037d747 updated pettingzoo link 2021-10-13 20:23:28 -04:00
Gabriel Nogueira
ff33188e53 Add flappy-bird-gym to third party environments (#2439)
This commit adds the [flappy-bird-gym](https://github.com/Talendar/flappy-bird-gym) package to `third_party_environments.md`. It's the first result on Google when searching for "flappy bird gym environment".
2021-10-06 21:53:52 -04:00
zlig
45902be4d0 Fixes video recording formatting issues (#2435)
* Reverts some changes from #1893, and propose to install imageio-ffmpeg instead

* Reformat file as required by the Python Black linter
2021-10-04 00:10:58 -04:00
Emanuel Becerra Soto
596d2d452e gym-cellular-automata third party envs (#2437)
Addition of gym-cellular-automata
on the third party environments docs.

https://github.com/elbecerrasoto/gym-cellular-automata
2021-10-04 00:09:26 -04:00
Xuehai Pan
58ed658d9b Better warning control (#2434)
* Better warning control

* Replace `warnings.warn` with `gym.logger.warn`

* Send logs to stderr
2021-10-01 20:36:02 -04:00
Jesse Farebrother
c755d5c35a Tests: don't use editable mode, use import-mode=append (#2429) 2021-09-28 20:26:54 -04:00
Ariel Kwiatkowski
947b857bd4 Test refactoring (#2427)
* Move tests to root with automatic PyCharm import refactoring. This will likely fail some tests

* Changed entry point for a registration test env.

* Move a stray lunar_lander test to tests/envs/...

* black

* Change the version from which importlib_metadata is replaced with importlib.metadata. Also requiring installing importlib_metadata for python 3.8 now.

???????????

* Undo last commit
2021-09-28 19:53:30 -04:00
Jesse Farebrother
ca42b05243 Fix importlib-metadata on Python 3.8 + bump ale-py (#2428)
* Bump ale-py -> 0.7.1

* env-plugins: parse module,attr for Python 3.8
2021-09-28 19:45:01 -04:00
J K Terry
8cc7f975dd version 0.21 2021-09-28 13:53:36 -04:00
Ariel Kwiatkowski
3331efe03c Move all tests to gym/tests/... (#2425)
* Moved all (?) tests to gym/tests

* flake8

* Move all the tests into gym/gym/tests, this might fix all the import errors... hopefully

* Move unittests back to envs

* Fix unittest again

* black

* Fix to one test due to new paths
2021-09-28 13:45:52 -04:00
Jesse Farebrother
52b7e5e325 Add extra [accept-rom-license] for AutoROM (#2420) 2021-09-28 13:42:26 -04:00
Xuehai Pan
000a2a0d51 Update test case for VideoRecorder (#2404)
* Update test case for VideoRecorder

* Remove closer for VideoRecorder
2021-09-26 17:53:36 -04:00
Ariel Kwiatkowski
d199778b9e Pendulum updates (#2423)
* Pendulum env updates

Simplify the math a bit (no difference in behavior)

* Reorder the clipping of angular velocity

* Bump version of Pendulum

* black

* Update mentions of Pendulum-v0 to Pendulum-v1.
2021-09-25 14:00:28 -04:00
J K Terry
65eebce904 even more fixes 2021-09-23 22:08:07 -04:00
J K Terry
7be352b46b typo and test 2021-09-23 22:00:49 -04:00
J K Terry
dc751add6a Update README.md 2021-09-23 19:09:51 -04:00
J K Terry
b283b2011d alphabetization and more fixes 2021-09-23 17:25:57 -04:00
J K Terry
1a1c7d115f underscore 2021-09-23 17:07:10 -04:00
J K Terry
67f69f5f6f fix up third party environment list 2021-09-23 17:03:46 -04:00
J K Terry
a3425de56a new environments 2021-09-23 17:02:09 -04:00