Conversation
|
I stumbled on gh-216 where it was discussed that it may be good to do a major version for such a change. But also, if we do the So I guess we have two options: punt on it for now and use anything, or actually modify the type code. Honestly, I suspect the only reason why we need this at all is the hashing. I hope there isn't any other legacy cruft in NumPy left other than that. We could also change the hash for user-dtypes to be computed differently (e.g. via (Since we can rely on there being a custom |
I would love to make |
|
Pinging @hawkinsp – we need to think about this one. |
|
Yes. I think this is case where there are no good options because the idea of statically allocated type codes doesn't work that well. I have no strong objection to changing it, but no reliable way to tell who it might break. One thing we can do is run our various test suites on that change and it might turn something up, but that's only weak evidence that it is safe. Under NumPy 2's custom type API, do we still have to assign a type code? If not, then I wonder if it would be more conservative to: i.e., don't break anyone existing, and do something that will fix the problem comprehensively. |
|
OK, sounds like we lean towards just punting and not changing things for now. The There are two reasons why type-codes currently kinda matter:
Long term, I suspect we should at some point just break users. That is for The problem with |
|
OK then @seberg let's revert the type code changes for now and merge the doc updates.
I think this is still a good idea given that there is really no better alternative. @hawkinsp how would this work? If we draft a PR in this repo, would it be possible to trigger some form of automation and run it through the test suites? In any case, sounds like regardless of using NumPy 2 dtype APIs or not this is always a breaking change. Can we discuss a rough plan (version number, timeline, possible mitigations, ...) for how this could be executed? |
I've tried porting this code to NumPy 2's APIs a couple of times, although I got stuck on NumPy bugs each time because the dtype APIs are relatively new. The time might be ripe for another attempt, particularly if someone is able to review the results. I can dredge up my last attempt. |
4cc63bf to
d86817f
Compare
|
Sorry, at some point I was staring at it and had no ideas for characters and gave up... In the end it doesn't matter it is not
If you can even just put up a silly branch, I can have a look. I think most holes were stuffed (because you can just set the original functions). If there is still something where that doesn't work, we can probably also monkey-patch things (i.e. to "backport" fixes we do in NumPy). |
This is hilarious lol |
|
Here, I AI-slopped my way to a numpy 2 version: #360 (Not for submission, but it may give us a path forward with some work.) |
This may be more for discussion. If we want unique type characters things are just annoying. Not that type characters matter much so long that we don't collide with NumPy's. (The truth is, there is no good choice, beyond just setting it `\0` some time and maybe defaulting in NumPy to return something else then -- or doing it here via the new API.)
This may be more for discussion. If we want unique type characters things are just annoying. Not that type characters matter much so long that we don't collide with NumPy's.
This is a suggestion to change
Eto mean complex32 to follow the NumPy pattern on this one, but that means changing bfloat16 to something else, right nowr(and bcomplex32R).(The truth is, there is no good choice, beyond just setting it
\0some time and maybe defaulting in NumPy to return something else then -- or doing it here via the new API.)