ReadingClouds / Subfilter

python code to compute sub-filter quantities from MONC output.
0 stars 1 forks source link

numpy.int depreciation #29

Open SheriffOfRobinhood opened 1 month ago

SheriffOfRobinhood commented 1 month ago

In subfilter/spectra.py, line 534, in spectrum_ave_1D_radial

Nmax = np.int(np.ceil(np.sqrt(2)*np.max((nx/2,ny/2))))  # maximum number of points 

This had been depreciated of using numpy.int instead of numpy.int64 or numpy.int64... etc.

On Jasmin JASPY this had simply returned an error:

AttributeError: module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information. 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. Did you mean: 'inf'?

trjr commented 1 month ago

When this was written, np.int was valid for the development environment.

As the error suggests, use int by itself as a replacement. This will be fine.