* initial commit
* Fix the multi-binary sample and upgrade multi-discrete sample
* Fix MultiBinary sample tests and pre-commit
* Adds coverage tests and updates test_utils.py to use the utils.py spaces. Fix bug in text.py
* pre-commit
* Added Sequence space, updated flatten functions to work with Sequence, Graph. WIP.
* Small fixes, added Sequence space to tests
* Replace Optional[Any] by Any
* Added tests for flattening of non-numpy-flattenable spaces
* Return all seeds
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset
* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"
This reverts commit 519dfd9117.
* Remove bad pushed commits
* Fixed spelling in core.py
* Pins pytest to the last py 3.6 version
* Add Text space
* Add Text space
* Added Text space
* Updated comment
* Allow Box automatic scalar shape
* Add test box and change default from () to (1,)
* Refactored conditional
* Refactored contains()
* update Box shape inference with more strict checking
* Update the box shape and add check on the custom Box shape
* Removed incorrect shape type and assert shape code
* Update the Box and associated tests
* Move dependency error to inside the atari environment
* Update the gym version to v0.25.0
* Fixed bugs in Text space and tests
* Code review by Drew
Co-authored-by: Ryan Rudes <ryanrudes@gmail.com>
* Update pyproject.toml
* Maybe fix typing for frozen lake and taxi
* Clean up pyproject a bit
* Reenable box2d pyright
* Disable box2d pyright
* Fix typing for toy text envs
* Narrow down pyright excludes for almost everything except mujoco
* Fix a wrapper test typing
* Remove env checker from excludes
* Remove redundant type hints which mess up pyright. And a typo fix.
* Remove test_spaces exclude
* Remove some redundant warnings
* Change pyright ignore to more specific
* Fix a weird private variable which gets explicitly exported for whatever reason. It's still exported for backwards compatibility, but internal code now uses a public variable.
* re-export the private variable
* Fix lunar_lander typing
* Remove lunar lander from excludes
* Small fix
* Allows a new RNG to be generated with seed=-1 and updated env_checker to fix bug if environment doesn't use np_random in reset
* Revert "fixed `gym.vector.make` where the checker was being applied in the opposite case than was intended to (#2871)"
This reverts commit 519dfd9117.
* Remove bad pushed commits
* Fixed spelling in core.py
* Pins pytest to the last py 3.6 version
* Add support for action masking in Space.sample(mask=...)
* Fix action mask
* Fix action_mask
* Fix action_mask
* Added docstrings, fixed bugs and added taxi examples
* Fixed bugs
* Add tests for sample
* Add docstrings and test space sample mask Discrete and MultiBinary
* Add MultiDiscrete sampling and tests
* Remove sample mask from graph
* Update gym/spaces/multi_discrete.py
Co-authored-by: Markus Krimmel <montcyril@gmail.com>
* Updates based on Marcus28 and jjshoots for Graph.py
* Updates based on Marcus28 and jjshoots for Graph.py
* jjshoot review
* jjshoot review
* Update assert check
* Update type hints
Co-authored-by: Markus Krimmel <montcyril@gmail.com>
* Remove additional ignores from flake8
* Remove all unused imports
* Remove all unused imports
* Update flake8 and pyupgrade
* F841, removed unused variables
* E731, removed lambda assignment to variables
* Remove E731, F403, F405, F524
* Remove E722, bare exceptions
* Remove E712, compare variable == True or == False to is True or is False
* Remove E402, module level import not at top of file
* Added --pre-file-ignores
* Add --per-file-ignores removing E741, E302 and E704
* Add E741, do not use variables named ‘l’, ‘O’, or ‘I’ to ignore issues in classic control
* Fixed issues for pytest==6.2
* Remove unnecessary # noqa
* Edit comment with the removal of E302
* Added warnings and declared module, attr for pyright type hinting
* Remove unused import
* Removed flake8 E302
* Updated flake8 from 3.9.2 to 4.0.1
* Remove unused variable
* 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
* gym.spaces.Tuple inherits from collections.abc.Sequence
Following the PR I did a few months back (https://github.com/openai/gym/pull/2446), the tuple wrapper of gym should inherits from the abstract interface of Python. It is important for type check via `isinstance` and enable using such objects transparently with libraries such as [dmtree](https://github.com/deepmind/tree).
It will bring a way helper methods along the way but it cannot be avoided to interoperability: : `__iter__`, `__reversed__`, `index`, and `count`
Personally I don't think it is an issue since it is new features and it is not conflicting.
As the previous PR, this patch is NOT removing any existing feature and should not break backward compatibility.
* Add unit test
* Fix unit tests
* Final fix.
* Remove irrelevant comment.
* Fix black formatter.
* Box Boundedness determined using get_inf instead of np.inf
* Store original array entries for determining boundedness
* Capture the boundedness before casting away the np.inf
* Removed requirement that integer spaces be bounded above and below
* np full casts away the inf, so using dtype float for boundedness evaluation
* Removed commented code
* But the type ignore hint back in
* Spacing change from black code formatter
* 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
* 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
* 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