unixpickle remove double-wrap warning (#1061)
* remove double-wrap warning

* remove double-wrap tests
Latest commit 5404b39 Jun 5, 2018

README.md

Wrappers

Wrappers are used to transform an environment in a modular way:

env = gym.make('Pong-v0')
env = MyWrapper(env)

Note that we may later restructure any of the files in this directory, but will keep the wrappers available at the wrappers' top-level folder. So for example, you should access MyWrapper as follows:

# Will be supported in future releases
from gym.wrappers import MyWrapper

Quick tips for writing your own wrapper

  • Don't forget to call super(class_name, self).init(env) if you override the wrapper's init function
  • You can access the inner environment with self.unwrapped
  • You can access the previous layer using self.env
  • The variables metadata, action_space, observation_space, reward_range, and spec are copied to self from the previous layer
  • Create a wrapped function for at least one of the following: __init__(self, env), _step, _reset, _render, _close, or _seed
  • Your layered function should take its input from the previous layer (self.env) and/or the inner layer (self.unwrapped)