aaryapatil / tapify

Multitaper spectrum for time-series analysis
https://tapify.readthedocs.io/
MIT License
12 stars 1 forks source link

Numpy version #11

Open 8legfishy opened 2 weeks ago

8legfishy commented 2 weeks ago

Hi Aarya,

As I am trying to run typify using numpy 2.1 the following message pops out. For the time being I am using an older version of numpy to resolve this issue.

File ~/miniconda3/envs/humpback/lib/python3.12/site-packages/tapify-0.1-py3.12.egg/tapify/tapify.py:354, in MultiTaper.periodogram(self, center_data, method, N_padded, nyquist_factor, freq, adaptive_weighting, maxiter, ftest, jackknife, plot, alpha) 352 freq = fftfreq(self.N_padded, self.delta_t) 353 # Eigenspectra --> 354 speck = np.zeros(shape=(self.K, len(freq)), dtype=np.complex) 356 # Positive frequencies 357 freq = freq[:self.N_padded//2]

File ~/miniconda3/envs/humpback/lib/python3.12/site-packages/numpy/init.py:400, in getattr(attr) 397 raise AttributeError(former_attrs[attr], name=None) 399 if attr in expired_attributes: --> 400 raise AttributeError( 401 f"np.{attr} was removed in the NumPy 2.0 release. " 402 f"{__expired_attributes__[attr]}", 403 name=None 404 ) 406 if attr == "chararray": 407 warnings.warn( 408 "np.chararray is deprecated and will be removed from " 409 "the main namespace in the future. Use an array with a string " 410 "or bytes dtype instead.", DeprecationWarning, stacklevel=2)

AttributeError: np.complex_ was removed in the NumPy 2.0 release. Use np.complex128 instead.

aaryapatil commented 2 weeks ago

Thank you @8legfishy for catching and reporting this! From what I see, it should be a simple fix (replacing np.complex128 with np.complex128 and I will resolve it soon.

Feel free to submit a PR if you would like to contribute at any point!