jaxtyping annotations are no longer subclasses of their array type.#309
jaxtyping annotations are no longer subclasses of their array type.#309patrick-kidger merged 9 commits intomainfrom
Conversation
|
Also tagging @lockwo here -- IIRC you've previously bumped into weird edge cases here, can you give this PR a go and LMK if you hit any issues? If not I'll merge this in the next couple of days. |
|
@patrick-kidger Apologies for the silence on my PR. I have more time now, should I merge this PR (#309) in #301 ? How do you want to proceed? |
f987a10 to
e2f7cb3
Compare
Sure, I will test some things out |
All going well I expect to merge this one soon, so MLX support will be there in the next release. |
bf40253 to
13eab3e
Compare
…ing. In particualr this is useful for better documentation.
This has been a subtle point that gets pretty tricky as plenty of classes aren't really designed to be subclassed further, and some may even take steps to ensure this isn't the case (e.g. concrete Equinox modules, or MLX arrays). I *think* the only use-case for this is dispatch using plum -- I imagine we can probably find another way to make that happen. Either way, if you're reading this because your code just broke, and you are relying on the current subclassing behaviour, then please open an issue on jaxtyping.
13eab3e to
37e0094
Compare
Haven't found any notable issues so far. And checking it against most of my code bases doesn't reveal any problems introduced by this PR :) |
…this but it's not important!
|
Awesome! Thanks for your help -- merged! |
This has been a subtle point that gets pretty tricky as plenty of classes aren't really designed to be subclassed further, and some may even take steps to ensure this isn't the case (e.g. concrete Equinox modules, or MLX arrays).
I think the only use-case for this is dispatch using plum -- I imagine we can probably find another way to make that happen.
Either way, if you're reading this because your code just broke, and you are relying on the current subclassing behaviour, then please open an issue on jaxtyping.