Describe the bug
AttributeError: np.find_common_type was removed in the NumPy 2.0 release. Use numpy.promote_types or numpy.result_type instead. To achieve semantics for the scalar_types argument, use numpy.result_type and pass the Python values 0, 0.0, or 0j.
To Reproduce
Go to EMD.py, find the _common_dtype method and replace it with the following code:
@staticmethod
def _common_dtype(x: np.ndarray, y: np.ndarray) -> Tuple[np.ndarray, np.ndarray]:
"""Casts inputs (x, y) into a common numpy DTYPE."""
dtype = np.promote_types(x.dtype, y.dtype)
if x.dtype != dtype:
x = x.astype(dtype)
if y.dtype != dtype:
y = y.astype(dtype)
return x, y
Describe the bug AttributeError:
np.find_common_type
was removed in the NumPy 2.0 release. Usenumpy.promote_types
ornumpy.result_type
instead. To achieve semantics for thescalar_types
argument, usenumpy.result_type
and pass the Python values0
,0.0
, or0j
.To Reproduce Go to EMD.py, find the
_common_dtype
method and replace it with the following code: