44import gymnasium as gym
55import numpy as np
66from gymnasium import spaces
7- from gymnasium .spaces .graph import GraphInstance
7+ from gymnasium .spaces .graph import GraphInstance
88
99from stable_baselines3 .common .preprocessing import check_for_nested_spaces , is_image_space_channels_first
1010from stable_baselines3 .common .vec_env import DummyVecEnv , VecCheckNan
@@ -214,9 +214,7 @@ def _check_obs(obs: Union[tuple, dict, np.ndarray, int], observation_space: spac
214214 else :
215215 assert not (
216216 isinstance (obs , tuple ) and _is_graph_space (observation_space )
217- ), (
218- f"TypeError: `{ method_name } ()` should be a single value of (1, GraphInstance), not of tuple length { len (obs )} "
219- )
217+ ), f"TypeError: `{ method_name } ()` should be a single value of (1, GraphInstance), not of tuple length { len (obs )} "
220218 assert not isinstance (
221219 obs , tuple
222220 ), f"The observation returned by the `{ method_name } ()` method should be a single value, not a tuple"
@@ -232,9 +230,7 @@ def _check_obs(obs: Union[tuple, dict, np.ndarray, int], observation_space: spac
232230 # check fields here (nodes, edges, edge_links)
233231 assert observation_space .contains (
234232 obs
235- ), (
236- f"The observation returned by the `{ method_name } ()` method is incompatible w/ graph-obs: { observation_space } "
237- )
233+ ), f"The observation returned by the `{ method_name } ()` method is incompatible w/ graph-obs: { observation_space } "
238234 return
239235
240236 elif _is_numpy_array_space (observation_space ):
0 commit comments