jonathf / chaospy

Chaospy - Toolbox for performing uncertainty quantification.
https://chaospy.readthedocs.io/
MIT License
445 stars 87 forks source link

Replace `np.asfarray` #425

Closed gboehl closed 4 months ago

gboehl commented 4 months ago

numpy's asfarray is also depreciated since 2.0 in favor of asarray. I just replaced all occurences and now it seems as if the package is numpy 2.0 compatible.

jonathf commented 4 months ago

Thank you for taking the time to apply this patch. Chaospy should have compatability with numpy 2.0.

asarray(x) is not a one-to-one replacement with asfarray(x). You need to add asarray(x, dtype=float). Looks like the first two will easily be fixed with proper casting. LIkely the third failure as well.

gboehl commented 4 months ago

Yes. I admit this was a cheap shot of just using recursive find & replace and hoping it would also work outside my narrow scope of application. Luckily your CI works well ;-)