Skip to content

Commit 90ece16

Browse files
author
Release Manager
committed
gh-35842: Fix tests with scipy 1.11 Fix some test failures with `scipy 1.11` - Cast to float before calling `scipy.optimize.brentq`, which now performs a NaN check that chokes on symbolic expressions. - Some `Ttest_indResult` are now `TtestResult` There are two more failures in `sage/matrix/matrix_double_dense.pyx` and `sage/matrix/matrix_space.py` caused by an upstream issue, reported at scipy/scipy#18759 URL: #35842 Reported by: Antonio Rojas Reviewer(s): Dima Pasechnik
2 parents 0796e69 + 064e157 commit 90ece16

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/doc/en/faq/faq-usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ ints. For example::
322322
sage: RealNumber = float; Integer = int
323323
sage: from scipy import stats
324324
sage: stats.ttest_ind([1,2,3,4,5], [2,3,4,5,.6])
325-
Ttest_indResult(statistic=0.0767529..., pvalue=0.940704...)
325+
Ttest...Result(statistic=0.0767529..., pvalue=0.940704...)
326326
sage: stats.uniform(0,15).ppf([0.5,0.7])
327327
array([ 7.5, 10.5])
328328

src/doc/it/faq/faq-usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ anziché Integer di Sage. Ad esempio::
304304
sage: RealNumber = float; Integer = int
305305
sage: from scipy import stats
306306
sage: stats.ttest_ind([1,2,3,4,5], [2,3,4,5,.6])
307-
Ttest_indResult(statistic=0.0767529..., pvalue=0.940704...)
307+
Ttest...Result(statistic=0.0767529..., pvalue=0.940704...)
308308
sage: stats.uniform(0,15).ppf([0.5,0.7])
309309
array([ 7.5, 10.5])
310310

src/sage/numerical/optimize.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
155155
b = max(s_1, s_2)
156156

157157
import scipy.optimize
158-
brentqRes = scipy.optimize.brentq(f, a, b,
158+
g = lambda x: float(f(x))
159+
brentqRes = scipy.optimize.brentq(g, a, b,
159160
full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
160161
# A check following :trac:`4942`, to ensure we actually found a root
161162
# Maybe should use a different tolerance here?

0 commit comments

Comments
 (0)