Skip to content

Commit

Permalink
fix issue Grid2op#665
Browse files Browse the repository at this point in the history
Signed-off-by: DONNOT Benjamin <[email protected]>
  • Loading branch information
BDonnot committed Nov 28, 2024
1 parent 37029ad commit 1713fca
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions grid2op/Observation/baseObservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1253,10 +1253,10 @@ def reset(self) -> None:
self.rho[:] = np.NaN

# cool down and reconnection time after hard overflow, soft overflow or cascading failure
self.time_before_cooldown_line[:] = -1
self.time_before_cooldown_sub[:] = -1
self.time_next_maintenance[:] = -1
self.duration_next_maintenance[:] = -1
self.time_before_cooldown_line[:] = 0
self.time_before_cooldown_sub[:] = 0
self.time_next_maintenance[:] = 0
self.duration_next_maintenance[:] = 0
self.timestep_overflow[:] = 0

# calendar data
Expand Down Expand Up @@ -1318,6 +1318,13 @@ def reset(self) -> None:
self.current_step = dt_int(0)
self.max_step = dt_int(np.iinfo(dt_int).max)
self.delta_time = dt_float(5.0)

self._thermal_limit[:] = 0.
self.curtailment_limit[:] = 0.
self.gen_margin_up[:] = 0.
self.gen_margin_down[:] = 0.
self.curtailment_limit_effective[:] = 0.
self.curtailment[:] = 0.

def set_game_over(self,
env: Optional["grid2op.Environment.Environment"]=None) -> None:
Expand Down
1 change: 1 addition & 0 deletions grid2op/gym_compat/box_gym_obsspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ def __init__(

# handle the "functional" part
self._template_obs = ob_sp._template_obj.copy()
self._template_obs.reset()
self.__func = {}

self._dims = None
Expand Down

0 comments on commit 1713fca

Please sign in to comment.