diff --git a/carl/envs/gymnax/carl_gymnax_env.py b/carl/envs/gymnax/carl_gymnax_env.py index d8947290..84db31f3 100644 --- a/carl/envs/gymnax/carl_gymnax_env.py +++ b/carl/envs/gymnax/carl_gymnax_env.py @@ -4,14 +4,12 @@ import importlib -import gymnasium -import gymnax.environments from gymnasium.core import Env from carl.context.selection import AbstractSelector from carl.envs.carl_env import CARLEnv from carl.envs.gymnax.utils import make_gymnax_env -from carl.utils.types import Context, Contexts +from carl.utils.types import Contexts class CARLGymnaxEnv(CARLEnv): diff --git a/carl/envs/gymnax/classic_control/carl_gymnax_acrobot.py b/carl/envs/gymnax/classic_control/carl_gymnax_acrobot.py index cf16034e..e28b4a7e 100644 --- a/carl/envs/gymnax/classic_control/carl_gymnax_acrobot.py +++ b/carl/envs/gymnax/classic_control/carl_gymnax_acrobot.py @@ -1,6 +1,5 @@ from __future__ import annotations -import gymnax import jax.numpy as jnp import numpy as np diff --git a/carl/envs/gymnax/classic_control/carl_gymnax_cartpole.py b/carl/envs/gymnax/classic_control/carl_gymnax_cartpole.py index 7d86b0ee..5e3df165 100644 --- a/carl/envs/gymnax/classic_control/carl_gymnax_cartpole.py +++ b/carl/envs/gymnax/classic_control/carl_gymnax_cartpole.py @@ -2,9 +2,6 @@ import importlib -import gymnax -import jax.numpy as np - from carl.context.context_space import ContextFeature, UniformFloatContextFeature from carl.envs.gymnax.carl_gymnax_env import CARLGymnaxEnv diff --git a/carl/envs/gymnax/classic_control/carl_gymnax_mountaincar.py b/carl/envs/gymnax/classic_control/carl_gymnax_mountaincar.py index 371d8554..746ce67e 100644 --- a/carl/envs/gymnax/classic_control/carl_gymnax_mountaincar.py +++ b/carl/envs/gymnax/classic_control/carl_gymnax_mountaincar.py @@ -1,6 +1,5 @@ from __future__ import annotations -import gymnax import jax.numpy as np from carl.context.context_space import ContextFeature, UniformFloatContextFeature diff --git a/carl/envs/gymnax/utils.py b/carl/envs/gymnax/utils.py index dbf70a95..454335d1 100644 --- a/carl/envs/gymnax/utils.py +++ b/carl/envs/gymnax/utils.py @@ -1,17 +1,13 @@ from __future__ import annotations -from typing import Any, Optional, Sequence +from typing import Any import gymnasium import gymnasium.spaces import gymnax -from gymnasium.wrappers import EnvCompatibility -from gymnasium.wrappers.compatibility import LegacyEnv from gymnax.environments.environment import Environment, EnvParams from gymnax.environments.spaces import Space, gymnax_space_to_gym_space from gymnax.wrappers.gym import GymnaxToGymWrapper -from numpy._typing import DTypeLike -from numpy.random._generator import Generator as Generator # Although this converts to gym, the step API already is for gymnasium