Commit Graph

20 Commits

Author SHA1 Message Date
Andrea PIERRÉ
e913bc81b8 Improve pre-commit workflow (#2602)
* feat: add `isort` to `pre-commit`

* ci: skip `__init__.py` file for `isort`

* ci: make `isort` mandatory in lint pipeline

* docs: add a section on Git hooks

* ci: check isort diff

* fix: isort from master branch

* docs: add pre-commit badge

* ci: update black + bandit versions

* feat: add PR template

* refactor: PR template

* ci: remove bandit

* docs: add Black badge

* ci: try to remove all `|| true` statements

* ci: remove lint_python job

- Remove `lint_python` CI job
- Move `pyupgrade` job to `pre-commit` workflow

* fix: avoid messing with typing

* docs: add a note on running `pre-cpmmit` manually

* ci: apply `pre-commit` to the whole codebase
2022-03-31 15:50:38 -04:00
Zhiqing Xiao
57b157b80b Fix misleading warning message. (#2690)
`pip install gym[atari]` will not install opencv. Correct way to install opencv is `pip install gym[other]` .
2022-03-13 11:58:11 -04: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
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
Jesse Farebrother
f6742ea808 Remove AtariEnv in favour of official ALE Python package (#2348)
* Remove AtariEnv in favour of official ALE Python

* More robust frame stacking test case

* Atari documentation update
2021-09-11 13:04:41 -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
Brett Daley
b2cefc6459 AtariPreprocessing: return 3-D array when grayscale_obs=True (#1796)
* AtariPreprocessing: return 3-D array when grayscale_obs=True

* Update test_atari_preprocessing.py

* AtariPreprocessing: add option for 3-D grayscale, leave 2-D by default

* AtariPreprocessing: add tests for observation_space.shape
2020-08-14 14:18:42 -07:00
Colin Vandenhof
f2c9793eb7 Update atari_preprocessing.py (#1790)
Correct bug that prevents AtariPreprocessing from working with frame_skip = 1.
2020-04-17 17:13:06 -05:00
pzhokhov
7854e2d020 remove opencv-python from core requirements (#1764)
* remove opencv-python from core requirements

* fail on AtariWrapper construction if opencv-python is not installed
2020-01-24 14:05:12 -08:00
Anurag Koul
21bd4f304b added assertion of 'NoFrameskip' in AtariPreprocessing (#1725)
* added assertion of noframeskip in atari pre-proecessing

* - corrected frameskipping assertion
- added non-op assertion as well
2019-11-04 09:48:21 -08:00
Xingdong Zuo
8962984eed [Update atari_preprocessing.py]: Remove FireReset (#1661)
* Update atari_preprocessing.py

* Update test_atari_preprocessing.py

* Update test_atari_preprocessing.py
2019-10-18 15:59:43 -07:00
Anurag Koul
1b5671e36c Adding Frame Normalization in Atari Pre-Processing (#1680)
* added frame scaling in atari preprocessing
- default value is False

* added frame scaling in atari preprocessing
- default value is False

* corrected logic for selection of observation_space params

* initial commit for scale test

* added test-case for observation scaling in atari

* added message related to framestack in docstring.

* refactored scaled obs test for atari preprocessing
2019-10-04 14:19:00 -07:00
pzhokhov
fd5314780d re-enable and fix atari preprocessing wrappers pixel test (#1652) 2019-08-23 15:45:55 -07:00
Peter Zhokhov
98917cf5d3 move imports some more 2019-05-10 17:53:05 -07:00
Xingdong Zuo
5525e30c48 Create atari_preprocessing.py (#1455)
* Create atari_preprocessing.py

* Update atari_preprocessing.py

* Update atari_preprocessing.py

* Create test_atari_preprocessing.py

* Update __init__.py

* Update test_atari_preprocessing.py
2019-05-10 14:59:32 -07:00