Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
QuanyiLi committed Nov 13, 2023
1 parent a4d2cf0 commit 871a117
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 4 additions & 2 deletions metadrive/component/lane/pg_lane.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
16 changes: 7 additions & 9 deletions metadrive/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down Expand Up @@ -222,7 +222,6 @@ def time_me(fn):
Returns: None
"""

def _wrapper(*args, **kwargs):
start = time.time()
ret = fn(*args, **kwargs)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 871a117

Please sign in to comment.