From 2ea3c8ab365787fdca3381290942e7beec246540 Mon Sep 17 00:00:00 2001 From: Eva BOGUSLAWSKI Date: Tue, 5 Sep 2023 18:58:30 +0200 Subject: [PATCH] complete test for issue 446 --- grid2op/tests/test_issue_446.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/grid2op/tests/test_issue_446.py b/grid2op/tests/test_issue_446.py index 2a09853eb..d9aad58f7 100644 --- a/grid2op/tests/test_issue_446.py +++ b/grid2op/tests/test_issue_446.py @@ -19,21 +19,26 @@ def test_box_action_space(self): env = grid2op.make("l2rpn_case14_sandbox", test=True) divide = {"hour_of_day": np.ones(1)} + subtract = {"hour_of_day": np.zeros(1)} gym_observation_space_1 = BoxGymObsSpace(env.observation_space, attr_to_keep=["curtailment_mw", "hour_of_day"], - divide = divide + divide = divide, + subtract = subtract ) gym_observation_space_2 = BoxGymObsSpace(env.observation_space.copy(), attr_to_keep=["curtailment_mw", "hour_of_day"], - divide = divide + divide = divide, + subtract = subtract ) gym_observation_space_1.normalize_attr("curtailment_mw") assert "curtailment_mw" in gym_observation_space_1._divide assert "curtailment_mw" not in gym_observation_space_2._divide + assert "curtailment_mw" in gym_observation_space_1._subtract + assert "curtailment_mw" not in gym_observation_space_2._subtract if __name__ == "__main__":