h2020charisma / ramanchada2

A library for Raman spectroscopy harmonization
https://h2020charisma.github.io/ramanchada2/
MIT License
4 stars 3 forks source link

check numpy 2.0 compatibility #126

Closed vedina closed 2 months ago

vedina commented 3 months ago

AttributeError: np.infty was removed in the NumPy 2.0 release. Use np.inf instead.

in

 ramanchada2\spectrum\calc\central_moments.py", line 11, in <module>
    boundaries=(-np.infty, np.infty), moments=[1, 2, 3, 4], normalize=False

could be other issues as well https://numpy.org/devdocs/release/2.0.0-notes.html

quick update could be to fix the numpy version to the latest before 2.0 (1.26.4) @kerberizer

georgievgeorgi commented 3 months ago

The substitution of numpy.infty to numpy.inf was straightforward. After this substitution all tests went OK. There is different behavior on the random generator states which i didn't find in the provided document. The random generator states provide ability to chain multiple filters that use random numbers, for example add_baseline and add_gaussian_noise.