* First version of the new registration
* Almost done
* Hopefully final commit
* Minor fixes
* Missing error
* Type fixes
* Type fixes
* Add some type hinting stuff
* Fix an error?
* Fix literal import
* Add a comment
* Add some docstrings
Remove old tests
* Add some docstrings, rename helper functions
* Rename a function
* Registration check fix
* Consistently use `register` instead of `envs.register` in tests
* Fix the malformed registration error message to not use a write-only format
* Change an error back to a warning when double-registering an environment
* Updated cartpole-v0 to v1 to prevent warning and added pytest.mark.filterwarnings for tests where warnings are unavoidable
* Change np.bool to bool as numpy raises a warning and bool is the suggested solution
* Seeding randint is deprecated in the future, integers is new solution
* Fixed errors thrown when the video recorder is deleted but not closed
* spaces.Box expects a floating array, updated all cases where this was not true and modified float32 to float64 as float array default to float64. Otherwise space.Box raises warning that dtype precision (float32) is lower than array precision (float64).
* Added pytest.mark.filterwarnings to preventing the raising of an intended warning
* Added comment to explain why a warning is raised that can't be prevented without version update to the environment
* Added comment to explain why warning is raised
* Changed values to float as expected by the box which default to float64
* Removed --forked from pytest as the pytest-forked project is no being maintained and was not raising warnings as expected
* When AsyncVectorEnv has shared_memory=True then a ValueError is raised before _state is initialised. Therefore, on the destruction on the env an error is thrown in .close_extra as _state does not exist
* Possible fix that was causing an error in test_call_async_vector_env by ensuring that pygame resources are released
* Pygame throws an error with ALSA when closed, using a fix from PettingZoo (https://github.com/Farama-Foundation/PettingZoo/blob/master/pettingzoo/__init__.py). We use the dsp audiodriver to prevent this issue
* Modification due to running pre-commit locally
* Updated cartpole-v0 to v1 to prevent warning and added pytest.mark.filterwarnings for tests where warnings are unavoidable
* Change np.bool to bool as numpy raises a warning and bool is the suggested solution
* Seeding randint is deprecated in the future, integers is new solution
* Fixed errors thrown when the video recorder is deleted but not closed
* spaces.Box expects a floating array, updated all cases where this was not true and modified float32 to float64 as float array default to float64. Otherwise space.Box raises warning that dtype precision (float32) is lower than array precision (float64).
* Added pytest.mark.filterwarnings to preventing the raising of an intended warning
* Added comment to explain why a warning is raised that can't be prevented without version update to the environment
* Added comment to explain why warning is raised
* Changed values to float as expected by the box which default to float64
* Removed --forked from pytest as the pytest-forked project is no being maintained and was not raising warnings as expected
* When AsyncVectorEnv has shared_memory=True then a ValueError is raised before _state is initialised. Therefore, on the destruction on the env an error is thrown in .close_extra as _state does not exist
* Possible fix that was causing an error in test_call_async_vector_env by ensuring that pygame resources are released
* Pygame throws an error with ALSA when closed, using a fix from PettingZoo (https://github.com/Farama-Foundation/PettingZoo/blob/master/pettingzoo/__init__.py). We use the dsp audiodriver to prevent this issue
* Modification due to running pre-commit locally
* 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>
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.
* 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