You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
numpy._core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('int64') with casting rule 'same_kind' #300
A bug seems happened in the pykrige/core.py, with numpy 2.1.3,
Given the following output:
Traceback (most recent call last):
File "/usr/src/matrix-tests/./matrix2.py", line 52, in <module>
values_pred = OK.execute('points', x_266, y_266)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pykrige/ok.py", line 880, in execute
xpts, ypts = _adjust_for_anisotropy(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/pykrige/core.py", line 145, in _adjust_for_anisotropy
X -= center
numpy._core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('int64') with casting rule 'same_kind'
A fast fix would be adding this line
X = X.astype('float64')
before the line
X -= center
in file pykrige/core.py .
(I'm not sure whether that fix will cause any side effects, though. And I'm hoping for official fixes.)