From 78fee0af4a0ab42b6afff5df72d474154f0cd93d Mon Sep 17 00:00:00 2001 From: Antonio Rojas Date: Sun, 21 Jan 2024 14:22:01 +0100 Subject: [PATCH] Drop usage of scipy aliases for numpy functions removed in 1.12 --- src/sage/matrix/matrix_double_dense.pyx | 2 +- src/sage/numerical/optimize.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx index 5d19067f2ed..97e50fb2616 100644 --- a/src/sage/matrix/matrix_double_dense.pyx +++ b/src/sage/matrix/matrix_double_dense.pyx @@ -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 diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py index 708d440a205..9f973c6bd69 100644 --- a/src/sage/numerical/optimize.py +++ b/src/sage/numerical/optimize.py @@ -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)