From 290ca42bb9fbf79ea4283d2d6ba10021bcb2eecb Mon Sep 17 00:00:00 2001 From: deuce1957 Date: Tue, 12 Mar 2024 13:22:12 +0100 Subject: [PATCH] Debug: Fixed Accidental Rename of 'name' to 'ep_id' --- grid2op/tests/test_EpisodeData.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/grid2op/tests/test_EpisodeData.py b/grid2op/tests/test_EpisodeData.py index 7cfda9ba7..15f231979 100644 --- a/grid2op/tests/test_EpisodeData.py +++ b/grid2op/tests/test_EpisodeData.py @@ -133,7 +133,7 @@ def act(self, observation, reward, done=False): # test that the right seeds are assigned to the agent res = runner.run(nb_episode=1, max_iter=self.max_iter, path_save=f) - episode_data = EpisodeData.from_disk(agent_path=f, ep_id=res[0][1]) + episode_data = EpisodeData.from_disk(agent_path=f, name=res[0][1]) assert int(episode_data.meta["chronics_max_timestep"]) == self.max_iter assert len(episode_data.actions) == self.max_iter assert len(episode_data.observations) == self.max_iter + 1 @@ -148,7 +148,7 @@ def test_one_episode_with_saving(self): timestep, max_ts ) = self.runner.run_one_episode(path_save=f) - episode_data = EpisodeData.from_disk(agent_path=f, ep_id=episode_name) + episode_data = EpisodeData.from_disk(agent_path=f, name=episode_name) assert int(episode_data.meta["chronics_max_timestep"]) == self.max_iter assert len(episode_data.other_rewards) == self.max_iter for other, real in zip(episode_data.other_rewards, episode_data.rewards): @@ -191,14 +191,14 @@ def test_len(self): timestep, max_ts ) = self.runner.run_one_episode(path_save=f) - episode_data = EpisodeData.from_disk(agent_path=f, ep_id=episode_name) + episode_data = EpisodeData.from_disk(agent_path=f, name=episode_name) len(episode_data) def test_3_episode_with_saving(self): f = tempfile.mkdtemp() res = self.runner._run_sequential(nb_episode=3, path_save=f) for i, episode_name, cum_reward, timestep, total_ts in res: - episode_data = EpisodeData.from_disk(agent_path=f, ep_id=episode_name) + episode_data = EpisodeData.from_disk(agent_path=f, name=episode_name) assert int(episode_data.meta["chronics_max_timestep"]) == self.max_iter assert ( np.abs( @@ -215,7 +215,7 @@ def test_3_episode_3process_with_saving(self): ) assert len(res) == nb_episode for i, episode_name, cum_reward, timestep, total_ts in res: - episode_data = EpisodeData.from_disk(agent_path=f, ep_id=episode_name) + episode_data = EpisodeData.from_disk(agent_path=f, name=episode_name) assert int(episode_data.meta["chronics_max_timestep"]) == self.max_iter assert ( np.abs( @@ -263,7 +263,7 @@ def test_with_opponent(self): path_save=f, ) - episode_data = EpisodeData.from_disk(agent_path=f, ep_id=res[0][1]) + episode_data = EpisodeData.from_disk(agent_path=f, name=res[0][1]) lines_impacted, subs_impacted = episode_data.attacks[0].get_topological_impact() assert lines_impacted[3]