bempp/bempp-cl

np.find_common_type

Closed this issue · 2 comments

ymei commented

When running the 1st tutorial, I encountered the following error. It appears that the code needs some modernization to keep up with numpy.

bempp/api/assembly/discrete_boundary_operator.py", line 108, in __init__
    dtype = _np.find_common_type([op1.dtype, op2.dtype], [])
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`.. Did you mean: 'common_type'?
ymei commented

I believe this line should be changed to dtype = _np.common_type(op1, op2)

I think this is fixed in the 0.3.2 release. Please reopen this if not!