* initial draft of optional info dict in reset function, implemented for cartpole, tests seem to be passing
* merged core.py
* updated return type annotation for reset function in core.py
* optional metadata with return_info from reset added for all first party environments, with corresponding tests. Incomplete implementation for wrappers and vector wrappers
* removed Optional type for return_info arguments
* added tests for return_info to normalize wrapper and sync_vector_env
* autoformatted using black
* added optional reset metadata tests to several wrappers
* added return_info capability to async_vector_env.py and test to verify functionality
* added optional return_info test for record_video.py
* removed tests for mujoco environments
* autoformatted
* improved test coverage for optional reset return_info
* re-removed unit test envs accidentally reintroduced in merge
* removed unnecessary import
* changes based on code-review
* small fix to core wrapper typing and autoformatted record_epsisode_stats
* small change to pass flake8 style
* Fix jerky camera angle in car racing env
* Bump the version of CarRacing
* Fix episode termination criterion in car racing env
* Improve lap detection and add argument
* Fix pre-commit
Co-authored-by: J K Terry <justinkterry@gmail.com>
* Refactor lunar lander to use pygame
* Fix minor rendering inconsistency
* Refactor bipedal walker to use pygame
* Reformat with black
* Remove viewer
* Fix color for obstacles
* Update dependencies for box2d
* Optimize screen initialization
* docs+credits
* docs: refactor box2d + comment version history
* fix mujoco line lengths
* fix more env line lengths
* black
* typos
* put docstrings in base environments rather than highest version
* fix richer reacher
* black
* correct black version
* continuous mountain car docstring to markdown
* remove unneeded images
* black
* fix quote
* docs: add version history to Box2D envs
* Update lunar_lander.py
Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
* Add call, get_attr and set_attr methods
* Use f-strings and remove assert
* Allow tuples in set_attr and move docstrings
* Replace CubeCrash by CartPole in tests
* Add call, get_attr and set_attr methods
* Use f-strings and remove assert
* Allow tuples in set_attr and move docstrings
* Replace CubeCrash by CartPole in tests
* docs+credits
* docs: refactor box2d + comment version history
* fix mujoco line lengths
* fix more env line lengths
* black
* typos
* put docstrings in base environments rather than highest version
* fix richer reacher
* black
* correct black version
* continuous mountain car docstring to markdown
* remove unneeded images
* black
Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
* docs+credits
* docs: refactor box2d + comment version history
* fix mujoco line lengths
* fix more env line lengths
* black
* typos
* put docstrings in base environments rather than highest version
* fix richer reacher
* black
* correct black version
Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
* docs+credits
* docs: refactor box2d + comment version history
* fix mujoco line lengths
* fix more env line lengths
* black
* typos
Co-authored-by: Andrea PIERRÉ <andrea_pierre@brown.edu>
* typing in spaces.Box and spaces.Discrete
* adds typing to dict and tuple spaces
* Typecheck all spaces
* Explicit regex to include all files under space folder
* Style: use native types and __future__ annotations
* Allow only specific strings for Box.is_bounded args
* Add typing to changes from #2517
* Remove Literal as it's not supported by py3.7
* Use more recent version of pyright
* Avoid name clash for type checker
* Revert "Avoid name clash for type checker"
This reverts commit 1aaf3e0e0328171623a17a997b65fe734bc0afb1.
* Ignore the error. It's reported as probable bug at https://github.com/microsoft/pyright/issues/2852
* rebase and add typing for `_short_repr`
* Fixed ordering of space. Added singledispatch utility.
* Added singledispatch utility to vector.utils & changed order of space argument
* Fixed Error from _BaseGymSpaces
* Minor adjustment for Discrete Spaces
* Fixed Tests/ to reflect changes
* Fixed precommit error - custom namespaces
* Concrete Implementations start with _
* 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
* refactor: required version in env name
* refactor: rename env_id function
* refactor: regex + function logic
* test: some more edge cases + error
* refactor: version max/comparison
- Move version max/comparison in a method
- Remove type ignore to improve type checking
* fix: failing tests & error introduced in rebasing
* refactor: simplify map and remove type ignore
* refactor: remove _is_lesser_version() method
* refactor: _versions() to return NamedTuples
* chore: remove minor changes
* Refactor registration EnvSpec and EnvSpecTree
* test: move tests from #2513 here
* fix: typing
* test: try to fix unregistered env
* refactor: change InitVar id name for typing
Changed InitVar id name to fix the following typing error:
error: Declaration "id" is obscured by a declaration of the same name
* refactor: return only the first difflib match
* test: improve tear down of added test env
* refactor: dataclass fields
* refactor: compile regex pattern only once
* refactor: `_assert_version_exists()`
`_assert_version_exists()` rewritten from @JesseFarebro:
https://github.com/openai/gym/pull/2535#discussion_r777573839
* refactor: latest_spec -> latest_versioned_spec
* fix: bug + typing + test
* Add default/versioned tests
* Fix Env field defaults
* feat: improve versioned/unversioned env handling
* Disallow versioned/unversioned registration/lookup
* test: remove warning + check default suggestion
Co-authored-by: Jesse Farebrother <jessefarebro@gmail.com>
* fix box infinite bounds
* Revert "fix box infinite bounds"
This reverts commit 8e27a01fda839f522fc5a0855350e5a543359c47.
* fix box space infinite bounds
* experiencing unit test failures with master build on windows, shifting to Linux to test
* box space infinite bounds fixed, all unit test pass, though the solution is still less elegant than I'd like
* bracket fix
* black formatting
* remove redundant casting to np.array for array spaces
* previous changes unintentionally changed the sampling method for float dtype infinite, this commit fixes that. Float infinite bounds are sampled either using shifted exponential or normal depending on circumstance, but int infinite bounds are always sampled uniformly.
* added more tests as per #2517, made some error messages more descriptive, changed logic for calculating inf for ints
* accidentally commented out something I shouldn't have commented out
* moved get_inf and get_precision to non-static functions
* Move get_precision and get_inf outside of class
* Don't edit code within github's editor lol:wq
* black
* Consolidate LunarLander and BipedalWalker envs
* Update LunarLander tests
* Add type hints
* Add detailed error message on instantiating deprecated environments
* Fix formatting with black pre-commit
Co-authored-by: Andrew Tan Jin Shen <andrew.tanjs@shopee.com>
* Typing in gym/envs/registration.py
* Add registration to type checked list
* Adds type hints to space.py
* Typing in gym.core.Env
* Typing in seeding.py
* fixup Typing after rebase
* revert accidental change
* Install dependencies in pyright runner
* fix: can only install dependencies after checkout
* fix: install types in a venv
* fix path
* skip env activation, install directly from venv interpreter
* absolute path to venv
* use central python installation
* skip one more typecheck
* cleanup gh actions .yml
* Add py.typed to signal using sources for typechecking
* black!
Co-authored-by: sj_petterson <sj_petterson@gmail.com>
Co-authored-by: J K Terry <justinkterry@gmail.com>
* Type cast for `spaces.Dict`
* Type cast for `spaces.Tuple`
* Type cast for `spaces.Discrete`
* Type cast for `spaces.MultiDiscrete`
* Type cast for `spaces.MultiBinary`