Commit Graph

12 Commits

Author SHA1 Message Date
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
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
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
Xingdong Zuo
263a3419ef [Python 3]: replace time() with perf_counter() for better measurements of short duration. (#2385)
* Update record_episode_statistics.py

* Update stats_recorder.py

* Update async_vector_env.py
2021-09-11 13:03:54 -04:00
Costa Huang
2853ce4797 Add RecordVideo wrapper (#2300)
* Add RecordVideo wrapper

* bug fix

* don't change gym's core API

* add test cases

* reformat
2021-08-18 16:36:40 -04:00
Costa Huang
1397e705ea Make RecordEpisodeStatistics work with VectorEnv (#2296)
* Make RecordEpisodeStatistics work with VectorEnv

* fix test cases

* fix lint

* add test cases

* fix linting

* fix tests

* fix test cases...

* Update gym/wrappers/record_episode_statistics.py

Co-authored-by: Tristan Deleu <tristandeleu@users.noreply.github.com>

* fix test cases

* fix test cases again

Co-authored-by: Tristan Deleu <tristandeleu@users.noreply.github.com>
2021-08-05 17:06:49 -04:00
J K Terry
3abd5d55af remove wrapper deprication (#2273) 2021-07-29 17:51:02 -04:00
J K Terry
78d2b512d8 redo black (#2272) 2021-07-29 15:39:42 -04:00
Justin Terry
e9d2c41f2b redo black 2021-07-29 12:42:48 -04:00
Justin Terry
3133e99a64 deprecate built in wrappers for supersuit 2021-07-28 22:21:47 -04:00
Christian Clauss
bb81e141ea Blacken the codebase (#2265) 2021-07-28 20:26:34 -04:00
Xingdong Zuo
97ac555c03 [Wrapper]: RecordEpisodeStatistics (#1628)
* Create record_episode_statistics.py

* Create test_record_episode_statistics.py

* Update __init__.py

* Update record_episode_statistics.py

* Update record_episode_statistics.py

* Update test_record_episode_statistics.py

* Update record_episode_statistics.py

* Update test_record_episode_statistics.py
2019-11-01 14:27:39 -07:00