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:
Mark Towers
2022-05-25 15:28:19 +01:00
committed by GitHub
parent 273e3f22ce
commit 0263deb5ab
27 changed files with 148 additions and 154 deletions

View File

@@ -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)