Skip to content

Commit

Permalink
Make format.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamenot committed Dec 21, 2023
1 parent 26bf053 commit c87432a
Show file tree
Hide file tree
Showing 23 changed files with 36 additions and 28 deletions.
2 changes: 1 addition & 1 deletion envision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

from . import etypes as types

sys.modules[f"{__name__}.{types=}".partition('=')[0]] = types
sys.modules[f"{__name__}.{types=}".partition("=")[0]] = types
2 changes: 1 addition & 1 deletion envision/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
from envision import etypes
from envision.client_config import EnvisionStateFilter
from envision.data_formatter import EnvisionDataFormatter, EnvisionDataFormatterArgs
from smarts.core.utils.file import unpack
from smarts.core.utils.core_logging import suppress_websocket
from smarts.core.utils.file import unpack


@dataclass
Expand Down
2 changes: 1 addition & 1 deletion smarts/benchmark/entrypoints/benchmark_runner_v0.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

from smarts.benchmark.driving_smarts import load_config
from smarts.core import config
from smarts.core.utils.import_utils import import_module_from_file
from smarts.core.utils.core_logging import suppress_output
from smarts.core.utils.import_utils import import_module_from_file
from smarts.env.gymnasium.wrappers.metric.formula import FormulaBase, Score
from smarts.env.gymnasium.wrappers.metric.metrics import Metrics
from smarts.env.gymnasium.wrappers.metric.types import Record
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/argoverse_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
from smarts.core.lanepoints import LanePoint, LanePoints, LinkedLanePoint
from smarts.core.road_map import RoadMap, RoadMapWithCaches, Waypoint
from smarts.core.route_cache import RouteWithCache
from smarts.core.utils.glb import make_map_glb, make_road_line_glb
from smarts.core.utils.core_math import (
inplace_unwrap,
line_intersect_vectorized,
radians_to_vec,
vec_2d,
)
from smarts.core.utils.glb import make_map_glb, make_road_line_glb
from smarts.sstudio.sstypes import MapSpec

try:
Expand Down
6 changes: 5 additions & 1 deletion smarts/core/controllers/lane_following_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
from smarts.core.controllers.trajectory_tracking_controller import (
TrajectoryTrackingController,
)
from smarts.core.utils.core_math import lerp, low_pass_filter, min_angles_difference_signed
from smarts.core.utils.core_math import (
lerp,
low_pass_filter,
min_angles_difference_signed,
)

METER_PER_SECOND_TO_KM_PER_HR = 3.6

Expand Down
6 changes: 5 additions & 1 deletion smarts/core/local_traffic_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@
from .scenario import Scenario
from .signals import SignalLightState, SignalState
from .traffic_provider import TrafficProvider
from .utils.core_math import (
min_angles_difference_signed,
radians_to_vec,
vec_to_radians,
)
from .utils.kinematics import (
distance_covered,
stopping_distance,
stopping_time,
time_to_cover,
)
from .utils.core_math import min_angles_difference_signed, radians_to_vec, vec_to_radians
from .vehicle import VEHICLE_CONFIGS, VehicleState

MAX_IMPATIENCE = 3.0
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/opendrive_road_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@

from smarts.core.road_map import RoadMap, RoadMapWithCaches, Waypoint
from smarts.core.route_cache import RouteWithCache
from smarts.core.utils.key_wrapper import KeyWrapper
from smarts.core.utils.core_math import (
CubicPolynomial,
constrain_angle,
Expand All @@ -85,6 +84,7 @@
radians_to_vec,
vec_2d,
)
from smarts.core.utils.key_wrapper import KeyWrapper
from smarts.sstudio.sstypes import MapSpec

from .coordinates import BoundingBox, Heading, Point, Pose, RefLinePoint
Expand Down
4 changes: 2 additions & 2 deletions smarts/core/scenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@
)
from smarts.core.road_map import RoadMap
from smarts.core.traffic_history import TrafficHistory
from smarts.core.utils.file import make_dir_in_smarts_log_dir, path2hash
from smarts.core.utils.id import SocialAgentId
from smarts.core.utils.core_math import (
combination_pairs_with_unique_indices,
radians_to_vec,
vec_to_radians,
)
from smarts.core.utils.file import make_dir_in_smarts_log_dir, path2hash
from smarts.core.utils.id import SocialAgentId
from smarts.sstudio import sstypes as sstudio_types
from smarts.sstudio.sstypes import EntryTactic, MapSpec
from smarts.sstudio.sstypes import Via as SSVia
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/sensors/local_sensor_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
from smarts.core.sensors import SensorResolver, Sensors
from smarts.core.simulation_frame import SimulationFrame
from smarts.core.simulation_local_constants import SimulationLocalConstants
from smarts.core.utils.file import replace
from smarts.core.utils.core_logging import timeit
from smarts.core.utils.file import replace

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion smarts/core/sensors/parallel_sensor_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
from smarts.core.sensors import SensorResolver, Sensors
from smarts.core.simulation_frame import SimulationFrame
from smarts.core.simulation_local_constants import SimulationLocalConstants
from smarts.core.utils.file import replace
from smarts.core.utils.core_logging import timeit
from smarts.core.utils.file import replace

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion smarts/core/smarts.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
from .traffic_provider import TrafficProvider
from .trap_manager import TrapManager
from .utils import pybullet
from .utils.id import Id
from .utils.core_math import rounder_for_dt
from .utils.id import Id
from .utils.pybullet import bullet_client as bc
from .vehicle import Vehicle
from .vehicle_index import VehicleIndex
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/sumo_road_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
from .lanepoints import LanePoint, LanePoints, LinkedLanePoint
from .road_map import RoadMap, Waypoint
from .route_cache import RouteWithCache
from .utils.core_math import inplace_unwrap, radians_to_vec, vec_2d
from .utils.geometry import buffered_shape
from .utils.glb import make_map_glb, make_road_line_glb
from .utils.core_math import inplace_unwrap, radians_to_vec, vec_2d

from smarts.core.utils.sumo import sumolib # isort:skip
from sumolib.net.edge import Edge # isort:skip
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/trap_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
from smarts.core.condition_state import ConditionState
from smarts.core.coordinates import Point as MapPoint
from smarts.core.plan import Mission, Plan, Start, default_entry_tactic
from smarts.core.utils.file import replace
from smarts.core.utils.core_math import clip, squared_dist
from smarts.core.utils.file import replace
from smarts.core.vehicle import Vehicle
from smarts.sstudio.sstypes import MapZone, PositionalZone, TrapEntryTactic

Expand Down
6 changes: 3 additions & 3 deletions smarts/core/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import sys

from . import core_math as math
from . import core_logging as logging
from . import core_math as math

sys.modules[f"{__name__}.{math=}".partition('=')[0]] = math
sys.modules[f"{__name__}.{logging=}".partition('=')[0]] = logging
sys.modules[f"{__name__}.{math=}".partition("=")[0]] = math
sys.modules[f"{__name__}.{logging=}".partition("=")[0]] = logging
2 changes: 1 addition & 1 deletion smarts/core/utils/adapters/ego_centric_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
from smarts.core.coordinates import Heading
from smarts.core.observations import Observation, ViaPoint
from smarts.core.plan import PositionalGoal, Via
from smarts.core.utils.file import replace as _replace
from smarts.core.utils.core_math import (
position_to_ego_frame,
world_position_from_ego_frame,
wrap_value,
)
from smarts.core.utils.file import replace as _replace


def ego_centric_observation_adapter(obs: Observation, *args: Any, **kwargs: Any) -> Any:
Expand Down
2 changes: 1 addition & 1 deletion smarts/core/vehicle.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
ViaSensor,
WaypointsSensor,
)
from .utils.custom_exceptions import RendererException
from .utils.core_math import rotate_cw_around_point
from .utils.custom_exceptions import RendererException
from .vehicle_state import VEHICLE_CONFIGS, VehicleConfig, VehicleState


Expand Down
6 changes: 3 additions & 3 deletions smarts/core/waymo_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@
from smarts.core.lanepoints import LanePoints, LinkedLanePoint
from smarts.core.road_map import RoadMap, RoadMapWithCaches, Waypoint
from smarts.core.route_cache import RouteWithCache
from smarts.core.utils.file import read_tfrecord_file
from smarts.core.utils.geometry import buffered_shape
from smarts.core.utils.glb import make_map_glb, make_road_line_glb
from smarts.core.utils.core_math import (
inplace_unwrap,
line_intersect_vectorized,
radians_to_vec,
ray_boundary_intersect,
vec_2d,
)
from smarts.core.utils.file import read_tfrecord_file
from smarts.core.utils.geometry import buffered_shape
from smarts.core.utils.glb import make_map_glb, make_road_line_glb
from smarts.sstudio.sstypes import MapSpec
from smarts.waymo.exceptions import WaymoDatasetError
from smarts.waymo.waymo_open_dataset.protos import scenario_pb2
Expand Down
2 changes: 1 addition & 1 deletion smarts/env/tests/test_determinism.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
from smarts.core.agent import Agent
from smarts.core.agent_interface import AgentInterface
from smarts.core.controllers import ActionSpaceType
from smarts.core.utils.episodes import episodes
from smarts.core.utils.core_logging import diff_unpackable
from smarts.core.utils.episodes import episodes
from smarts.zoo.agent_spec import AgentSpec


Expand Down
2 changes: 1 addition & 1 deletion smarts/ray/sensors/ray_sensor_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
from smarts.core.serialization.default import dumps, loads
from smarts.core.simulation_frame import SimulationFrame
from smarts.core.simulation_local_constants import SimulationLocalConstants
from smarts.core.utils.file import replace
from smarts.core.utils.core_logging import timeit
from smarts.core.utils.file import replace

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion smarts/sstudio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@

from . import sstypes as types

sys.modules[f"{__name__}.{types=}".partition('=')[0]] = types
sys.modules[f"{__name__}.{types=}".partition("=")[0]] = types
2 changes: 1 addition & 1 deletion smarts/sstudio/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
from yattag import Doc, indent

from smarts.core.road_map import RoadMap
from smarts.core.utils.file import make_dir_in_smarts_log_dir, replace
from smarts.core.utils.core_math import wrap_value
from smarts.core.utils.file import make_dir_in_smarts_log_dir, replace

from . import sstypes

Expand Down
2 changes: 1 addition & 1 deletion smarts/sstudio/genhistories.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@

from smarts.core.coordinates import BoundingBox, Point
from smarts.core.signal_provider import SignalLightState
from smarts.core.utils.file import read_tfrecord_file
from smarts.core.utils.core_math import (
circular_mean,
constrain_angle,
min_angles_difference_signed,
vec_to_radians,
)
from smarts.core.utils.file import read_tfrecord_file
from smarts.sstudio import sstypes
from smarts.waymo.exceptions import WaymoDatasetError

Expand Down
2 changes: 1 addition & 1 deletion smarts/sstudio/genscenario.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

import smarts.core
from smarts.core.default_map_builder import find_mapfile_in_dir
from smarts.core.utils.file import file_md5_hash, path2hash, pickle_hash
from smarts.core.utils.core_logging import timeit
from smarts.core.utils.file import file_md5_hash, path2hash, pickle_hash

from . import sstypes
from .generators import TrafficGenerator
Expand Down

0 comments on commit c87432a

Please sign in to comment.