Allow users to use vendor copy of typeguard?
Hi Patrick,
We're big fans of using jaxtyping, but like others struggle with the issue of needing to pin to old versions of typeguard. The problem with newer versions, apart from not actually doing type checks, is that it also spams InstrumentationWarning messages which are difficult to filter.
Would it be acceptable to expose the vendor copy of typeguard that jaxtyping now ships to users? This seems to solve our problem, and removes the need to pin typeguard dependencies?
Thanks!
Hey there!
I'm a little wary about actually exposing the vendorered copy publicly. Being responsible for every false positive/negative of the typechecker is probably more than I want to take on!
Nonetheless I don't have any plans to move the vendorered copy, so whilst it is an internal detail that may change, you can probably just reach into the internals and use it for the time being :)
Alternatively, I'd recommend using beartype, which is another excellent runtime type-checker.
Thanks for the quick response, and completely understand about your wariness! Not sure we're comfortable relying on any internals, but If you have a change of heart, we'd be most grateful :)
We've looked at beartype in the past, but the random typechecking isn't really what we're after, esp. when it comes to JAX and inadvertently passing the wrong types/shapes... it's an expensive gamble!
Thanks for all the hard work on this project, it really is great having annotations and runtime checks on array types.