-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix annotations #18395
Fix annotations #18395
Conversation
24fce30
to
f646942
Compare
Overall comment here: the approach in this PR is one I've tried in other contexts and often ended up having to roll back: namely, you're trying to fix type check errors by changing the runtime behavior of the function. It's very likely that such changes will have unexpected effects in unanticipated corners of downstream JAX use, and so this kind of PR will likely lead to a rollback. Instead, we should fix type checking errors by fixing type annotations, without changing the runtime logic. That's a much safer change in general. |
Okay, I know you're right. Thanks for being patient with this PR. I'll scan over this change and try to eliminate behavior changes. |
9054002
to
5746e59
Compare
Also, I think some of this PR does not make sense separate from the Some changes here make sense as stand-alone though: for example adding real type annotations to properties, or adding overloads for |
Makes perfect sense. Just to let you know that I have tested this PR by rebasing it onto the jit annotation change, making sure it still has no type errors, and then rebasing back onto main. Do you want to let me know how you'd like this PR split? |
696b2fb
to
68ed53d
Compare
68ed53d
to
1818002
Compare
1818002
to
4a7c844
Compare
Sorry, I should have realized that. |
0ea740a
to
07119f1
Compare
@jakevdp Just checking that we're on the same page. These remaining changes are just what you described as the "fiddly" changes for the annotate Jit PR that you said would eventually change when we go to do that. Sorry for the rebase, I just wanted to make sure that it was clean with Ruff. Let me know if there's anything you want me to split off into another PR though, and I'm happy to do that. |
Thanks! I think all this looks pretty reasonable now. We'll need to do |
07119f1
to
d3b5071
Compare
1a3650e
to
1917577
Compare
1917577
to
cd1d0b8
Compare
cd1d0b8
to
ddd6d55
Compare
@jakevdp Is this okay to merge? |
ddd6d55
to
073c3da
Compare
Let's see what the tests say 😀 |
Test failures are real, it looks like the |
073c3da
to
1e58045
Compare
This pull request probably needs some reviewer guidance. It fixes all (but one) of the MyPy errors after the jit-annotation PR. I will comment on various changes in line.
The final type error should be fixed by this PR.