chore: port to numpy 2.0
fixes issue #56
@ohrechykha - looks good! There are two more issues left. You can check them by clicking on "Details". One is the lower bound testing (issue #61). It should be fixed in a separate PR, I think. And another is related to the differences in Numpy versions (asarray) that should be fixed in this PR.
I'm unsure what's wrong: the idea was that defining _wrapper in floor and ceil functions is unnecessary (because I defined it in ceil but forgot to add it to floor and nothing happened). After seeing the failures I've concluded this was wrong and returned them. The ubuntu tests still fail with the same errors, while on Windows I haven't gotten any errors regardless of whether there's a wrapper function in ceil and floor, meaning it could likely be removed.
I'm unsure what's wrong: the idea was that defining _wrapper in floor and ceil functions is unnecessary (because I defined it in ceil but forgot to add it to floor and nothing happened). After seeing the failures I've concluded this was wrong and returned them. The ubuntu tests still fail with the same errors, while on Windows I haven't gotten any errors regardless of whether there's a wrapper function in ceil and floor, meaning it could likely be removed.
The tests in the CI pass :-)
Oh well. I've made it work for numpy 1.22.3, while git is testing it on 1.22.0...
Edit: nevermind this still fails at 1.22.0
is numpy 1.22 a version you intend on supporting? Numpy recommends not supporting lower than 1.24 in june of 2024.
https://numpy.org/neps/nep-0029-deprecation_policy.html#support-table
Just trying to help make these chores easier!
NumPy 1.22 was chosen as a minimum for Awkward Array, based on functionality. (Something was added in NumPy 1.22 that Awkward requires; no tighter requirements were needed after that.) We can get on the train of always-moving dependency windows, but we just haven't yet.
If ragged needs something that NumPy 1.22 doesn't provide—that is, if it works in a later version of NumPy but not 1.22—then let's just increase the minimum NumPy version as needed, especially since it agrees with NumPy's own schedule of support.
In principle, we should be moving our version constraints according to the SPEC 0 schedule; we just haven't started that yet.
@jpivarski and @ohrechykha - it looks like Numpy 2.1.0 went back to return the same dtype as its elements dtype.
@jpivarski - Please, review when you have time. Thanks!