1111import unittest
1212import os
1313import tempfile
14- from grid2op .tests .helper_path_test import *
14+ from grid2op .tests .helper_path_test import PATH_DATA_TEST
1515
16+ import grid2op
1617from grid2op .operator_attention import LinearAttentionBudget
17- from grid2op import make
1818from grid2op .Reward import RedispReward , _AlarmScore
1919from grid2op .Exceptions import Grid2OpException
2020from grid2op .Runner import Runner
@@ -31,7 +31,9 @@ def setUp(self) -> None:
3131 )
3232 with warnings .catch_warnings ():
3333 warnings .filterwarnings ("ignore" )
34- self .env = make (self .env_nm , test = True )
34+ self .env = grid2op .make (self .env_nm ,
35+ test = True ,
36+ _add_to_name = f"{ type (self ).__name__ } " )
3537 self .env .seed (0 )
3638 self .env .reset ()
3739 self .env .reset ()
@@ -59,20 +61,24 @@ def test_create_ok(self):
5961 with self .assertRaises (Grid2OpException ):
6062 # it raises because the default reward: AlarmReward can only be used
6163 # if there is an alarm budget
62- with make (self .env_nm , has_attention_budget = False , test = True ) as env :
64+ with grid2op .make (self .env_nm ,
65+ has_attention_budget = False ,
66+ test = True ,
67+ _add_to_name = f"{ type (self ).__name__ } " ) as env :
6368 assert env ._has_attention_budget is False
6469 assert env ._attention_budget is None
6570
66- with make (
71+ with grid2op . make (
6772 self .env_nm ,
6873 has_attention_budget = False ,
6974 reward_class = RedispReward ,
7075 test = True ,
76+ _add_to_name = f"{ type (self ).__name__ } _1"
7177 ) as env :
7278 assert env ._has_attention_budget is False
7379 assert env ._attention_budget is None
7480
75- with make (
81+ with grid2op . make (
7682 self .env_nm ,
7783 test = True ,
7884 kwargs_attention_budget = {
@@ -81,6 +87,7 @@ def test_create_ok(self):
8187 "init_budget" : 0 ,
8288 "alarm_cost" : 12 ,
8389 },
90+ _add_to_name = f"{ type (self ).__name__ } " ,
8491 ) as env :
8592 assert env ._has_attention_budget
8693 assert env ._attention_budget is not None
@@ -106,7 +113,7 @@ def test_budget_increases_ok(self):
106113 )
107114
108115 # check that it does not "overflow"
109- with make (
116+ with grid2op . make (
110117 self .env_nm ,
111118 kwargs_attention_budget = {
112119 "max_budget" : 5 ,
@@ -115,6 +122,7 @@ def test_budget_increases_ok(self):
115122 "init_budget" : 0 ,
116123 },
117124 test = True ,
125+ _add_to_name = f"{ type (self ).__name__ } " ,
118126 ) as env :
119127 env .step (self .env .action_space ())
120128 assert abs (env ._attention_budget ._current_budget - 1 ) <= 1e-6
@@ -475,7 +483,10 @@ def test_simulate(self):
475483 """issue reported during icaps 2021"""
476484 with warnings .catch_warnings ():
477485 warnings .filterwarnings ("ignore" )
478- env = make ("l2rpn_icaps_2021" , test = True , reward_class = _AlarmScore )
486+ env = grid2op .make ("l2rpn_icaps_2021" ,
487+ test = True ,
488+ reward_class = _AlarmScore ,
489+ _add_to_name = f"{ type (self ).__name__ } " )
479490 env .set_thermal_limit (
480491 [
481492 20 ,
0 commit comments