Skip to content

Commit

Permalink
sagemathgh-37123: Compatibility with scipy 1.12
Browse files Browse the repository at this point in the history
    
Drop usage of some numpy function aliases which are no longer provided
in 1.12
    
URL: sagemath#37123
Reported by: Antonio Rojas
Reviewer(s): François Bissey, Gonzalo Tornaría
  • Loading branch information
Release Manager committed Jan 24, 2024
2 parents 0709d70 + 78fee0a commit 54eec46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sage/matrix/matrix_double_dense.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ cdef class Matrix_double_dense(Matrix_numpy_dense):
# set cutoff as RDF element
if eps == 'auto':
if scipy is None: import scipy
eps = 2*max(self._nrows, self._ncols)*scipy.finfo(float).eps*sv[0]
eps = 2*max(self._nrows, self._ncols)*numpy.finfo(float).eps*sv[0]
eps = RDF(eps)
# locate non-zero entries
rank = 0
Expand Down
2 changes: 1 addition & 1 deletion src/sage/numerical/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
hess = func.hessian()
hess_fast = [ [fast_callable(a, vars=var_names, domain=float) for a in row] for row in hess]
hessian = lambda p: [[a(*p) for a in row] for row in hess_fast]
from scipy import dot
from numpy import dot
hessian_p = lambda p,v: dot(numpy.array(hessian(p)),v)
min = optimize.fmin_ncg(f, [float(_) for _ in x0], fprime=gradient,
fhess=hessian, fhess_p=hessian_p, disp=verbose, **args)
Expand Down

0 comments on commit 54eec46

Please sign in to comment.