From ea78fdb115cab6fc6a6514e1e3c662a0bb71e710 Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Mon, 2 Dec 2024 15:52:46 +0100 Subject: [PATCH] fix a bug when setting thermal limit with obs_env Signed-off-by: DONNOT Benjamin --- CHANGELOG.rst | 2 ++ grid2op/Environment/environment.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2c80ebe9..5a773177 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -121,6 +121,8 @@ Native multi agents support: object you tried to modified (for example a list with a size of `n_load` that affected the loads)) - [FIXED] a bug when using the `DoNothingHandler` for the maintenance and the environment data +- [FIXED] an issue preventing to set the thermal limit in the options + if the last simulated action lead to a game over - [ADDED] possibility to set the "thermal limits" when calling `env.reset(..., options={"thermal limit": xxx})` - [ADDED] possibility to retrieve some structural information about elements with with `gridobj.get_line_info(...)`, `gridobj.get_load_info(...)`, `gridobj.get_gen_info(...)` diff --git a/grid2op/Environment/environment.py b/grid2op/Environment/environment.py index 5468db5e..ce4ccd90 100644 --- a/grid2op/Environment/environment.py +++ b/grid2op/Environment/environment.py @@ -1297,6 +1297,8 @@ def reset(self, if ambiguous: raise Grid2OpException("You provided an invalid (ambiguous) action to set the 'init state'") from except_tmp init_state.remove_change() + if self.observation_space.obs_env is not None: + self.observation_space.obs_env.reset() super().reset(seed=seed, options=options) if options is not None and "max step" in options: