Closed alexfikl closed 1 month ago
Thanks for the PR ! I've not yet had time to spend on numpy 2, so this is very welcome.
Regarding random.uniform
, would it not be more straightforward to replace np.random.uniform
by np.random.Generator.uniform
?
What backend(s) did you test this with ?
Regarding
random.uniform
, would it not be more straightforward to replacenp.random.uniform
bynp.random.Generator.uniform
?
That's what 9dc7e12 does. But you need to instantiate a generator first, so it just does np.random.default_rng()
to get one.
What backend(s) did you test this with ?
I only have pyopencl
installed and ran python -m pytest -v -s pyvkfft
to go through the tests. I haven't tested with pycuda
or cupy
(or other backends).
For context, I attempted running the test suite from https://github.com/inducer/sumpy with numpy 2.0 and it failed due to np.alltrue
being removed in pyvkfft
. It seems to work now, but it probably uses just a small chunk of pyvkfft
, so it's not a thorough test.
Thanks ! I'll try to test this more closely next week.
I'm not sure this is all there is to fix, but it seems to work for me: the project builds and the tests run (haven't ran all of them, I think).
The main changes are:
np.alltrue
withnp.all
:np.alltrue
was deprecated in 1.25 and removed in numpy 2.0np.random.uniform
withGenenerator.uniform
: these are not removed, but numpy heavily recommends using theGenerator
interface these days.