git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #51039 from timokau/sage-8.5

sage: 8.4 -> 8.5

commit7abdacc4f2bef09629b86d2c7023d3b685a96aa5 authorTimo Kaufmann <timokau@zoho.com> dateSat 29 Dec 2018, 16:15 (8 years ago) parent1438b2f22c16ed
7 files changed+30−953
pkgs/applications/science/math/sage/default.nix+1−14 pkgs/applications/science/math/sage/patches/dont-test-guess-gaproot.patch+13 pkgs/applications/science/math/sage/patches/numpy-1.15.1.patch−911 pkgs/applications/science/math/sage/sage-env.nix+1 pkgs/applications/science/math/sage/sage-src.nix+5−25 pkgs/applications/science/math/sage/sage-tests.nix+9−3 pkgs/applications/science/math/sage/sage.nix+1
pkgs/applications/science/math/sage/default.nix+1−14
@@ -70,7 +70,7 @@ let
7070 sage-env = callPackage ./sage-env.nix {
7171 sagelib = python.pkgs.sagelib;
7272 inherit env-locations;
73− inherit python rWrapper ecl singular palp flint pynac pythonEnv;
73+ inherit python ecl singular palp flint pynac pythonEnv;
7474 pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig
7575 };
7676
@@ -124,19 +124,6 @@ let
124124 ignoreCollisions = true;
125125 } // { extraLibs = pythonRuntimeDeps; }; # make the libs accessible
126126
127− # needs to be rWrapper, standard "R" doesn't include default packages
128− rWrapper = pkgs.rWrapper.override {
129− # https://trac.sagemath.org/ticket/25674
130− R = pkgs.R.overrideAttrs (attrs: rec {
131− name = "R-3.4.4";
132− doCheck = false;
133− src = fetchurl {
134− url = "http://cran.r-project.org/src/base/R-3/${name}.tar.gz";
135− sha256 = "0dq3jsnwsb5j3fhl0wi3p5ycv8avf8s5j1y4ap3d2mkjmcppvsdk";
136− };
137− });
138− };
139−
140127 arb = pkgs.arb.override { inherit flint; };
141128
142129 singular = pkgs.singular.override { inherit flint; };
pkgs/applications/science/math/sage/patches/dont-test-guess-gaproot.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/src/sage/libs/gap/util.pyx b/src/sage/libs/gap/util.pyx
2+index 5ff67107c1..1318df86fd 100644
3+--- a/src/sage/libs/gap/util.pyx
4++++ b/src/sage/libs/gap/util.pyx
5+@@ -165,7 +165,7 @@ def _guess_gap_root():
6+ EXAMPLES::
7+
8+ sage: from sage.libs.gap.util import _guess_gap_root
9+- sage: _guess_gap_root()
10++ sage: _guess_gap_root() # not tested (not necessary on nixos)
11+ The gap-4.5.5.spkg (or later) seems to be not installed!
12+ ...
13+ """
pkgs/applications/science/math/sage/patches/numpy-1.15.1.patchdeleted−911
@@ -1,911 +0,0 @@
1−diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst
2−index 2347a1190d..f5b0fe71a4 100644
3−--- a/src/doc/en/faq/faq-usage.rst
4−+++ b/src/doc/en/faq/faq-usage.rst
5−@@ -338,7 +338,7 @@ ints. For example::
6− sage: RealNumber = float; Integer = int
7− sage: from scipy import stats
8− sage: stats.ttest_ind(list([1,2,3,4,5]),list([2,3,4,5,.6]))
9−- Ttest_indResult(statistic=0.076752955645333687, pvalue=0.94070490247380478)
10−+ Ttest_indResult(statistic=0.0767529..., pvalue=0.940704...)
11− sage: stats.uniform(0,15).ppf([0.5,0.7])
12− array([ 7.5, 10.5])
13−
14−diff --git a/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst b/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
15−index 314811c42b..e5f54ec4c2 100644
16−--- a/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
17−+++ b/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
18−@@ -48,11 +48,13 @@ we could do the following.
19− sage: B = numpy.array([1.0]*5)
20− sage: B.shape=(5,1)
21− sage: print(B)
22−- [[ 1.]
23−- [ 1.]
24−- [ 1.]
25−- [ 1.]
26−- [ 1.]]
27−+ [[1.]
28−+ [1.]
29−+ [1.]
30−+ [1.]
31−+ [1.]]
32−+
33−+
34− sage: print(A)
35− [ 2.00e+00 3.00e+00 0 0 0 ]
36− [ 3.00e+00 0 4.00e+00 0 6.00e+00]
37−diff --git a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
38−index 5b89cd75ee..e50b2ea5d4 100644
39−--- a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
40−+++ b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
41−@@ -84,7 +84,7 @@ well as take slices
42− sage: l[3]
43− 3.0
44− sage: l[3:6]
45−- array([ 3., 4., 5.])
46−+ array([3., 4., 5.])
47−
48− You can do basic arithmetic operations
49−
50−@@ -147,11 +147,11 @@ also do matrix vector multiplication, and matrix addition
51− sage: n = numpy.matrix([[1,2],[3,4]],dtype=float)
52− sage: v = numpy.array([[1],[2]],dtype=float)
53− sage: n*v
54−- matrix([[ 5.],
55−- [ 11.]])
56−+ matrix([[ 5.],
57−+ [11.]])
58− sage: n+n
59−- matrix([[ 2., 4.],
60−- [ 6., 8.]])
61−+ matrix([[2., 4.],
62−+ [6., 8.]])
63−
64− If ``n`` was created with :meth:`numpy.array`, then to do matrix vector
65− multiplication, you would use ``numpy.dot(n,v)``.
66−@@ -170,11 +170,11 @@ to manipulate
67− 22., 23., 24.])
68− sage: n.shape=(5,5)
69− sage: n
70−- array([[ 0., 1., 2., 3., 4.],
71−- [ 5., 6., 7., 8., 9.],
72−- [ 10., 11., 12., 13., 14.],
73−- [ 15., 16., 17., 18., 19.],
74−- [ 20., 21., 22., 23., 24.]])
75−+ array([[ 0., 1., 2., 3., 4.],
76−+ [ 5., 6., 7., 8., 9.],
77−+ [10., 11., 12., 13., 14.],
78−+ [15., 16., 17., 18., 19.],
79−+ [20., 21., 22., 23., 24.]])
80−
81− This changes the one-dimensional array into a `5\times 5` array.
82−
83−@@ -187,8 +187,8 @@ NumPy arrays can be sliced as well
84− sage: n=numpy.array(range(25),dtype=float)
85− sage: n.shape=(5,5)
86− sage: n[2:4,1:3]
87−- array([[ 11., 12.],
88−- [ 16., 17.]])
89−+ array([[11., 12.],
90−+ [16., 17.]])
91−
92− It is important to note that the sliced matrices are references to
93− the original
94−@@ -224,8 +224,8 @@ Some particularly useful commands are
95−
96− sage: x=numpy.arange(0,2,.1,dtype=float)
97− sage: x
98−- array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ,
99−- 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])
100−+ array([0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2,
101−+ 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])
102−
103− You can see that :meth:`numpy.arange` creates an array of floats increasing by 0.1
104− from 0 to 2. There is a useful command :meth:`numpy.r_` that is best explained by example
105−@@ -240,10 +240,11 @@ from 0 to 2. There is a useful command :meth:`numpy.r_` that is best explained b
106− sage: Integer=int
107− sage: n=r_[0.0:5.0]
108− sage: n
109−- array([ 0., 1., 2., 3., 4.])
110−+ array([0., 1., 2., 3., 4.])
111− sage: n=r_[0.0:5.0, [0.0]*5]
112− sage: n
113−- array([ 0., 1., 2., 3., 4., 0., 0., 0., 0., 0.])
114−+ array([0., 1., 2., 3., 4., 0., 0., 0., 0., 0.])
115−+
116−
117− :meth:`numpy.r_` provides a shorthand for constructing NumPy arrays efficiently.
118− Note in the above ``0.0:5.0`` was shorthand for ``0.0, 1.0, 2.0, 3.0, 4.0``.
119−@@ -255,7 +256,7 @@ intervals. We can do this as follows
120− ::
121−
122− sage: r_[0.0:5.0:11*j]
123−- array([ 0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ])
124−+ array([0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ])
125−
126− The notation ``0.0:5.0:11*j`` expands to a list of 11 equally space
127− points between 0 and 5 including both endpoints. Note that ``j`` is the
128−@@ -287,23 +288,23 @@ an equally spaced grid with `\Delta x = \Delta y = .25` for
129− sage: y=numpy.r_[0.0:1.0:5*j]
130− sage: xx,yy= meshgrid(x,y)
131− sage: xx
132−- array([[ 0. , 0.25, 0.5 , 0.75, 1. ],
133−- [ 0. , 0.25, 0.5 , 0.75, 1. ],
134−- [ 0. , 0.25, 0.5 , 0.75, 1. ],
135−- [ 0. , 0.25, 0.5 , 0.75, 1. ],
136−- [ 0. , 0.25, 0.5 , 0.75, 1. ]])
137−+ array([[0. , 0.25, 0.5 , 0.75, 1. ],
138−+ [0. , 0.25, 0.5 , 0.75, 1. ],
139−+ [0. , 0.25, 0.5 , 0.75, 1. ],
140−+ [0. , 0.25, 0.5 , 0.75, 1. ],
141−+ [0. , 0.25, 0.5 , 0.75, 1. ]])
142− sage: yy
143−- array([[ 0. , 0. , 0. , 0. , 0. ],
144−- [ 0.25, 0.25, 0.25, 0.25, 0.25],
145−- [ 0.5 , 0.5 , 0.5 , 0.5 , 0.5 ],
146−- [ 0.75, 0.75, 0.75, 0.75, 0.75],
147−- [ 1. , 1. , 1. , 1. , 1. ]])
148−+ array([[0. , 0. , 0. , 0. , 0. ],
149−+ [0.25, 0.25, 0.25, 0.25, 0.25],
150−+ [0.5 , 0.5 , 0.5 , 0.5 , 0.5 ],
151−+ [0.75, 0.75, 0.75, 0.75, 0.75],
152−+ [1. , 1. , 1. , 1. , 1. ]])
153− sage: f(xx,yy)
154−- array([[ 0. , 0.0625, 0.25 , 0.5625, 1. ],
155−- [ 0.0625, 0.125 , 0.3125, 0.625 , 1.0625],
156−- [ 0.25 , 0.3125, 0.5 , 0.8125, 1.25 ],
157−- [ 0.5625, 0.625 , 0.8125, 1.125 , 1.5625],
158−- [ 1. , 1.0625, 1.25 , 1.5625, 2. ]])
159−+ array([[0. , 0.0625, 0.25 , 0.5625, 1. ],
160−+ [0.0625, 0.125 , 0.3125, 0.625 , 1.0625],
161−+ [0.25 , 0.3125, 0.5 , 0.8125, 1.25 ],
162−+ [0.5625, 0.625 , 0.8125, 1.125 , 1.5625],
163−+ [1. , 1.0625, 1.25 , 1.5625, 2. ]])
164−
165− You can see that :meth:`numpy.meshgrid` produces a pair of matrices, here denoted
166− `xx` and `yy`, such that `(xx[i,j],yy[i,j])` has coordinates
167−@@ -324,7 +325,7 @@ equation `Ax=b` do
168− sage: b=numpy.array(range(1,6))
169− sage: x=linalg.solve(A,b)
170− sage: numpy.dot(A,x)
171−- array([ 1., 2., 3., 4., 5.])
172−+ array([1., 2., 3., 4., 5.])
173−
174− This creates a random 5x5 matrix ``A``, and solves `Ax=b` where
175− ``b=[0.0,1.0,2.0,3.0,4.0]``. There are many other routines in the :mod:`numpy.linalg`
176−diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
177−index 60f37f7557..4ac3dedf1d 100644
178−--- a/src/sage/calculus/riemann.pyx
179−+++ b/src/sage/calculus/riemann.pyx
180−@@ -1191,30 +1191,30 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
181− sage: zval = numpy.array([[0, 1, 1000],[.2+.3j,1,-.3j],[0,0,0]],dtype = numpy.complex128)
182− sage: deriv = numpy.array([[.1]],dtype = numpy.float64)
183− sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,False,0.001)
184−- array([[[ 1., 1., 1.],
185−- [ 1., 1., 1.],
186−- [ 1., 1., 1.]],
187−+ array([[[1., 1., 1.],
188−+ [1., 1., 1.],
189−+ [1., 1., 1.]],
190− <BLANKLINE>
191−- [[ 1., 1., 1.],
192−- [ 0., 0., 0.],
193−- [ 1., 1., 1.]],
194−+ [[1., 1., 1.],
195−+ [0., 0., 0.],
196−+ [1., 1., 1.]],
197− <BLANKLINE>
198−- [[ 1., 1., 1.],
199−- [ 1., 1., 1.],
200−- [ 1., 1., 1.]]])
201−+ [[1., 1., 1.],
202−+ [1., 1., 1.],
203−+ [1., 1., 1.]]])
204−
205− sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,True,0.001)
206−- array([[[ 1. , 1. , 1. ],
207−- [ 1. , 0.05558355, 0.05558355],
208−- [ 0.17301243, 0. , 0. ]],
209−+ array([[[1. , 1. , 1. ],
210−+ [1. , 0.05558355, 0.05558355],
211−+ [0.17301243, 0. , 0. ]],
212− <BLANKLINE>
213−- [[ 1. , 0.96804683, 0.48044583],
214−- [ 0. , 0. , 0. ],
215−- [ 0.77351965, 0.5470393 , 1. ]],
216−+ [[1. , 0.96804683, 0.48044583],
217−+ [0. , 0. , 0. ],
218−+ [0.77351965, 0.5470393 , 1. ]],
219− <BLANKLINE>
220−- [[ 1. , 1. , 1. ],
221−- [ 1. , 1. , 1. ],
222−- [ 1. , 1. , 1. ]]])
223−+ [[1. , 1. , 1. ],
224−+ [1. , 1. , 1. ],
225−+ [1. , 1. , 1. ]]])
226− """
227− cdef Py_ssize_t i, j, imax, jmax
228− cdef FLOAT_T x, y, mag, arg, width, target, precision, dmag, darg
229−@@ -1279,14 +1279,14 @@ cpdef complex_to_rgb(np.ndarray[COMPLEX_T, ndim = 2] z_values):
230− sage: from sage.calculus.riemann import complex_to_rgb
231− sage: import numpy
232− sage: complex_to_rgb(numpy.array([[0, 1, 1000]], dtype = numpy.complex128))
233−- array([[[ 1. , 1. , 1. ],
234−- [ 1. , 0.05558355, 0.05558355],
235−- [ 0.17301243, 0. , 0. ]]])
236−+ array([[[1. , 1. , 1. ],
237−+ [1. , 0.05558355, 0.05558355],
238−+ [0.17301243, 0. , 0. ]]])
239−
240− sage: complex_to_rgb(numpy.array([[0, 1j, 1000j]], dtype = numpy.complex128))
241−- array([[[ 1. , 1. , 1. ],
242−- [ 0.52779177, 1. , 0.05558355],
243−- [ 0.08650622, 0.17301243, 0. ]]])
244−+ array([[[1. , 1. , 1. ],
245−+ [0.52779177, 1. , 0.05558355],
246−+ [0.08650622, 0.17301243, 0. ]]])
247−
248−
249− TESTS::
250−diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
251−index 0a9bd61267..d2193cc2d6 100644
252−--- a/src/sage/combinat/fully_packed_loop.py
253−+++ b/src/sage/combinat/fully_packed_loop.py
254−@@ -72,11 +72,11 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
255− sage: _make_color_list(5, ['blue', 'red'])
256− ['blue', 'red', 'blue', 'red', 'blue']
257− sage: _make_color_list(5, color_map='summer')
258−- [(0.0, 0.5, 0.40000000000000002),
259−- (0.25098039215686274, 0.62549019607843137, 0.40000000000000002),
260−- (0.50196078431372548, 0.75098039215686274, 0.40000000000000002),
261−- (0.75294117647058822, 0.87647058823529411, 0.40000000000000002),
262−- (1.0, 1.0, 0.40000000000000002)]
263−+ [(0.0, 0.5, 0.4),
264−+ (0.25098039215686274, 0.6254901960784314, 0.4),
265−+ (0.5019607843137255, 0.7509803921568627, 0.4),
266−+ (0.7529411764705882, 0.8764705882352941, 0.4),
267−+ (1.0, 1.0, 0.4)]
268− sage: _make_color_list(8, ['blue', 'red'], randomize=True)
269− ['blue', 'blue', 'red', 'blue', 'red', 'red', 'red', 'blue']
270− """
271−diff --git a/src/sage/finance/time_series.pyx b/src/sage/finance/time_series.pyx
272−index 28779365df..3ab0282861 100644
273−--- a/src/sage/finance/time_series.pyx
274−+++ b/src/sage/finance/time_series.pyx
275−@@ -111,8 +111,8 @@ cdef class TimeSeries:
276−
277− sage: import numpy
278− sage: v = numpy.array([[1,2], [3,4]], dtype=float); v
279−- array([[ 1., 2.],
280−- [ 3., 4.]])
281−+ array([[1., 2.],
282−+ [3., 4.]])
283− sage: finance.TimeSeries(v)
284− [1.0000, 2.0000, 3.0000, 4.0000]
285− sage: finance.TimeSeries(v[:,0])
286−@@ -2100,14 +2100,14 @@ cdef class TimeSeries:
287−
288− sage: w[0] = 20
289− sage: w
290−- array([ 20. , -3. , 4.5, -2. ])
291−+ array([20. , -3. , 4.5, -2. ])
292− sage: v
293− [20.0000, -3.0000, 4.5000, -2.0000]
294−
295− If you want a separate copy do not give the ``copy=False`` option. ::
296−
297− sage: z = v.numpy(); z
298−- array([ 20. , -3. , 4.5, -2. ])
299−+ array([20. , -3. , 4.5, -2. ])
300− sage: z[0] = -10
301− sage: v
302− [20.0000, -3.0000, 4.5000, -2.0000]
303−diff --git a/src/sage/functions/hyperbolic.py b/src/sage/functions/hyperbolic.py
304−index aff552f450..7a6df931e7 100644
305−--- a/src/sage/functions/hyperbolic.py
306−+++ b/src/sage/functions/hyperbolic.py
307−@@ -214,7 +214,7 @@ class Function_coth(GinacFunction):
308− sage: import numpy
309− sage: a = numpy.arange(2, 5)
310− sage: coth(a)
311−- array([ 1.03731472, 1.00496982, 1.00067115])
312−+ array([1.03731472, 1.00496982, 1.00067115])
313− """
314− return 1.0 / tanh(x)
315−
316−@@ -267,7 +267,7 @@ class Function_sech(GinacFunction):
317− sage: import numpy
318− sage: a = numpy.arange(2, 5)
319− sage: sech(a)
320−- array([ 0.26580223, 0.09932793, 0.03661899])
321−+ array([0.26580223, 0.09932793, 0.03661899])
322− """
323− return 1.0 / cosh(x)
324−
325−@@ -318,7 +318,7 @@ class Function_csch(GinacFunction):
326− sage: import numpy
327− sage: a = numpy.arange(2, 5)
328− sage: csch(a)
329−- array([ 0.27572056, 0.09982157, 0.03664357])
330−+ array([0.27572056, 0.09982157, 0.03664357])
331− """
332− return 1.0 / sinh(x)
333−
334−@@ -586,7 +586,7 @@ class Function_arccoth(GinacFunction):
335− sage: import numpy
336− sage: a = numpy.arange(2,5)
337− sage: acoth(a)
338−- array([ 0.54930614, 0.34657359, 0.25541281])
339−+ array([0.54930614, 0.34657359, 0.25541281])
340− """
341− return arctanh(1.0 / x)
342−
343−diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py
344−index ed6365bef4..99b8b04dad 100644
345−--- a/src/sage/functions/orthogonal_polys.py
346−+++ b/src/sage/functions/orthogonal_polys.py
347−@@ -810,12 +810,12 @@ class Func_chebyshev_T(ChebyshevFunction):
348− sage: z2 = numpy.array([[1,2],[1,2]])
349− sage: z3 = numpy.array([1,2,3.])
350− sage: chebyshev_T(1,z)
351−- array([ 1., 2.])
352−+ array([1., 2.])
353− sage: chebyshev_T(1,z2)
354−- array([[ 1., 2.],
355−- [ 1., 2.]])
356−+ array([[1., 2.],
357−+ [1., 2.]])
358− sage: chebyshev_T(1,z3)
359−- array([ 1., 2., 3.])
360−+ array([1., 2., 3.])
361− sage: chebyshev_T(z,0.1)
362− array([ 0.1 , -0.98])
363− """
364−@@ -1095,12 +1095,12 @@ class Func_chebyshev_U(ChebyshevFunction):
365− sage: z2 = numpy.array([[1,2],[1,2]])
366− sage: z3 = numpy.array([1,2,3.])
367− sage: chebyshev_U(1,z)
368−- array([ 2., 4.])
369−+ array([2., 4.])
370− sage: chebyshev_U(1,z2)
371−- array([[ 2., 4.],
372−- [ 2., 4.]])
373−+ array([[2., 4.],
374−+ [2., 4.]])
375− sage: chebyshev_U(1,z3)
376−- array([ 2., 4., 6.])
377−+ array([2., 4., 6.])
378− sage: chebyshev_U(z,0.1)
379− array([ 0.2 , -0.96])
380− """
381−diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py
382−index 1883daa3e6..9885222817 100644
383−--- a/src/sage/functions/other.py
384−+++ b/src/sage/functions/other.py
385−@@ -389,7 +389,7 @@ class Function_ceil(BuiltinFunction):
386− sage: import numpy
387− sage: a = numpy.linspace(0,2,6)
388− sage: ceil(a)
389−- array([ 0., 1., 1., 2., 2., 2.])
390−+ array([0., 1., 1., 2., 2., 2.])
391−
392− Test pickling::
393−
394−@@ -553,7 +553,7 @@ class Function_floor(BuiltinFunction):
395− sage: import numpy
396− sage: a = numpy.linspace(0,2,6)
397− sage: floor(a)
398−- array([ 0., 0., 0., 1., 1., 2.])
399−+ array([0., 0., 0., 1., 1., 2.])
400− sage: floor(x)._sympy_()
401− floor(x)
402−
403−@@ -869,7 +869,7 @@ def sqrt(x, *args, **kwds):
404− sage: import numpy
405− sage: a = numpy.arange(2,5)
406− sage: sqrt(a)
407−- array([ 1.41421356, 1.73205081, 2. ])
408−+ array([1.41421356, 1.73205081, 2. ])
409− """
410− if isinstance(x, float):
411− return math.sqrt(x)
412−diff --git a/src/sage/functions/spike_function.py b/src/sage/functions/spike_function.py
413−index 1e021de3fe..56635ca98f 100644
414−--- a/src/sage/functions/spike_function.py
415−+++ b/src/sage/functions/spike_function.py
416−@@ -157,7 +157,7 @@ class SpikeFunction:
417− sage: S = spike_function([(-3,4),(-1,1),(2,3)]); S
418− A spike function with spikes at [-3.0, -1.0, 2.0]
419− sage: P = S.plot_fft_abs(8)
420−- sage: p = P[0]; p.ydata
421−+ sage: p = P[0]; p.ydata # abs tol 1e-8
422− [5.0, 5.0, 3.367958691924177, 3.367958691924177, 4.123105625617661, 4.123105625617661, 4.759921664218055, 4.759921664218055]
423− """
424− w = self.vector(samples = samples, xmin=xmin, xmax=xmax)
425−@@ -176,8 +176,8 @@ class SpikeFunction:
426− sage: S = spike_function([(-3,4),(-1,1),(2,3)]); S
427− A spike function with spikes at [-3.0, -1.0, 2.0]
428− sage: P = S.plot_fft_arg(8)
429−- sage: p = P[0]; p.ydata
430−- [0.0, 0.0, -0.211524990023434..., -0.211524990023434..., 0.244978663126864..., 0.244978663126864..., -0.149106180027477..., -0.149106180027477...]
431−+ sage: p = P[0]; p.ydata # abs tol 1e-8
432−+ [0.0, 0.0, -0.211524990023434, -0.211524990023434, 0.244978663126864, 0.244978663126864, -0.149106180027477, -0.149106180027477]
433− """
434− w = self.vector(samples = samples, xmin=xmin, xmax=xmax)
435− xmin, xmax = self._ranges(xmin, xmax)
436−diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
437−index 501e7ff6b6..5f760912f0 100644
438−--- a/src/sage/functions/trig.py
439−+++ b/src/sage/functions/trig.py
440−@@ -724,7 +724,7 @@ class Function_arccot(GinacFunction):
441− sage: import numpy
442− sage: a = numpy.arange(2, 5)
443− sage: arccot(a)
444−- array([ 0.46364761, 0.32175055, 0.24497866])
445−+ array([0.46364761, 0.32175055, 0.24497866])
446− """
447− return math.pi/2 - arctan(x)
448−
449−@@ -780,7 +780,7 @@ class Function_arccsc(GinacFunction):
450− sage: import numpy
451− sage: a = numpy.arange(2, 5)
452− sage: arccsc(a)
453−- array([ 0.52359878, 0.33983691, 0.25268026])
454−+ array([0.52359878, 0.33983691, 0.25268026])
455− """
456− return arcsin(1.0/x)
457−
458−@@ -838,7 +838,7 @@ class Function_arcsec(GinacFunction):
459− sage: import numpy
460− sage: a = numpy.arange(2, 5)
461− sage: arcsec(a)
462−- array([ 1.04719755, 1.23095942, 1.31811607])
463−+ array([1.04719755, 1.23095942, 1.31811607])
464− """
465− return arccos(1.0/x)
466−
467−@@ -913,13 +913,13 @@ class Function_arctan2(GinacFunction):
468− sage: a = numpy.linspace(1, 3, 3)
469− sage: b = numpy.linspace(3, 6, 3)
470− sage: atan2(a, b)
471−- array([ 0.32175055, 0.41822433, 0.46364761])
472−+ array([0.32175055, 0.41822433, 0.46364761])
473−
474− sage: atan2(1,a)
475−- array([ 0.78539816, 0.46364761, 0.32175055])
476−+ array([0.78539816, 0.46364761, 0.32175055])
477−
478− sage: atan2(a, 1)
479−- array([ 0.78539816, 1.10714872, 1.24904577])
480−+ array([0.78539816, 1.10714872, 1.24904577])
481−
482− TESTS::
483−
484−diff --git a/src/sage/matrix/constructor.pyx b/src/sage/matrix/constructor.pyx
485−index 12136f1773..491bf22e62 100644
486−--- a/src/sage/matrix/constructor.pyx
487−+++ b/src/sage/matrix/constructor.pyx
488−@@ -503,8 +503,8 @@ def matrix(*args, **kwds):
489− [7 8 9]
490− Full MatrixSpace of 3 by 3 dense matrices over Integer Ring
491− sage: n = matrix(QQ, 2, 2, [1, 1/2, 1/3, 1/4]).numpy(); n
492−- array([[ 1. , 0.5 ],
493−- [ 0.33333333, 0.25 ]])
494−+ array([[1. , 0.5 ],
495−+ [0.33333333, 0.25 ]])
496− sage: matrix(QQ, n)
497− [ 1 1/2]
498− [1/3 1/4]
499−diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx
500−index 66e54a79a4..0498334f4b 100644
501−--- a/src/sage/matrix/matrix_double_dense.pyx
502−+++ b/src/sage/matrix/matrix_double_dense.pyx
503−@@ -606,6 +606,9 @@ cdef class Matrix_double_dense(Matrix_dense):
504− [ 3.0 + 9.0*I 4.0 + 16.0*I 5.0 + 25.0*I]
505− [6.0 + 36.0*I 7.0 + 49.0*I 8.0 + 64.0*I]
506− sage: B.condition()
507−+ doctest:warning
508−+ ...
509−+ ComplexWarning: Casting complex values to real discards the imaginary part
510− 203.851798...
511− sage: B.condition(p='frob')
512− 203.851798...
513−@@ -654,9 +657,7 @@ cdef class Matrix_double_dense(Matrix_dense):
514− True
515− sage: B = A.change_ring(CDF)
516− sage: B.condition()
517−- Traceback (most recent call last):
518−- ...
519−- LinAlgError: Singular matrix
520−+ +Infinity
521−
522− Improper values of ``p`` are caught. ::
523−
524−@@ -2519,7 +2520,7 @@ cdef class Matrix_double_dense(Matrix_dense):
525− sage: P.is_unitary(algorithm='orthonormal')
526− Traceback (most recent call last):
527− ...
528−- ValueError: failed to create intent(cache|hide)|optional array-- must have defined dimensions but got (0,)
529−+ error: ((lwork==-1)||(lwork >= MAX(1,2*n))) failed for 3rd keyword lwork: zgees:lwork=0
530−
531− TESTS::
532−
533−@@ -3635,8 +3636,8 @@ cdef class Matrix_double_dense(Matrix_dense):
534− [0.0 1.0 2.0]
535− [3.0 4.0 5.0]
536− sage: m.numpy()
537−- array([[ 0., 1., 2.],
538−- [ 3., 4., 5.]])
539−+ array([[0., 1., 2.],
540−+ [3., 4., 5.]])
541−
542− Alternatively, numpy automatically calls this function (via
543− the magic :meth:`__array__` method) to convert Sage matrices
544−@@ -3647,16 +3648,16 @@ cdef class Matrix_double_dense(Matrix_dense):
545− [0.0 1.0 2.0]
546− [3.0 4.0 5.0]
547− sage: numpy.array(m)
548−- array([[ 0., 1., 2.],
549−- [ 3., 4., 5.]])
550−+ array([[0., 1., 2.],
551−+ [3., 4., 5.]])
552− sage: numpy.array(m).dtype
553− dtype('float64')
554− sage: m = matrix(CDF, 2, range(6)); m
555− [0.0 1.0 2.0]
556− [3.0 4.0 5.0]
557− sage: numpy.array(m)
558−- array([[ 0.+0.j, 1.+0.j, 2.+0.j],
559−- [ 3.+0.j, 4.+0.j, 5.+0.j]])
560−+ array([[0.+0.j, 1.+0.j, 2.+0.j],
561−+ [3.+0.j, 4.+0.j, 5.+0.j]])
562− sage: numpy.array(m).dtype
563− dtype('complex128')
564−
565−diff --git a/src/sage/matrix/special.py b/src/sage/matrix/special.py
566−index ccbd208810..c3f9a65093 100644
567−--- a/src/sage/matrix/special.py
568−+++ b/src/sage/matrix/special.py
569−@@ -706,7 +706,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
570−
571− sage: import numpy
572− sage: entries = numpy.array([1.2, 5.6]); entries
573−- array([ 1.2, 5.6])
574−+ array([1.2, 5.6])
575− sage: A = diagonal_matrix(3, entries); A
576− [1.2 0.0 0.0]
577− [0.0 5.6 0.0]
578−@@ -716,7 +716,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
579−
580− sage: j = numpy.complex(0,1)
581− sage: entries = numpy.array([2.0+j, 8.1, 3.4+2.6*j]); entries
582−- array([ 2.0+1.j , 8.1+0.j , 3.4+2.6j])
583−+ array([2. +1.j , 8.1+0.j , 3.4+2.6j])
584− sage: A = diagonal_matrix(entries); A
585− [2.0 + 1.0*I 0.0 0.0]
586− [ 0.0 8.1 0.0]
587−diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
588−index 37d92c1282..955d083b34 100644
589−--- a/src/sage/modules/free_module_element.pyx
590−+++ b/src/sage/modules/free_module_element.pyx
591−@@ -988,7 +988,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
592− sage: v.numpy()
593− array([1, 2, 5/6], dtype=object)
594− sage: v.numpy(dtype=float)
595−- array([ 1. , 2. , 0.83333333])
596−+ array([1. , 2. , 0.83333333])
597− sage: v.numpy(dtype=int)
598− array([1, 2, 0])
599− sage: import numpy
600−@@ -999,7 +999,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
601− be more efficient but may have unintended consequences::
602−
603− sage: v.numpy(dtype=None)
604−- array([ 1. , 2. , 0.83333333])
605−+ array([1. , 2. , 0.83333333])
606−
607− sage: w = vector(ZZ, [0, 1, 2^63 -1]); w
608− (0, 1, 9223372036854775807)
609−diff --git a/src/sage/modules/vector_double_dense.pyx b/src/sage/modules/vector_double_dense.pyx
610−index 39fc2970de..2badf98284 100644
611−--- a/src/sage/modules/vector_double_dense.pyx
612−+++ b/src/sage/modules/vector_double_dense.pyx
613−@@ -807,13 +807,13 @@ cdef class Vector_double_dense(FreeModuleElement):
614−
615− sage: v = vector(CDF,4,range(4))
616− sage: v.numpy()
617−- array([ 0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j])
618−+ array([0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j])
619− sage: v = vector(CDF,0)
620− sage: v.numpy()
621− array([], dtype=complex128)
622− sage: v = vector(RDF,4,range(4))
623− sage: v.numpy()
624−- array([ 0., 1., 2., 3.])
625−+ array([0., 1., 2., 3.])
626− sage: v = vector(RDF,0)
627− sage: v.numpy()
628− array([], dtype=float64)
629−@@ -823,11 +823,11 @@ cdef class Vector_double_dense(FreeModuleElement):
630− sage: import numpy
631− sage: v = vector(CDF, 3, range(3))
632− sage: v.numpy()
633−- array([ 0.+0.j, 1.+0.j, 2.+0.j])
634−+ array([0.+0.j, 1.+0.j, 2.+0.j])
635− sage: v.numpy(dtype=numpy.float64)
636−- array([ 0., 1., 2.])
637−+ array([0., 1., 2.])
638− sage: v.numpy(dtype=numpy.float32)
639−- array([ 0., 1., 2.], dtype=float32)
640−+ array([0., 1., 2.], dtype=float32)
641− """
642− if dtype is None or dtype is self._vector_numpy.dtype:
643− from copy import copy
644−diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
645−index ad9693da62..758fb709b7 100644
646−--- a/src/sage/plot/complex_plot.pyx
647−+++ b/src/sage/plot/complex_plot.pyx
648−@@ -61,9 +61,9 @@ cdef inline double mag_to_lightness(double r):
649−
650− sage: from sage.plot.complex_plot import complex_to_rgb
651− sage: complex_to_rgb([[0, 1, 10]])
652−- array([[[ 0. , 0. , 0. ],
653−- [ 0.77172568, 0. , 0. ],
654−- [ 1. , 0.22134776, 0.22134776]]])
655−+ array([[[0. , 0. , 0. ],
656−+ [0.77172568, 0. , 0. ],
657−+ [1. , 0.22134776, 0.22134776]]])
658− """
659− return atan(log(sqrt(r)+1)) * (4/PI) - 1
660−
661−@@ -82,13 +82,13 @@ def complex_to_rgb(z_values):
662−
663− sage: from sage.plot.complex_plot import complex_to_rgb
664− sage: complex_to_rgb([[0, 1, 1000]])
665−- array([[[ 0. , 0. , 0. ],
666−- [ 0.77172568, 0. , 0. ],
667−- [ 1. , 0.64421177, 0.64421177]]])
668−+ array([[[0. , 0. , 0. ],
669−+ [0.77172568, 0. , 0. ],
670−+ [1. , 0.64421177, 0.64421177]]])
671− sage: complex_to_rgb([[0, 1j, 1000j]])
672−- array([[[ 0. , 0. , 0. ],
673−- [ 0.38586284, 0.77172568, 0. ],
674−- [ 0.82210588, 1. , 0.64421177]]])
675−+ array([[[0. , 0. , 0. ],
676−+ [0.38586284, 0.77172568, 0. ],
677−+ [0.82210588, 1. , 0.64421177]]])
678− """
679− import numpy
680− cdef unsigned int i, j, imax, jmax
681−diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
682−index 5d28473731..fc4b2046c0 100644
683−--- a/src/sage/plot/histogram.py
684−+++ b/src/sage/plot/histogram.py
685−@@ -53,10 +53,17 @@ class Histogram(GraphicPrimitive):
686− """
687− import numpy as np
688− self.datalist=np.asarray(datalist,dtype=float)
689−+ if 'normed' in options:
690−+ from sage.misc.superseded import deprecation
691−+ deprecation(25260, "the 'normed' option is deprecated. Use 'density' instead.")
692− if 'linestyle' in options:
693− from sage.plot.misc import get_matplotlib_linestyle
694− options['linestyle'] = get_matplotlib_linestyle(
695− options['linestyle'], return_type='long')
696−+ if options.get('range', None):
697−+ # numpy.histogram performs type checks on "range" so this must be
698−+ # actual floats
699−+ options['range'] = [float(x) for x in options['range']]
700− GraphicPrimitive.__init__(self, options)
701−
702− def get_minmax_data(self):
703−@@ -80,10 +87,14 @@ class Histogram(GraphicPrimitive):
704− {'xmax': 4.0, 'xmin': 0, 'ymax': 2, 'ymin': 0}
705−
706− TESTS::
707−-
708− sage: h = histogram([10,3,5], normed=True)[0]
709−- sage: h.get_minmax_data() # rel tol 1e-15
710−- {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.4761904761904765, 'ymin': 0}
711−+ doctest:warning...:
712−+ DeprecationWarning: the 'normed' option is deprecated. Use 'density' instead.
713−+ See https://trac.sagemath.org/25260 for details.
714−+ sage: h.get_minmax_data()
715−+ doctest:warning ...:
716−+ 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.
717−+ {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
718− """
719− import numpy
720−
721−@@ -152,7 +163,7 @@ class Histogram(GraphicPrimitive):
722− 'rwidth': 'The relative width of the bars as a fraction of the bin width',
723− 'cumulative': '(True or False) If True, then a histogram is computed in which each bin gives the counts in that bin plus all bins for smaller values. Negative values give a reversed direction of accumulation.',
724− 'range': 'A list [min, max] which define the range of the histogram. Values outside of this range are treated as outliers and omitted from counts.',
725−- 'normed': 'Deprecated alias for density',
726−+ 'normed': 'Deprecated. Use density instead.',
727− 'density': '(True or False) If True, the counts are normalized to form a probability density. (n/(len(x)*dbin)',
728− 'weights': 'A sequence of weights the same length as the data list. If supplied, then each value contributes its associated weight to the bin count.',
729− 'stacked': '(True or False) If True, multiple data are stacked on top of each other.',
730−@@ -199,7 +210,7 @@ class Histogram(GraphicPrimitive):
731− subplot.hist(self.datalist.transpose(), **options)
732−
733−
734−-@options(aspect_ratio='automatic',align='mid', weights=None, range=None, bins=10, edgecolor='black')
735−+@options(aspect_ratio='automatic', align='mid', weights=None, range=None, bins=10, edgecolor='black')
736− def histogram(datalist, **options):
737− """
738− Computes and draws the histogram for list(s) of numerical data.
739−@@ -231,8 +242,9 @@ def histogram(datalist, **options):
740− - ``linewidth`` -- (float) width of the lines defining the bars
741− - ``linestyle`` -- (default: 'solid') Style of the line. One of 'solid'
742− or '-', 'dashed' or '--', 'dotted' or ':', 'dashdot' or '-.'
743−- - ``density`` -- (boolean - default: False) If True, the counts are
744−- normalized to form a probability density.
745−+ - ``density`` -- (boolean - default: False) If True, the result is the
746−+ value of the probability density function at the bin, normalized such
747−+ that the integral over the range is 1.
748− - ``range`` -- A list [min, max] which define the range of the
749− histogram. Values outside of this range are treated as outliers and
750− omitted from counts
751−diff --git a/src/sage/plot/line.py b/src/sage/plot/line.py
752−index 23f5e61446..3b1b51d7cf 100644
753−--- a/src/sage/plot/line.py
754−+++ b/src/sage/plot/line.py
755−@@ -502,14 +502,12 @@ def line2d(points, **options):
756− from sage.plot.all import Graphics
757− from sage.plot.plot import xydata_from_point_list
758− from sage.rings.all import CC, CDF
759−+ points = list(points) # make sure points is a python list
760− if points in CC or points in CDF:
761− pass
762− else:
763−- try:
764−- if not points:
765−- return Graphics()
766−- except ValueError: # numpy raises a ValueError if not empty
767−- pass
768−+ if len(points) == 0:
769−+ return Graphics()
770− xdata, ydata = xydata_from_point_list(points)
771− g = Graphics()
772− g._set_extra_kwds(Graphics._extract_kwds_for_show(options))
773−diff --git a/src/sage/plot/plot_field.py b/src/sage/plot/plot_field.py
774−index 0025098a8d..23c80902f3 100644
775−--- a/src/sage/plot/plot_field.py
776−+++ b/src/sage/plot/plot_field.py
777−@@ -49,9 +49,10 @@ class PlotField(GraphicPrimitive):
778− sage: r.xpos_array
779− [0.0, 0.0, 1.0, 1.0]
780− sage: r.yvec_array
781−- masked_array(data = [0.0 0.70710678118... 0.70710678118... 0.89442719...],
782−- mask = [False False False False],
783−- fill_value = 1e+20)
784−+ masked_array(data=[0.0, 0.70710678118..., 0.70710678118...,
785−+ 0.89442719...],
786−+ mask=[False, False, False, False],
787−+ fill_value=1e+20)
788−
789− TESTS:
790−
791−diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
792−index f3da57c370..3806f4b32f 100644
793−--- a/src/sage/plot/streamline_plot.py
794−+++ b/src/sage/plot/streamline_plot.py
795−@@ -38,16 +38,14 @@ class StreamlinePlot(GraphicPrimitive):
796− sage: r.options()['plot_points']
797− 2
798− sage: r.xpos_array
799−- array([ 0., 1.])
800−+ array([0., 1.])
801− sage: r.yvec_array
802−- masked_array(data =
803−- [[1.0 1.0]
804−- [0.5403023058681398 0.5403023058681398]],
805−- mask =
806−- [[False False]
807−- [False False]],
808−- fill_value = 1e+20)
809−- <BLANKLINE>
810−+ masked_array(
811−+ data=[[1.0, 1.0],
812−+ [0.5403023058681398, 0.5403023058681398]],
813−+ mask=[[False, False],
814−+ [False, False]],
815−+ fill_value=1e+20)
816−
817− TESTS:
818−
819−diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
820−index 1b119e323f..3290b00695 100644
821−--- a/src/sage/probability/probability_distribution.pyx
822−+++ b/src/sage/probability/probability_distribution.pyx
823−@@ -130,7 +130,17 @@ cdef class ProbabilityDistribution:
824− 0.0,
825− 1.4650000000000003]
826− sage: b
827−- [0.0, 0.20000000000000001, 0.40000000000000002, 0.60000000000000009, 0.80000000000000004, 1.0, 1.2000000000000002, 1.4000000000000001, 1.6000000000000001, 1.8, 2.0]
828−+ [0.0,
829−+ 0.2,
830−+ 0.4,
831−+ 0.6000000000000001,
832−+ 0.8,
833−+ 1.0,
834−+ 1.2000000000000002,
835−+ 1.4000000000000001,
836−+ 1.6,
837−+ 1.8,
838−+ 2.0]
839− """
840− import pylab
841− l = [float(self.get_random_element()) for _ in range(num_samples)]
842−diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx
843−index 12ca1b222b..9bad7dae0c 100644
844−--- a/src/sage/rings/rational.pyx
845−+++ b/src/sage/rings/rational.pyx
846−@@ -1041,7 +1041,7 @@ cdef class Rational(sage.structure.element.FieldElement):
847− dtype('O')
848−
849− sage: numpy.array([1, 1/2, 3/4])
850−- array([ 1. , 0.5 , 0.75])
851−+ array([1. , 0.5 , 0.75])
852− """
853− if mpz_cmp_ui(mpq_denref(self.value), 1) == 0:
854− if mpz_fits_slong_p(mpq_numref(self.value)):
855−diff --git a/src/sage/rings/real_mpfr.pyx b/src/sage/rings/real_mpfr.pyx
856−index 9b90c8833e..1ce05b937d 100644
857−--- a/src/sage/rings/real_mpfr.pyx
858−+++ b/src/sage/rings/real_mpfr.pyx
859−@@ -1439,7 +1439,7 @@ cdef class RealNumber(sage.structure.element.RingElement):
860−
861− sage: import numpy
862− sage: numpy.arange(10.0)
863−- array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
864−+ array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
865− sage: numpy.array([1.0, 1.1, 1.2]).dtype
866− dtype('float64')
867− sage: numpy.array([1.000000000000000000000000000000000000]).dtype
868−diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py
869−index de31fe9883..7a33ea6f5b 100644
870−--- a/src/sage/schemes/elliptic_curves/height.py
871−+++ b/src/sage/schemes/elliptic_curves/height.py
872−@@ -1627,18 +1627,18 @@ class EllipticCurveCanonicalHeight:
873− even::
874−
875− sage: H.wp_on_grid(v,4)
876−- array([[ 25.43920182, 5.28760943, 5.28760943, 25.43920182],
877−- [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
878−- [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
879−- [ 25.43920182, 5.28760943, 5.28760943, 25.43920182]])
880−+ array([[25.43920182, 5.28760943, 5.28760943, 25.43920182],
881−+ [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
882−+ [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
883−+ [25.43920182, 5.28760943, 5.28760943, 25.43920182]])
884−
885− The array of values on the half-grid::
886−
887− sage: H.wp_on_grid(v,4,True)
888−- array([[ 25.43920182, 5.28760943],
889−- [ 6.05099485, 1.83757786],
890−- [ 6.05099485, 1.83757786],
891−- [ 25.43920182, 5.28760943]])
892−+ array([[25.43920182, 5.28760943],
893−+ [ 6.05099485, 1.83757786],
894−+ [ 6.05099485, 1.83757786],
895−+ [25.43920182, 5.28760943]])
896− """
897− tau = self.tau(v)
898− fk, err = self.fk_intervals(v, 15, CDF)
899−diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
900−index 9da38002e8..d61e74bf82 100644
901−--- a/src/sage/symbolic/ring.pyx
902−+++ b/src/sage/symbolic/ring.pyx
903−@@ -1136,7 +1136,7 @@ cdef class NumpyToSRMorphism(Morphism):
904− sage: cos(numpy.int('2'))
905− cos(2)
906− sage: numpy.cos(numpy.int('2'))
907−- -0.41614683654714241
908−+ -0.4161468365471424
909− """
910− cdef _intermediate_ring
911−
pkgs/applications/science/math/sage/sage-env.nix+1
@@ -77,6 +77,7 @@ let
7777 singular
7878 giac
7979 palp
80+ # needs to be rWrapper since the default `R` doesn't include R's default libraries
8081 rWrapper
8182 gfan
8283 cddlib
pkgs/applications/science/math/sage/sage-src.nix+5−25
@@ -9,14 +9,14 @@
99# all get the same sources with the same patches applied.
1010
1111stdenv.mkDerivation rec {
12− version = "8.4";
12+ version = "8.5";
1313 name = "sage-src-${version}";
1414
1515 src = fetchFromGitHub {
1616 owner = "sagemath";
1717 repo = "sage";
1818 rev = version;
19− sha256 = "0gips1hagiz9m7s21bg5as8hrrm2x5k47h1bsq0pc46iplfwmv2d";
19+ sha256 = "08mb9626phsls2phdzqxsnp2df5pn5qr72m0mm4nncby26pwn19c";
2020 };
2121
2222 # Patches needed because of particularities of nix or the way this is packaged.
@@ -46,6 +46,8 @@ stdenv.mkDerivation rec {
4646 # tests) are also run. That is necessary to test dochtml individually. See
4747 # https://trac.sagemath.org/ticket/26110 for an upstream discussion.
4848 ./patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch
49+
50+ ./patches/dont-test-guess-gaproot.patch
4951 ];
5052
5153 # Patches needed because of package updates. We could just pin the versions of
@@ -68,6 +70,7 @@ stdenv.mkDerivation rec {
6870 );
6971 in [
7072 # New glpk version has new warnings, filter those out until upstream sage has found a solution
73+ # Should be fixed with glpk > 4.65.
7174 # https://trac.sagemath.org/ticket/24824
7275 ./patches/pari-stackwarn.patch # not actually necessary since the pari upgrade, but necessary for the glpk patch to apply
7376 (fetchpatch {
@@ -76,32 +79,9 @@ stdenv.mkDerivation rec {
7679 stripLen = 1;
7780 })
7881
79− # https://trac.sagemath.org/ticket/25260
80− ./patches/numpy-1.15.1.patch
81−
8282 # https://trac.sagemath.org/ticket/26315
8383 ./patches/giac-1.5.0.patch
8484
85− # needed for ntl update
86− # https://trac.sagemath.org/ticket/25532
87− (fetchpatch {
88− name = "lcalc-c++11.patch";
89− url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/sagemath-lcalc-c++11.patch?h=packages/sagemath&id=0e31ae526ab7c6b5c0bfacb3f8b1c4fd490035aa";
90− sha256 = "0p5wnvbx65i7cp0bjyaqgp4rly8xgnk12pqwaq3dqby0j2bk6ijb";
91− })
92−
93− (fetchpatch {
94− name = "cython-0.29.patch";
95− url = "https://git.sagemath.org/sage.git/patch/?h=f77de1d0e7f90ee12761140500cb8cbbb789ab20";
96− sha256 = "14wrpy8jgbnpza1j8a2nx8y2r946y82pll1fv3cn6gpfmm6640l3";
97− })
98− # https://trac.sagemath.org/ticket/26360
99− (fetchpatch {
100− name = "arb-2.15.1.patch";
101− url = "https://git.sagemath.org/sage.git/patch/?id=30cc778d46579bd0c7537ed33e8d7a4f40fd5c31";
102− sha256 = "13vc2q799dh745sm59xjjabllfj0sfjzcacf8k59kwj04x755d30";
103− })
104−
10585 # https://trac.sagemath.org/ticket/26326
10686 # needs to be split because there is a merge commit in between
10787 (fetchSageDiff {
pkgs/applications/science/math/sage/sage-tests.nix+9−3
@@ -3,7 +3,12 @@
33, sage-with-env
44, makeWrapper
55, files ? null # "null" means run all tests
6−, longTests ? true # run tests marked as "long time"
6+, longTests ? true # run tests marked as "long time" (roughly doubles runtime)
7+# Run as many tests as possible in approximately n seconds. This will give each
8+# file to test a "time budget" and stop tests if it is exceeded. 300 is the
9+# upstream default value.
10+# https://trac.sagemath.org/ticket/25270 for details.
11+, timeLimit ? null
712}:
813
914# for a quick test of some source files:
@@ -14,6 +19,7 @@ let
1419 runAllTests = files == null;
1520 testArgs = if runAllTests then "--all" else testFileList;
1621 patienceSpecifier = if longTests then "--long" else "";
22+ timeSpecifier = if timeLimit == null then "" else "--short ${toString timeLimit}";
1723 relpathToArg = relpath: lib.escapeShellArg "${src}/${relpath}"; # paths need to be absolute
1824 testFileList = lib.concatStringsSep " " (map relpathToArg files);
1925in
@@ -45,7 +51,7 @@ stdenv.mkDerivation rec {
4551 export HOME="$TMPDIR/sage-home"
4652 mkdir -p "$HOME"
4753
48− # "--long" tests are in the order of 1h, without "--long" its 1/2h
49− "sage" -t --timeout=0 --nthreads "$NIX_BUILD_CORES" --optional=sage ${patienceSpecifier} ${testArgs}
54+ echo "Running sage tests with arguments ${timeSpecifier} ${patienceSpecifier} ${testArgs}"
55+ "sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage ${timeSpecifier} ${patienceSpecifier} ${testArgs}
5056 '';
5157}
pkgs/applications/science/math/sage/sage.nix+1
@@ -54,6 +54,7 @@ stdenv.mkDerivation rec {
5454
5555 passthru = {
5656 tests = sage-tests;
57+ quicktest = sage-tests.override { longTests = false; timeLimit = 600; }; # as many tests as possible in ~10m
5758 doc = sagedoc;
5859 lib = sage-with-env.env.lib;
5960 kernelspec = jupyter-kernel-definition;