diff --git a/metadrive/component/lane/pg_lane.py b/metadrive/component/lane/pg_lane.py index 26cfda222..3f2df7d84 100644 --- a/metadrive/component/lane/pg_lane.py +++ b/metadrive/component/lane/pg_lane.py @@ -73,8 +73,10 @@ def construct_sidewalk(self, block): start_lat = +self.width_at(0) / 2 + 0.2 side_lat = start_lat + PGDrivableAreaProperty.SIDEWALK_WIDTH if self.radius != 0 and side_lat > self.radius: - raise ValueError("The sidewalk width ({}) is too large." - " It should be < radius ({})".format(side_lat, self.radius)) + raise ValueError( + "The sidewalk width ({}) is too large." + " It should be < radius ({})".format(side_lat, self.radius) + ) for k, lateral in enumerate([start_lat, side_lat]): if k == 1: longs = longs[::-1] diff --git a/metadrive/utils/utils.py b/metadrive/utils/utils.py index f9c5e25c9..72f90470a 100644 --- a/metadrive/utils/utils.py +++ b/metadrive/utils/utils.py @@ -119,12 +119,12 @@ def merge_dicts(old_dict, new_dict, allow_new_keys=False, without_copy=False): def _deep_update( - original, - new_dict, - new_keys_allowed=False, - allow_new_subkey_list=None, - override_all_if_type_changes=None, - raise_error=True + original, + new_dict, + new_keys_allowed=False, + allow_new_subkey_list=None, + override_all_if_type_changes=None, + raise_error=True ): allow_new_subkey_list = allow_new_subkey_list or [] override_all_if_type_changes = override_all_if_type_changes or [] @@ -222,7 +222,6 @@ def time_me(fn): Returns: None """ - def _wrapper(*args, **kwargs): start = time.time() ret = fn(*args, **kwargs) @@ -309,8 +308,7 @@ def draw_polygon(polygon): # Plot the rectangle plt.figure(figsize=(8, 8)) - plt.plot(*zip(*np.append(rectangle_points, [rectangle_points[0]], axis=0)), marker='o', - label='Rectangle Vertices') + plt.plot(*zip(*np.append(rectangle_points, [rectangle_points[0]], axis=0)), marker='o', label='Rectangle Vertices') plt.fill( *zip(*np.append(rectangle_points, [rectangle_points[0]], axis=0)), alpha=0.3 ) # Fill the rectangle with light opacity