@@ -326,8 +326,8 @@ def behavior_specs(self) -> MappingType[str, BehaviorSpec]:
326326 def _assert_behavior_exists (self , behavior_name : str ) -> None :
327327 if behavior_name not in self ._env_specs :
328328 raise UnityActionException (
329- "The group {0 } does not correspond to an existing agent group "
330- " in the environment". format ( behavior_name )
329+ f "The group { behavior_name } does not correspond to an existing "
330+ f"agent group in the environment"
331331 )
332332
333333 def set_actions (self , behavior_name : BehaviorName , action : np .ndarray ) -> None :
@@ -339,9 +339,9 @@ def set_actions(self, behavior_name: BehaviorName, action: np.ndarray) -> None:
339339 expected_shape = (len (self ._env_state [behavior_name ][0 ]), spec .action_size )
340340 if action .shape != expected_shape :
341341 raise UnityActionException (
342- "The behavior {0 } needs an input of dimension {1} for "
343- " (<number of agents>, <action size>) but received input of "
344- "dimension {2}" . format ( behavior_name , expected_shape , action .shape )
342+ f "The behavior { behavior_name } needs an input of dimension "
343+ f" { expected_shape } for (<number of agents>, <action size>) but "
344+ f"received input of dimension { action .shape } "
345345 )
346346 if action .dtype != expected_type :
347347 action = action .astype (expected_type )
@@ -357,10 +357,9 @@ def set_action_for_agent(
357357 expected_shape = (spec .action_size ,)
358358 if action .shape != expected_shape :
359359 raise UnityActionException (
360- f"The Agent { 0 } with BehaviorName { 1 } needs an input of dimension "
361- f"{ 2 } but received input of dimension { 3 } " .format (
362- agent_id , behavior_name , expected_shape , action .shape
363- )
360+ f"The Agent { agent_id } with BehaviorName { behavior_name } needs "
361+ f"an input of dimension { expected_shape } but received input of "
362+ f"dimension { action .shape } "
364363 )
365364 expected_type = np .float32 if spec .is_action_continuous () else np .int32
366365 if action .dtype != expected_type :
0 commit comments