arogozhnikov / hep_ml

Machine Learning for High Energy Physics.
https://arogozhnikov.github.io/hep_ml/
Other
176 stars 64 forks source link

replace np.float with float, fix deprecation warning #75

Closed ahill187 closed 2 years ago

ahill187 commented 2 years ago

Description

In Numpy 1.20, numpy.float is deprecated, and should be replaced with float:

Numpy 1.20.0 Deprecations

Currently, this warning is being thrown:

hep_ml/commonutils.py:281: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. 
To silence this warning, 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.
Deprecated in NumPy 1.20; for more details and guidance: 
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  sample_weight = numpy.array(sample_weight, dtype=numpy.float)
arogozhnikov commented 2 years ago

Merged, thanks Ainsleigh!