New casting rule problem in proven code : TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

73 views
Skip to first unread message

Bertrand Cayzac

unread,
Nov 23, 2019, 10:40:44 PM11/23/19
to sage-support
Hello,

My code worked happlily each time I launched it in SageMathCell until recently. It now exits with the  error below in scipy.optimize.newton while I didn't make any change; 

Last lines of the trace : 
/home/sc_serv/sage/local/lib/python2.7/site-packages/numpy/core/numeric.pyc in isclose(a, b, rtol, atol, equal_nan)
   2519     y = array(y, dtype=dt, copy=False, subok=True)
   2520 
-> 2521     xfin = isfinite(x)
   2522     yfin = isfinite(y)
   2523     if all(xfin) and all(yfin):

TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''


The curent versions in SageMathCell are the following (I don't know what they used to be when the code was working)
Python : 2.7.15 (default, Oct  6 2019, 03:20:16) [GCC 7.4.0]
Numpy : 1.16.1
Scipy : 1.2.0

I gathered that the casting rules have changed but it seems that ufunc doesn't take a "casting" argument in version 1.16 and I can't seem to fin a way to override
the safe rule. I don't know how to import or install a different version in a cell. 
Any idea? 

Thanks and regards,
Bertrand Cayzac bnhmc...@gmail.com


Reply all
Reply to author
Forward
0 new messages