From 6a09d2d4beff6749c2f79b822b90202ad8d22be0 Mon Sep 17 00:00:00 2001 From: pseudo-rnd-thoughts Date: Fri, 9 Aug 2024 18:27:18 +0100 Subject: [PATCH] pre-commit --- highway_env/__init__.py | 7 +++++-- highway_env/envs/__init__.py | 12 ++++++++++-- highway_env/envs/common/abstract.py | 1 - highway_env/envs/exit_env.py | 2 +- tests/envs/test_gym.py | 5 +++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/highway_env/__init__.py b/highway_env/__init__.py index 768f35943..ffcc0b53b 100644 --- a/highway_env/__init__.py +++ b/highway_env/__init__.py @@ -88,7 +88,8 @@ def _register_highway_envs(): ) gym.register( - id="parking-parked-v0", entry_point="highway_env.envs.parking_env:ParkingEnvParkedVehicles" + id="parking-parked-v0", + entry_point="highway_env.envs.parking_env:ParkingEnvParkedVehicles", ) # racetrack_env.py @@ -105,7 +106,9 @@ def _register_highway_envs(): # two_way_env.py gym.register( - id="two-way-v0", entry_point="highway_env.envs.two_way_env:TwoWayEnv", max_episode_steps=15 + id="two-way-v0", + entry_point="highway_env.envs.two_way_env:TwoWayEnv", + max_episode_steps=15, ) # u_turn_env.py diff --git a/highway_env/envs/__init__.py b/highway_env/envs/__init__.py index 0df23f8ed..552a8f5f8 100644 --- a/highway_env/envs/__init__.py +++ b/highway_env/envs/__init__.py @@ -1,9 +1,17 @@ from highway_env.envs.exit_env import ExitEnv from highway_env.envs.highway_env import HighwayEnv, HighwayEnvFast -from highway_env.envs.intersection_env import IntersectionEnv, ContinuousIntersectionEnv, MultiAgentIntersectionEnv +from highway_env.envs.intersection_env import ( + IntersectionEnv, + ContinuousIntersectionEnv, + MultiAgentIntersectionEnv, +) from highway_env.envs.lane_keeping_env import LaneKeepingEnv from highway_env.envs.merge_env import MergeEnv -from highway_env.envs.parking_env import ParkingEnv, ParkingEnvActionRepeat, ParkingEnvParkedVehicles +from highway_env.envs.parking_env import ( + ParkingEnv, + ParkingEnvActionRepeat, + ParkingEnvParkedVehicles, +) from highway_env.envs.racetrack_env import RacetrackEnv from highway_env.envs.roundabout_env import RoundaboutEnv from highway_env.envs.two_way_env import TwoWayEnv diff --git a/highway_env/envs/common/abstract.py b/highway_env/envs/common/abstract.py index 59f316b1d..454cf7345 100644 --- a/highway_env/envs/common/abstract.py +++ b/highway_env/envs/common/abstract.py @@ -428,7 +428,6 @@ def __deepcopy__(self, memo): class MultiAgentWrapper(Wrapper, RecordConstructorArgs): - def __init__(self, env): Wrapper.__init__(self, env) RecordConstructorArgs.__init__(self) diff --git a/highway_env/envs/exit_env.py b/highway_env/envs/exit_env.py index e9d40e66e..4f590c8b6 100644 --- a/highway_env/envs/exit_env.py +++ b/highway_env/envs/exit_env.py @@ -3,8 +3,8 @@ import numpy as np from highway_env import utils -from highway_env.envs.highway_env import HighwayEnv from highway_env.envs.common.action import Action +from highway_env.envs.highway_env import HighwayEnv from highway_env.road.lane import CircularLane from highway_env.road.road import Road, RoadNetwork from highway_env.vehicle.controller import ControlledVehicle diff --git a/tests/envs/test_gym.py b/tests/envs/test_gym.py index 9d43ad2b0..6246d8060 100644 --- a/tests/envs/test_gym.py +++ b/tests/envs/test_gym.py @@ -12,7 +12,8 @@ highway_env_ids = [ - env_id for env_id, env_spec in gym.registry.items() + env_id + for env_id, env_spec in gym.registry.items() if isinstance(env_spec.entry_point, str) and "highway_env" in env_spec.entry_point ] @@ -24,7 +25,7 @@ "A Box observation space maximum value is infinity. This is probably too high.", # "For Box action spaces, we recommend using a symmetric and normalized space (range=[-1, 1] or [0, 1]). See https://stable-baselines3.readthedocs.io/en/master/guide/rl_tips.html for more information.", "The environment intersection-v0 is out of date. You should consider upgrading to version `v1`.", - "The environment intersection-multi-agent-v0 is out of date. You should consider upgrading to version `v1`." + "The environment intersection-multi-agent-v0 is out of date. You should consider upgrading to version `v1`.", ] ]