photonvision icon indicating copy to clipboard operation
photonvision copied to clipboard

photonlibpy fails type check

Open auscompgeek opened this issue 1 year ago • 2 comments

Describe the bug

photonlibpy/photonCamera.py:89: error: Argument 1 to "Packet" has incompatible type "bytes"; expected "list[int]"  [arg-type]

To Reproduce

pip install mypy
mypy photonlib/

auscompgeek avatar Jan 10 '24 00:01 auscompgeek

Do you have bandwidth to add mypi to our CI workflow and fix all the errors?

mcm001 avatar Jan 10 '24 14:01 mcm001

More errors now!

photonlibpy/estimatedRobotPose.py:22: error: Bracketed expression "[...]" is not valid as a type  [valid-type]
photonlibpy/estimatedRobotPose.py:22: note: Did you mean "List[...]"?
photonlibpy/photonPoseEstimator.py:151: error: Incompatible return value type (got "Pose3d | None", expected "Pose3d")  [return-value]
photonlibpy/photonPoseEstimator.py:167: error: Incompatible return value type (got "Pose3d | None", expected "Pose3d")  [return-value]
photonlibpy/photonPoseEstimator.py:207: error: Return value expected  [return-value]
photonlibpy/photonPoseEstimator.py:211: error: Return value expected  [return-value]
photonlibpy/photonPoseEstimator.py:220: error: Return value expected  [return-value]
photonlibpy/photonPoseEstimator.py:223: error: Incompatible types in assignment (expression has type "float", variable has type "int")  [assignment]
photonlibpy/photonPoseEstimator.py:227: error: Return value expected  [return-value]
photonlibpy/photonPoseEstimator.py:242: error: Return value expected  [return-value]
photonlibpy/photonPoseEstimator.py:290: error: Incompatible types in assignment (expression has type "float", variable has type "int")  [assignment]
photonlibpy/photonPoseEstimator.py:296: error: Return value expected  [return-value]
photonlibpy/photonPoseEstimator.py:304: error: Return value expected  [return-value]

Do you have bandwidth to add mypi to our CI workflow and fix all the errors?

No.

auscompgeek avatar Jan 28 '24 05:01 auscompgeek