Skip to content

Commit

Permalink
Merge pull request #575 from EBoguslawski/eb_normalization_warning
Browse files Browse the repository at this point in the history
fix normalization warning
  • Loading branch information
BDonnot authored Jan 18, 2024
2 parents 628547b + 7c229e9 commit fb92632
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions grid2op/gym_compat/box_gym_actspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ class __AuxBoxGymActSpace:
.. code-block:: python
gym_env.observation_space = BoxGymActSpace(env.observation_space,
gym_env.action_space = BoxGymActSpace(env.action_space,
attr_to_keep=['redispatch', "curtail"])
You can also apply some basic transformation to the attribute of the action. This can be done with:
.. code-block:: python
gym_env.observation_space = BoxGymActSpace(env.observation_space,
gym_env.action_space = BoxGymActSpace(env.action_space,
attr_to_keep=['redispatch', "curtail"],
multiply={"redispatch": env.gen_max_ramp_up},
add={"redispatch": 0.5 * env.gen_max_ramp_up})
Expand Down Expand Up @@ -654,7 +654,7 @@ def normalize_attr(self, attr_nm: str):
both_finite &= curr_high > curr_low

if (~both_finite).any():
warnings.warn(f"The normalization of attribute \"{both_finite}\" cannot be performed entirely as "
warnings.warn(f"The normalization of attribute \"{attr_tmp}\" cannot be performed entirely as "
f"there are some non finite value, or `high == `low` "
f"for some components.")

Expand Down
2 changes: 1 addition & 1 deletion grid2op/gym_compat/box_gym_obsspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ def normalize_attr(self, attr_nm: str):
both_finite &= curr_high > curr_low

if (~both_finite).any():
warnings.warn(f"The normalization of attribute \"{both_finite}\" cannot be performed entirely as "
warnings.warn(f"The normalization of attribute \"{attr_nm}\" cannot be performed entirely as "
f"there are some non finite value, or `high == `low` "
f"for some components.")

Expand Down

0 comments on commit fb92632

Please sign in to comment.