From 7acf06601af21347e0439601e6c8d898db2590db Mon Sep 17 00:00:00 2001 From: DONNOT Benjamin Date: Fri, 8 Nov 2024 09:48:22 +0100 Subject: [PATCH] fix an non issue spotted by sonarcube [skip ci] Signed-off-by: DONNOT Benjamin --- grid2op/Chronics/fromMultiEpisodeData.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/grid2op/Chronics/fromMultiEpisodeData.py b/grid2op/Chronics/fromMultiEpisodeData.py index 45fb8c42..82bc5525 100644 --- a/grid2op/Chronics/fromMultiEpisodeData.py +++ b/grid2op/Chronics/fromMultiEpisodeData.py @@ -123,6 +123,7 @@ def __init__(self, self._path = path self._chunk_size = chunk_size self._list_perfect_forecasts = list_perfect_forecasts + self._input_li_ep_data = li_ep_data if self._caching: self.li_ep_data = [FromOneEpisodeData(path, ep_data=el, @@ -131,12 +132,10 @@ def __init__(self, chunk_size=chunk_size, list_perfect_forecasts=list_perfect_forecasts, start_datetime=start_datetime) - for el in li_ep_data - ] - self._input_li_ep_data = None + for el in li_ep_data + ] else: - self.li_ep_data = [None for el in li_ep_data] - self._input_li_ep_data = li_ep_data + self.li_ep_data = [None for _ in li_ep_data] self._prev_cache_id = len(self.li_ep_data) - 1 self.data = self.li_ep_data[self._prev_cache_id] if self.data is None: