Full type hinting (#2942)

* 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

* Allow Box automatic scalar shape

* Add test box and change default from () to (1,)

* 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

* Remove all folders and files from pyright exclude

* Revert issues

* Push RedTachyon code review

* Add Python Platform

* Remove play from pyright check

* Fixed CI issues

* remove mujoco env type hinting

* Fixed pixel observation test

* Added some new type hints

* Fixed CI errors

* Fixed CI errors

* Remove play.py from exlucde pyright

* Fixed pyright issues
This commit is contained in:
Mark Towers
2022-07-04 18:19:25 +01:00
committed by GitHub
parent 9e66399b4e
commit 2ede09074f
61 changed files with 352 additions and 286 deletions

View File

@@ -569,7 +569,7 @@ class AsyncVectorEnv(VectorEnv):
num_errors = self.num_envs - sum(successes)
assert num_errors > 0
for _ in range(num_errors):
for i in range(num_errors):
index, exctype, value = self.error_queue.get()
logger.error(
f"Received the following error from Worker-{index}: {exctype.__name__}: {value}"
@@ -578,8 +578,9 @@ class AsyncVectorEnv(VectorEnv):
self.parent_pipes[index].close()
self.parent_pipes[index] = None
logger.error("Raising the last exception back to the main process.")
raise exctype(value)
if i == num_errors - 1:
logger.error("Raising the last exception back to the main process.")
raise exctype(value)
def __del__(self):
"""On deleting the object, checks that the vector environment is closed."""