mirror of
https://github.com/Farama-Foundation/Gymnasium.git
synced 2025-08-21 06:20:15 +00:00
Add support for python 3.6 (#2836)
* Add support for python 3.6 * Add support for python 3.6 * Added check for python 3.6 to not install mujoco as no version exists * Fixed the install groups for python 3.6 * Re-added python 3.6 support for gym * black * Added support for dataclasses through dataclasses module in setup that backports the module * Fixed install requirements * Re-added dummy env spec with dataclasses * Changed type for compatability for python 3.6 * Added a python 3.6 warning * Fixed python 3.6 typing issue * Removed __future__ import annotation for python 3.6 support * Fixed python 3.6 typing
This commit is contained in:
@@ -3,8 +3,6 @@
|
||||
These functions mostly take care of flattening and unflattening elements of spaces
|
||||
to facilitate their usage in learning code.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
import operator as op
|
||||
from collections import OrderedDict
|
||||
from functools import reduce, singledispatch
|
||||
@@ -142,7 +140,9 @@ def unflatten(space: Space[T], x: np.ndarray) -> T:
|
||||
|
||||
@unflatten.register(Box)
|
||||
@unflatten.register(MultiBinary)
|
||||
def _unflatten_box_multibinary(space: Box | MultiBinary, x: np.ndarray) -> np.ndarray:
|
||||
def _unflatten_box_multibinary(
|
||||
space: Union[Box, MultiBinary], x: np.ndarray
|
||||
) -> np.ndarray:
|
||||
return np.asarray(x, dtype=space.dtype).reshape(space.shape)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user