Skip to content

Commit

Permalink
complete test for issue 446
Browse files Browse the repository at this point in the history
  • Loading branch information
EBoguslawski committed Sep 5, 2023
1 parent ac503f1 commit 2ea3c8a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions grid2op/tests/test_issue_446.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down

0 comments on commit 2ea3c8a

Please sign in to comment.