Skip to content

Commit

Permalink
fix validate and run pre-commit
Browse files Browse the repository at this point in the history
Signed-off-by: MasatoSaeki <[email protected]>
  • Loading branch information
MasatoSaeki committed Dec 20, 2024
1 parent 4deb845 commit 8e23b11
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions driving_log_replayer_v2/driving_log_replayer_v2/perception.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ def validate_region_range(cls, v: str | None) -> tuple[number, number] | None:
return None

err_non_specify_msg = "both min and max values must be specified."
err_range_msg = f"{v} is not valid distance range, expected ordering min-max with min < max."
err_range_msg = (
f"{v} is not valid distance range, expected ordering min-max with min < max."
)

s_lower, s_upper = v.split(",")

assert s_upper != "" and s_lower != "", err_non_specify_msg

if s_upper != "" or s_lower != "":
raise ValueError(err_non_specify_msg)

lower = float(s_lower)
upper = float(s_upper)
Expand Down

0 comments on commit 8e23b11

Please sign in to comment.