Commit Graph

7 Commits

Author SHA1 Message Date
Rushiv Arora
fcbff7de12 Added singledispatch utility to vector.utils & changed order of space argument. (#2536)
* 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 _
2022-01-21 11:28:34 -05:00
Elijah K
cb79c763bb Py36+ syntax in gym/vector: derived by running pyupgrade --py36-plus gym/vector/**.py and flynt gym --ll 120 (#2474)
Co-authored-by: Ilya Kamen <ilya.kamenshchikov@bosch.com>
2021-11-14 08:51:32 -05: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
Christian Clauss
bb81e141ea Blacken the codebase (#2265) 2021-07-28 20:26:34 -04:00
Tristan Deleu
58401db97e Allow custom spaces in VectorEnv (#2038)
* Allow custom observation spaces in VectorEnv

* Replace np.copy by deepcopy in reset of SyncVectorEnv

* Add tests for VectorEnv with custom spaces

* Add tests for shared memory and batches of custom spaces

* Remove unused import in VectorEnv test

* Add warning note in the Space class for custom spaces
2020-09-21 13:38:51 -07:00
Tristan Deleu
c6a97e17ee Vectorized environments (#1513)
* Initial version of vectorized environments

* Raise an exception in the main process if child process raises an exception

* Add list of exposed functions in vector module

* Use deepcopy instead of np.copy

* Add documentation for vector utils

* Add tests for copy in AsyncVectorEnv

* Add example in documentation for batch_space

* Add cloudpickle dependency in setup.py

* Fix __del__ in VectorEnv

* Check if all observation spaces are equal in AsyncVectorEnv

* Check if all observation spaces are equal in SyncVectorEnv

* Fix spaces non equality in SyncVectorEnv for Python 2

* Handle None parameter in create_empty_array

* Fix check_observation_space with spaces equality

* Raise an exception when operations are out of order in AsyncVectorEnv

* Add version requirement for cloudpickle

* Use a state instead of binary flags in AsyncVectorEnv

* Use numpy.zeros when initializing observations in vectorized environments

* Remove poll from public API in AsyncVectorEnv

* Remove close_extras from VectorEnv

* Add test between AsyncVectorEnv and SyncVectorEnv

* Remove close in check_observation_space

* Add documentation for seed and close

* Refactor exceptions for AsyncVectorEnv

* Close pipes if the environment raises an error

* Add tests for out of order operations

* Change default argument in create_empty_array to np.zeros

* Add get_attr and set_attr methods to VectorEnv

* Improve consistency in SyncVectorEnv
2019-06-21 14:29:44 -07:00