mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-01 22:11:25 +00:00
Fix the vector wrapper warnings (#1415)
This commit is contained in:
@@ -387,7 +387,7 @@ class ResizeObservation(
|
||||
) from e
|
||||
|
||||
self.shape: Final[tuple[int, int]] = tuple(shape)
|
||||
# for some reason, cv2.resize will return the shape in reverse, todo confirm implementation
|
||||
# for some reason, cv2.resize will return the shape in reverse
|
||||
self.cv2_shape: Final[tuple[int, int]] = (shape[1], shape[0])
|
||||
|
||||
new_observation_space = spaces.Box(
|
||||
|
@@ -85,7 +85,9 @@ class RecordEpisodeStatistics(VectorWrapper):
|
||||
super().__init__(env)
|
||||
self._stats_key = stats_key
|
||||
if "autoreset_mode" not in self.env.metadata:
|
||||
warn("todo")
|
||||
warn(
|
||||
f"{self} is missing `autoreset_mode` tag in its metadata, therefore, `RecordEpisodeStatistics` is assuming that the environment uses `AutoresetMode.NEXT_STEP`. See `https://farama.org/Vector-Autoreset-Mode` for more information on autoreset modes."
|
||||
)
|
||||
self._autoreset_mode = AutoresetMode.NEXT_STEP
|
||||
else:
|
||||
assert isinstance(self.env.metadata["autoreset_mode"], AutoresetMode)
|
||||
|
@@ -74,7 +74,7 @@ class NormalizeObservation(VectorObservationWrapper, gym.utils.RecordConstructor
|
||||
|
||||
if "autoreset_mode" not in self.env.metadata:
|
||||
warn(
|
||||
f"{self} is missing `autoreset_mode` data. Assuming that the vector environment it follows the `NextStep` autoreset api or autoreset is disabled. Read todo for more details."
|
||||
f"{self} is missing `autoreset_mode` data. Assuming that the vector environment it follows the `NextStep` autoreset api or autoreset is disabled. Read https://farama.org/Vector-Autoreset-Mode for more details."
|
||||
)
|
||||
else:
|
||||
assert self.env.metadata["autoreset_mode"] in {AutoresetMode.NEXT_STEP}
|
||||
|
Reference in New Issue
Block a user