Skip to content

Commit

Permalink
Cast version to int
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul committed Nov 22, 2024
1 parent 85d9413 commit 2aa257b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion choreolib/py/choreo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def load_swerve_trajectory_string(trajectory_json_string: str) -> SwerveTrajecto
"""
data = json.loads(trajectory_json_string)
name = data["name"]
version = data["version"]
version = int(data["version"])
if version != SPEC_VERSION:
raise ValueError(
f"{name}.traj: Wrong version {version}. Expected {SPEC_VERSION}"
Expand Down
2 changes: 1 addition & 1 deletion choreolib/py/choreo/trajectory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def get_chassis_speeds(self) -> ChassisSpeeds:

with open(chor, "r", encoding="utf-8") as project_file:
data = json.load(project_file)
version = data["version"]
version = int(data["version"])
if version != SPEC_VERSION:
raise ValueError(
f".chor project file: Wrong version {version}. Expected {SPEC_VERSION}"
Expand Down

0 comments on commit 2aa257b

Please sign in to comment.