@@ -1795,7 +1795,7 @@ def test_next_grid_state_multiple_iteration_cooldown(self):
17951795 th_lims [2 ] = 18849.43 / 1.6 # disconnected at second iteration
17961796 self .backend .set_thermal_limit (th_lims )
17971797
1798- env ._timestep_overflow [0 ] = 2 # already 1 step on overflow
1798+ env ._protection_counter [0 ] = 2 # already 1 step on overflow
17991799 disco , infos , conv_ = self .backend .next_grid_state (env , is_dc = False )
18001800 res_a = self .backend .lines_or_info ()[- 1 ]
18011801 assert conv_ is None
@@ -1882,7 +1882,7 @@ def test_nb_timestep_overflow_nodisc(self):
18821882 type (self .backend ).set_no_storage ()
18831883 self .backend .assert_grid_correct ()
18841884
1885- env ._timestep_overflow [self .id_2nd_line_disco ] = 0
1885+ env ._protection_counter [self .id_2nd_line_disco ] = 0
18861886 thermal_limit = 10 * self .lines_flows_init
18871887 thermal_limit [self .id_first_line_disco ] = (
18881888 self .lines_flows_init [self .id_first_line_disco ] / 2
@@ -1924,7 +1924,7 @@ def test_nb_timestep_overflow_nodisc_2(self):
19241924 type (self .backend ).set_no_storage ()
19251925 self .backend .assert_grid_correct ()
19261926
1927- env ._timestep_overflow [self .id_2nd_line_disco ] = 1
1927+ env ._protection_counter [self .id_2nd_line_disco ] = 1
19281928
19291929 thermal_limit = 10 * self .lines_flows_init
19301930 thermal_limit [self .id_first_line_disco ] = (
@@ -1967,8 +1967,7 @@ def test_nb_timestep_overflow_disc2(self):
19671967 type (self .backend ).set_no_storage ()
19681968 self .backend .assert_grid_correct ()
19691969
1970- env ._timestep_overflow [self .id_2nd_line_disco ] = 2
1971-
1970+ env ._protection_counter [self .id_2nd_line_disco ] = 2
19721971 thermal_limit = 10 * self .lines_flows_init
19731972 thermal_limit [self .id_first_line_disco ] = (
19741973 self .lines_flows_init [self .id_first_line_disco ] / 2
@@ -1978,7 +1977,7 @@ def test_nb_timestep_overflow_disc2(self):
19781977
19791978 disco , infos , conv_ = self .backend .next_grid_state (env , is_dc = False )
19801979 assert conv_ is None
1981- assert len (infos ) == 2 # check that there is a cascading failure of length 2
1980+ assert len (infos ) == 2 , f" { len ( infos ) } vs 2" # check that there is a cascading failure of length 2
19821981 assert disco [self .id_first_line_disco ] >= 0
19831982 assert disco [self .id_2nd_line_disco ] >= 0
19841983 assert np .sum (disco >= 0 ) == 2
@@ -2394,6 +2393,7 @@ def test_obs_from_same_chronic(self):
23942393 assert np .all (obs1 .line_status == obs2 .line_status )
23952394 assert np .all (obs1 .topo_vect == obs2 .topo_vect )
23962395 assert np .all (obs1 .timestep_overflow == obs2 .timestep_overflow )
2396+ assert np .all (obs1 .timestep_protection_engaged == obs2 .timestep_protection_engaged )
23972397 assert np .all (obs1 .time_before_cooldown_line == obs2 .time_before_cooldown_line )
23982398 assert np .all (obs1 .time_before_cooldown_sub == obs2 .time_before_cooldown_sub )
23992399 assert np .all (obs1 .time_next_maintenance == obs2 .time_next_maintenance )
0 commit comments