scaleogram icon indicating copy to clipboard operation
scaleogram copied to clipboard

np.int is deprecated

Open GravitationalWaveSurfer opened this issue 2 years ago • 1 comments

Hi, just to let you know that when computing the CWT I found the following issue in scaleogram/wfun.py , which is due to the fact that numpy.int is deprecated.

File ~/.local/lib/python3.11/site-packages/scaleogram/wfun.py:188, in fastcwt..(s) 182 int_psi, x = pywt.integrate_wavelet(wavelet, precision=precision) 184 if method in ('auto', 'fft'): 185 # - to be as large as the sum of data length and and maximum wavelet 186 # support to avoid circular convolution effects 187 # - additional padding to reach a power of 2 for CPU-optimal FFT --> 188 size_pad = lambda s: 2**np.int(np.ceil(np.log2(s[0] + s[1]))) 189 size_scale0 = size_pad( (len(data), 190 np.take(scales, 0) * ((x[-1] - x[0]) + 1)) ) 191 fft_data = None

File /data01/shared/EnvPy3.11/lib/python3.11/site-packages/numpy/init.py:284, in getattr(attr) 281 from .testing import Tester 282 return Tester --> 284 raise AttributeError("module {!r} has no attribute " 285 "{!r}".format(name, attr))

AttributeError: module 'numpy' has no attribute 'int'

GravitationalWaveSurfer avatar Feb 16 '23 16:02 GravitationalWaveSurfer

I actually fixed that issue a while ago, and offered it as a PR to the library author (@alsauve) in January. It doesn't seem like it's going to be merged anytime soon, though.

If it bothers you, you can build the fixed version from the PR branch here: https://github.com/EricCreusen/scaleogram

EricCreusen avatar Jun 13 '23 12:06 EricCreusen