Skip to content

Commit 27d575c

Browse files
author
Release Manager
committed
gh-34994: fix doctests to support numpy 1.24 Taken from #34816. This is necessary when system numpy is 1.24, and a prerequiste to update numpy in sagemath. It's probably safer at this time to merge this and leave the update for next release. Testing: void-linux/void-packages#42048 Depends on #35015 URL: #34994 Reported by: Gonzalo Tornaría Reviewer(s): Matthias Köppe, Volker Braun
2 parents 6de4b9f + 0195760 commit 27d575c

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

src/sage/misc/persist.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def load(*filename, compress=True, verbose=True, **kwargs):
157157
....: _ = f.write(code)
158158
sage: load(t)
159159
sage: hello
160-
<fortran object>
160+
<fortran ...>
161161
"""
162162
import sage.repl.load
163163
if len(filename) != 1:

src/sage/plot/complex_plot.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ def complex_to_rgb(z_values, contoured=False, tiled=False,
461461
rgb[i, j, 2] = b
462462

463463
sig_off()
464+
nan_indices = np.isnan(rgb).any(-1) # Mask for undefined points
465+
rgb[nan_indices] = 1 # Make nan_indices white
464466
return rgb
465467

466468

src/sage/plot/histogram.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@ def get_minmax_data(self):
8787
8888
TESTS::
8989
90-
sage: h = histogram([10,3,5], normed=True)[0]
91-
doctest:warning...:
92-
DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
93-
See https://github.com/sagemath/sage/issues/25260 for details.
90+
sage: h = histogram([10,3,5], density=True)[0]
9491
sage: h.get_minmax_data()
95-
doctest:warning ...
96-
...VisibleDeprecationWarning: Passing `normed=True` on non-uniform bins has always been broken, and computes neither the probability density function nor the probability mass function. The result is only correct if the bins are uniform, when density=True will produce the same result anyway. The argument will be removed in a future version of numpy.
9792
{'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
9893
"""
9994
import numpy

src/sage/repl/ipython_extension.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def fortran(self, line, cell):
405405
....: C END FILE FIB1.F
406406
....: ''')
407407
sage: fib
408-
<fortran object>
408+
<fortran ...>
409409
sage: from numpy import array
410410
sage: a = array(range(10), dtype=float)
411411
sage: fib(a, 10)

0 commit comments

Comments
 (0)