@@ -58,7 +58,7 @@ def _aux_change_bus_or_disconnect(self, new_bus, dt, key, el_id):
5858 # are either 1 or 2)
5959 def apply_action (self , backendAction : Union ["grid2op.Action._backendAction._BackendAction" , None ]) -> None :
6060 # the following few lines are highly recommended
61- if action is None :
61+ if backendAction is None :
6262 return
6363
6464 # loads and generators are modified in the previous script
@@ -173,12 +173,12 @@ def get_topo_vect(self) -> np.ndarray:
173173if __name__ == "__main__" :
174174 import grid2op
175175 import os
176- from Step0_make_env import make_env_for_backend
176+ from Step0_make_env import make_env_for_backend , create_action
177177
178178 path_grid2op = grid2op .__file__
179179 path_data_test = os .path .join (os .path .split (path_grid2op )[0 ], "data" )
180180
181- env_name = "l2rpn_wcci_2022_dev "
181+ env_name = "rte_case5_example "
182182 # one of:
183183 # - rte_case5_example: the grid in the documentation (completely fake grid)
184184 # - l2rpn_case14_sandbox: inspired from IEEE 14
@@ -206,6 +206,7 @@ def get_topo_vect(self) -> np.ndarray:
206206 sub_id = 1
207207 local_topo = (1 , 2 , 1 , 2 , 1 , 2 )
208208 elif env_name == "l2rpn_wcci_2022_dev" :
209+ raise RuntimeError ("Storage units are not handled by the example backend, and there are some on the grid." )
209210 sub_id = 3
210211 local_topo = (1 , 2 , 1 , 2 , 1 )
211212 else :
@@ -214,8 +215,7 @@ def get_topo_vect(self) -> np.ndarray:
214215 #############################
215216
216217 # this is technical to grid2op
217- bk_act = env ._backend_action_class ()
218- bk_act += action
218+ bk_act = create_action (env , backend , action )
219219 ####################################
220220
221221 # this is what the backend receive:
0 commit comments