Use SupportsFloat in step_api_compatibility (#368)

Co-authored-by: Mark Towers <mark.m.towers@gmail.com>
This commit is contained in:
Yodogawa Mikio
2023-03-14 16:31:13 +01:00
committed by GitHub
parent be0d319b77
commit 146c6ca0dc

View File

@@ -1,5 +1,5 @@
"""Contains methods for step compatibility, from old-to-new and new-to-old API."""
from typing import Tuple, Union
from typing import SupportsFloat, Tuple, Union
import numpy as np
@@ -8,14 +8,14 @@ from gymnasium.core import ObsType
DoneStepType = Tuple[
Union[ObsType, np.ndarray],
Union[float, np.ndarray],
Union[SupportsFloat, np.ndarray],
Union[bool, np.ndarray],
Union[dict, list],
]
TerminatedTruncatedStepType = Tuple[
Union[ObsType, np.ndarray],
Union[float, np.ndarray],
Union[SupportsFloat, np.ndarray],
Union[bool, np.ndarray],
Union[bool, np.ndarray],
Union[dict, list],