Skip to content

Conversation

@pjreiniger
Copy link
Contributor

Used Gemini to convert the C++ tests in wpimath/.../kinematics to pytest. For ease of use required a better constructor for MecanumDriveWheelPositions

I did this conversion months ago (before robotpy landed and before the reorg), so new tests might be missing. At least its better than nothing 🤷

Broke the huge pr that does almost everything into parts so its easier to review.

@pjreiniger pjreiniger requested a review from a team as a code owner December 9, 2025 06:37
@github-actions github-actions bot added component: wpimath Math library 2027 2027 target labels Dec 9, 2025
Copy link
Member

@auscompgeek auscompgeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favour of more tests, but they should use the library similarly to how we expect teams to use it.


def test_discretize():
target = ChassisSpeeds(
meters_per_second(1), meters_per_second(0), radians_per_second(0.5)
Copy link
Member

@auscompgeek auscompgeek Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO these tests should use keyword arguments for clarity, similarly to the existing tests, and shouldn't wrap the values in calls to the units type aliases.

Using the type aliases like this might mislead users, who may look at these tests as examples, into thinking that you could call a different unit type alias and it'd convert for you. Which, if you know they're only type aliases, is obviously wrong, but without that context it's not obvious from reading the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2027 2027 target component: wpimath Math library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants