mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-02 06:16:32 +00:00
Fix rendering of examples (#699)
Co-authored-by: Martin van Hensbergen <martin@mvhensbergen.com>
This commit is contained in:
@@ -430,6 +430,7 @@ def flatten_space(space: Space[Any]) -> Box | Dict | Sequence | Tuple | Graph:
|
||||
|
||||
Example:
|
||||
Flatten spaces.Box:
|
||||
|
||||
>>> from gymnasium.spaces import Box
|
||||
>>> box = Box(0.0, 1.0, shape=(3, 4, 5))
|
||||
>>> box
|
||||
@@ -440,6 +441,7 @@ def flatten_space(space: Space[Any]) -> Box | Dict | Sequence | Tuple | Graph:
|
||||
True
|
||||
|
||||
Flatten spaces.Discrete:
|
||||
|
||||
>>> from gymnasium.spaces import Discrete
|
||||
>>> discrete = Discrete(5)
|
||||
>>> flatten_space(discrete)
|
||||
@@ -448,6 +450,7 @@ def flatten_space(space: Space[Any]) -> Box | Dict | Sequence | Tuple | Graph:
|
||||
True
|
||||
|
||||
Flatten spaces.Dict:
|
||||
|
||||
>>> from gymnasium.spaces import Dict, Discrete, Box
|
||||
>>> space = Dict({"position": Discrete(2), "velocity": Box(0, 1, shape=(2, 2))})
|
||||
>>> flatten_space(space)
|
||||
@@ -456,6 +459,7 @@ def flatten_space(space: Space[Any]) -> Box | Dict | Sequence | Tuple | Graph:
|
||||
True
|
||||
|
||||
Flatten spaces.Graph:
|
||||
|
||||
>>> from gymnasium.spaces import Graph, Discrete, Box
|
||||
>>> space = Graph(node_space=Box(low=-100, high=100, shape=(3, 4)), edge_space=Discrete(5))
|
||||
>>> flatten_space(space)
|
||||
|
Reference in New Issue
Block a user