galario icon indicating copy to clipboard operation
galario copied to clipboard

Fix numpy warnings

Open mtazzari opened this issue 4 years ago • 0 comments

Fix these numpy warnings raised when building galario e.g. here https://github.com/mtazzari/galario/runs/2041093596

  /home/runner/work/galario/galario/build/python/utils.py:220: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    rmax = min(np.int(np.ceil((Rmin+nrad*dR)/dxy)), irow_center)

python/test_galario.py: 1264 warnings
  /home/runner/work/galario/galario/build/python/utils.py:230: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    iR = np.int(np.floor((rr-Rmin) / dR))

python/test_galario.py: 157200 warnings
  /home/runner/work/galario/galario/build/python/utils.py:397: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    y0 = f[np.int(np.floor(y[i])), np.int(np.floor(x[i]))]

python/test_galario.py: 157200 warnings
  /home/runner/work/galario/galario/build/python/utils.py:398: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    y1 = f[np.int(np.floor(y[i])) + 1, np.int(np.floor(x[i]))]

python/test_galario.py: 157200 warnings
  /home/runner/work/galario/galario/build/python/utils.py:399: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    y2 = f[np.int(np.floor(y[i])) + 1, np.int(np.floor(x[i])) + 1]

python/test_galario.py: 157200 warnings
  /home/runner/work/galario/galario/build/python/utils.py:400: DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`. To silence this warning, 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.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
    y3 = f[np.int(np.floor(y[i])), np.int(np.floor(x[i])) + 1]

mtazzari avatar Mar 05 '21 16:03 mtazzari