Removing return_info argument to env.reset() and deprecated env.seed() function (reset now always returns info) (#2962)

* removed return_info, made info dict mandatory in reset

* tenatively removed deprecated seed api for environments

* added more info type checks to wrapper tests

* formatting/style compliance

* addressed some comments

* polish to address review

* fixed tests after merge, and added a test of the return_info deprecation assertion if found in reset signature

* some organization of env_checker tests, reverted a probably merge error

* added deprecation check for seed function in env

* updated docstring

* removed debug prints, tweaked test_check_seed_deprecation

* changed return_info deprecation check from assertion to warning

* fixes to vector envs, now  should be correctly structured

* added some explanation and typehints for mockup depcreated return info reset function

* re-removed seed function from vector envs

* added explanation to _reset_return_info_type and changed the return statement
This commit is contained in:
John Balis
2022-08-23 11:09:54 -04:00
committed by GitHub
parent 1f864789fd
commit 3a8daafce1
56 changed files with 327 additions and 639 deletions

View File

@@ -63,7 +63,7 @@ class UnittestSlowEnv(gym.Env):
super().reset(seed=seed)
if self.slow_reset > 0:
time.sleep(self.slow_reset)
return self.observation_space.sample()
return self.observation_space.sample(), {}
def step(self, action):
time.sleep(action)
@@ -99,7 +99,7 @@ class CustomSpaceEnv(gym.Env):
def reset(self, *, seed: Optional[int] = None, options: Optional[dict] = None):
super().reset(seed=seed)
return "reset"
return "reset", {}
def step(self, action):
observation = f"step({action:s})"