Skip to content

Commit

Permalink
Rework tuple typing
Browse files Browse the repository at this point in the history
  • Loading branch information
WillB97 committed Jun 29, 2024
1 parent d8ddbef commit 9ce0649
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Documentation = "https://docs.sourcebots.co.uk"
dev = [
"flake8",
"isort",
"mypy",
"mypy>=1.7,<2",
"build",
"types-pyserial",
"pytest",
Expand Down
3 changes: 1 addition & 2 deletions sbot/simulator/camera.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import struct
from typing import cast

import cv2
import numpy as np
Expand Down Expand Up @@ -30,7 +29,7 @@ def __init__(self, camera_info: BoardInfo) -> None:
# The calibration data is returned as a string of floats separated by colons
new_calibration = tuple(map(float, response.split(b":")))
assert len(new_calibration) == 4, f"Invalid calibration data: {new_calibration}"
self.calibration = cast(tuple[float, float, float, float], new_calibration)
self.calibration = new_calibration
assert len(self.calibration) == 4, f"Invalid calibration data: {self.calibration}"

# Get the image size for this camera
Expand Down

0 comments on commit 9ce0649

Please sign in to comment.