smeerten / ssnake

A program for the analysis of NMR data.
Other
19 stars 15 forks source link

Cannot save with latest numpy due to long deprecated feature now being removed #145

Open Famlam opened 1 year ago

Famlam commented 1 year ago
Traceback (most recent call last): 
File "\src\ssNake.py", line 1566, in saveJSONFile self.mainWindow.get_mainWindow().saveJSONFile() 
File "\src\ssNake.py", line 1785, in saveJSONFile io.saveJSONFile(name, self.masterData) 
File "\src\specIO.py", line 749, in saveJSONFile struct['ref'] = np.array(spectrum.ref, dtype=np.float).tolist() ^^^^^^^^ 
File "\Python\Python311\Lib\site-packages\numpy\__init__.py", line 305, in __getattr__ raise AttributeError(__former_attrs__[attr]) 
AttributeError: module 'numpy' has no attribute 'float'. `np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations 

While saving a file as JSON or Matlab. Numpy 1.24.2