You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
Some types are left in C++ syntax (units::unit_t<units::unit<std::__1::ratio<1l, 1l>...) and others are simplified but not imported so they are not valid (meters).
robotpy-photonvision has the same issue.
Operating System
MacOS
Installed Python Packages
No response
Reproducible example code
No response
The text was updated successfully, but these errors were encountered:
I'm too lazy to move this issue, but it looks like robotpy-wpimath is missing a type caster for units/angular_acceleration.h (among a few other of the units headers). If we throw one in then we should get back out valid syntax.
On the undefined type aliases, yeah, it's definitely an issue, and I'm surprised nobody's raised it yet. mypy will treat them as Any when you import them (which is mostly fine), but I have noticed Pyright/Pylance will also show Any in VSCode. jedi-language-server returns the unresolved types though. Ideally we'd have meters: TypeAlias = float somewhere. I don't think we have a way of injecting things into the type stub output yet.
Ideally we'd have meters: TypeAlias = float somewhere. I don't think we have a way of injecting things into the type stub output yet.
This would be the right way to fix it... but sounds like work. IMO it's better to have the names in there (and have the type hints be invalid) than to not have the names, since the units aren't always obvious.
Problem description
When type hints are generated, units are not properly resolved:
From robotpy-pathplannerlib:
Some types are left in C++ syntax (
units::unit_t<units::unit<std::__1::ratio<1l, 1l>...
) and others are simplified but not imported so they are not valid (meters
).robotpy-photonvision has the same issue.
Operating System
MacOS
Installed Python Packages
No response
Reproducible example code
No response
The text was updated successfully, but these errors were encountered: