From 6e3e1409e84ca65b93baf0d1377d21cd3ac41b65 Mon Sep 17 00:00:00 2001 From: Xavier Weiss Date: Fri, 8 Nov 2024 19:34:03 +0100 Subject: [PATCH] Test: Revert ActStr Signed-off-by: Xavier Weiss --- grid2op/tests/test_alert_gym_compat.py | 40 +++++++++++++------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/grid2op/tests/test_alert_gym_compat.py b/grid2op/tests/test_alert_gym_compat.py index 1c9a9f8d..ce3a74e8 100644 --- a/grid2op/tests/test_alert_gym_compat.py +++ b/grid2op/tests/test_alert_gym_compat.py @@ -117,7 +117,13 @@ def test_print_alert(self): act.raise_alert = [2] act_gym = env_gym.action_space.to_gym(act) act_str = act_gym.__str__() - assert act_str == ("OrderedDict({'change_bus': array([False, False, False, False, False, False, False, False, False,\n " + assert act_str == ("OrderedDict([('change_bus', array([False, False, False, False, False, False, False, False, False," + "\n False, False, False, False, False, False, False, False, False,\n " + "False, False, False, False, False, False, False, False, False,\n False, False, False, " + "False, False, False, False, False, False,\n False, False, False, False, False, False, False, " + "False, False,\n False, False, False, False, False, False, False, False, False,\n False, " + "False, False, False, False, False, False, False, False,\n False, False, False, False, False, False, " + "False, False, False,\n False, False, False, False, False, False, False, False, False,\n " "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, " "False, False, False, False,\n False, False, False, False, False, False, False, False, False,\n " "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, " @@ -125,28 +131,22 @@ def test_print_alert(self): "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, " "False, False, False, False,\n False, False, False, False, False, False, False, False, False,\n " "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, " - "False, False, False, False,\n False, False, False, False, False, False, False, False, False,\n " + "False])), ('change_line_status', array([False, False, False, False, False, False, False, False, False,\n " "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, " "False, False, False, False,\n False, False, False, False, False, False, False, False, False,\n " "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, " - "False, False, False, False,\n False, False, False, False, False, False, False, False, False,\n " - "False, False, False, False, False, False]), 'change_line_status': array([False, False, False, False, False, " - "False, False, False, False,\n False, False, False, False, False, False, False, False, False,\n " - "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False, False, " - "False, False, False,\n False, False, False, False, False, False, False, False, False,\n " - "False, False, False, False, False, False, False, False, False,\n False, False, False, False, False]), " - "'curtail': array([-1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,\n -1., -1., -1., -1., " - "-1., -1., -1., -1., -1.], dtype=float32), 'raise_alert': array([False, False, True, False, False, False, False, " - "False, False,\n False]), 'redispatch': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., " - "0., 0.,\n 0., 0., 0., 0., 0.], dtype=float32), 'set_bus': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " - "0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, " - "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " - "0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n " - "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " - "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n " - "0], dtype=int32), 'set_line_status': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n " - "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], " - "dtype=int32)})") + "False, False, False, False,\n False, False, False, False, False])), ('curtail', array([-1., -1., -1., " + "-1., -1., -1., -1., -1., -1., -1., -1., -1., -1.,\n -1., -1., -1., -1., -1., -1., -1., -1., -1.], " + "dtype=float32)), ('raise_alert', array([False, False, True, False, False, False, False, False, False,\n " + "False])), ('redispatch', array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,\n " + "0., 0., 0., 0., 0.], dtype=float32)), ('set_bus', array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " + "0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, " + "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " + "0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, " + "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, " + "0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0], dtype=int32)), " + "('set_line_status', array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, " + "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=int32))])") def test_convert_alert_to_gym(self): """test i can create the env"""