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
  • Loading branch information
Release Manager committed Jan 22, 2024
2 parents a02a853 + 78fee0a commit fb8288a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=c72fc2006b1702e74f38c480b0376e3e6c8a5758
md5=a650e8682fe75708f679eabe918d2aa7
cksum=785462498
sha1=2bf5e4bf33fcce861e98f56e2ba9c57875fe4dd7
md5=6f65977d0d08ccb43882d1919f27eccc
cksum=2448204001
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
919b021b0c103e4fb798cc784218015e0a515510
817c07e28973af8efde0ceb6aaffcb5ce62ce0f4
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 fb8288a

Please sign in to comment.