@@ -34,6 +34,7 @@ def display_image(obs, mode="RGB"):
3434 # to be 3-D.
3535 img1 .show ()
3636
37+
3738def discrete_environment_example ():
3839
3940 config = {}
@@ -245,7 +246,6 @@ def grid_environment_image_representations_example():
245246 display_image (next_obs )
246247
247248
248-
249249def atari_wrapper_example ():
250250
251251 config = {
@@ -304,6 +304,7 @@ def mujoco_wrapper_example():
304304 try :
305305 from mdp_playground .envs import get_mujoco_wrapper
306306 from gym .envs .mujoco .half_cheetah_v3 import HalfCheetahEnv
307+
307308 wrapped_mujoco_env = get_mujoco_wrapper (HalfCheetahEnv )
308309
309310 env = wrapped_mujoco_env (** config )
@@ -319,7 +320,12 @@ def mujoco_wrapper_example():
319320 env .close ()
320321
321322 except ImportError as e :
322- print ("Exception:" , type (e ), e , "caught. You may need to install mujoco-py. NOT running mujoco_wrapper_example." )
323+ print (
324+ "Exception:" ,
325+ type (e ),
326+ e ,
327+ "caught. You may need to install mujoco-py. NOT running mujoco_wrapper_example." ,
328+ )
323329 return
324330
325331
@@ -337,12 +343,13 @@ def minigrid_wrapper_example():
337343 import gym
338344
339345 from gym_minigrid .wrappers import RGBImgPartialObsWrapper , ImgObsWrapper
340- env = gym .make ('MiniGrid-Empty-8x8-v0' )
341- env = RGBImgPartialObsWrapper (env ) # Get pixel observations
342- env = ImgObsWrapper (env ) # Get rid of the 'mission' field
346+
347+ env = gym .make ("MiniGrid-Empty-8x8-v0" )
348+ env = RGBImgPartialObsWrapper (env ) # Get pixel observations
349+ env = ImgObsWrapper (env ) # Get rid of the 'mission' field
343350
344351 env = GymEnvWrapper (env , ** config )
345- obs = env .reset () # This now produces an RGB tensor only
352+ obs = env .reset () # This now produces an RGB tensor only
346353
347354 print (
348355 "Taking a step in the environment with a random action and printing the transition:"
0 commit comments