[sagemath] 02/02: d0-pari-stackwarn.patch: Patch doctest parser to ignore pari stack warnings.
Tobias Hansen
thansen at moszumanska.debian.org
Sat Jun 17 08:46:34 UTC 2017
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository sagemath.
commit 4f4d0fdf49483e7f8df9f8680aca0a58658e6788
Author: Tobias Hansen <thansen at debian.org>
Date: Sat Jun 17 02:11:20 2017 +0000
d0-pari-stackwarn.patch: Patch doctest parser to ignore pari stack warnings.
---
debian/patches/d0-pari-stackwarn.patch | 263 +++------------------------------
1 file changed, 21 insertions(+), 242 deletions(-)
diff --git a/debian/patches/d0-pari-stackwarn.patch b/debian/patches/d0-pari-stackwarn.patch
index 2747ebc..1614459 100644
--- a/debian/patches/d0-pari-stackwarn.patch
+++ b/debian/patches/d0-pari-stackwarn.patch
@@ -1,244 +1,23 @@
-Description: Set the default size of the PARI stack to 16*10^6 bytes
- Also ignore the remaining warnings. This gets rid of the warnings
- of pari increasing the stack size which caused tests to fail.
+Description: Ignore warnings of PARI increasing the stack size when parsing doctests
+ Since we can't patch PARI to not produce the warnings and we don't want to
+ patch tons of doctests to expect the warnings, we patch the doctest parser
+ to ignore them.
Author: Tobias Hansen <thansen at debian.org>
-
---- a/sage/src/sage/schemes/elliptic_curves/ell_rational_field.py
-+++ b/sage/src/sage/schemes/elliptic_curves/ell_rational_field.py
-@@ -1483,6 +1483,7 @@
- sage: E.analytic_rank(algorithm='pari')
- 2
- sage: E.analytic_rank(algorithm='rubinstein')
-+ *** Warning: increasing stack size to...
- 2
- sage: E.analytic_rank(algorithm='sympow')
- 2
-@@ -1491,6 +1492,7 @@
- sage: E.analytic_rank(algorithm='zero_sum')
- 2
- sage: E.analytic_rank(algorithm='all')
-+ *** Warning: increasing stack size to...
- 2
-
- With the optional parameter leading_coefficient set to ``True``, a
---- a/sage/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
-+++ b/sage/src/sage/schemes/hyperelliptic_curves/hyperelliptic_finite_field.py
-@@ -447,6 +447,7 @@
- sage: R.<t> = PolynomialRing(K)
- sage: H = HyperellipticCurve(t^7 + 487*t^5 + 9*t + 1)
- sage: H.frobenius_polynomial_pari()
-+ *** Warning: increasing stack size to...
- x^6 - 14*x^5 + 1512*x^4 - 66290*x^3 + 3028536*x^2 - 56168126*x + 8036054027
-
- Curves defined over a non-prime field are supported as well::
---- a/sage/src/sage/rings/number_field/number_field_element.pyx
-+++ b/sage/src/sage/rings/number_field/number_field_element.pyx
-@@ -2445,6 +2445,7 @@
- sage: f = x^9 + (zeta22^9 - zeta22^6 + zeta22^4 + 1)*x^8 + (2*zeta22^8 + 4*zeta22^7 - 6*zeta22^5 - 205*zeta22^4 - 6*zeta22^3 + 4*zeta22 + 2)*x^7 + (181*zeta22^9 - 354*zeta22^8 + 145*zeta22^7 - 253*zeta22^6 + 145*zeta22^5 - 354*zeta22^4 + 181*zeta22^3 + 189*zeta22 - 189)*x^6 + (902*zeta22^9 + 13116*zeta22^8 + 902*zeta22^7 - 500*zeta22^5 - 322*zeta22^4 - 176*zeta22^3 + 176*zeta22^2 + 322*zeta22 + 500)*x^5 + (13196*zeta22^9 + 548*zeta22^8 + 9176*zeta22^7 - 17964*zeta22^6 + 8512 [...]
- sage: L.<a> = K.extension(f)
- sage: alpha = (a^8 + (zeta22^9 - zeta22^6 + 2*zeta22^4 + 33)*a^7)/(10**2555) #long time
-+ *** Warning: increasing stack size to...
- sage: beta = ~alpha # long time (about 1:45min on a 2014 MacBook Pro, this used to cause a crash in Sage 7.2)
- sage: alpha*beta # long time
- 1
---- a/sage/src/sage/schemes/elliptic_curves/heegner.py
-+++ b/sage/src/sage/schemes/elliptic_curves/heegner.py
-@@ -4691,6 +4691,7 @@
- sage: H = heegner_points(11).reduce_mod(3)
- sage: R = H.left_orders()[0]
- sage: H.optimal_embeddings(-7, 1, R)
-+ *** Warning: increasing stack size to...
- [Embedding sending sqrt(-7) to i - j - k,
- Embedding sending sqrt(-7) to -i + j + k]
- sage: H.optimal_embeddings(-7, 2, R)
---- a/sage/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
-+++ b/sage/src/sage/schemes/elliptic_curves/isogeny_small_degree.py
-@@ -1930,6 +1930,7 @@
-
- sage: E = EllipticCurve([-3440, 77658])
- sage: isogenies_prime_degree_general(E, 43) # long time (16s)
-+ *** Warning: increasing stack size to...
- [Isogeny of degree 43 from Elliptic Curve defined by y^2 = x^3 - 3440*x + 77658 over Rational Field to Elliptic Curve defined by y^2 = x^3 - 6360560*x - 6174354606 over Rational Field]
-
- Isogenies of degree equal to the characteristic are computed (but
---- a/sage/src/sage/quadratic_forms/quadratic_form__automorphisms.py
-+++ b/sage/src/sage/quadratic_forms/quadratic_form__automorphisms.py
-@@ -149,6 +149,7 @@
- sage: [len(vs[i]) for i in range(len(vs))]
- [1, 72, 270, 720, 936, 2160, 2214, 3600]
- sage: vs = Q.short_vector_list_up_to_length(30) # long time (28s on sage.math, 2014)
-+ *** Warning: increasing stack size to...
- sage: [len(vs[i]) for i in range(len(vs))] # long time
- [1, 72, 270, 720, 936, 2160, 2214, 3600, 4590, 6552, 5184, 10800, 9360, 12240, 13500, 17712, 14760, 25920, 19710, 26064, 28080, 36000, 25920, 47520, 37638, 43272, 45900, 59040, 46800, 75600]
-
---- a/sage/src/sage/plot/line.py
-+++ b/sage/src/sage/plot/line.py
-@@ -478,6 +478,7 @@
-
- sage: E = EllipticCurve('37a')
- sage: vals = E.lseries().values_along_line(1-I, 1+10*I, 100) # critical line
-+ *** Warning: increasing stack size to...
- sage: L = [(z[1].real(), z[1].imag()) for z in vals]
- sage: line(L, rgbcolor=(3/4,1/2,5/8))
- Graphics object consisting of 1 graphics primitive
---- a/sage/src/sage/rings/integer.pyx
-+++ b/sage/src/sage/rings/integer.pyx
-@@ -6537,6 +6537,7 @@
- ....: (2^100).binomial(2^22, algorithm='pari')
- ....: except AlarmInterrupt:
- ....: pass
-+ *** Warning: increasing stack size to...
- """
- cdef Integer x
- cdef Integer mm
---- a/sage/src/sage/lfunctions/zero_sums.pyx
-+++ b/sage/src/sage/lfunctions/zero_sums.pyx
-@@ -535,6 +535,7 @@
- 2
- sage: Z = LFunctionZeroSum(E)
- sage: E.lseries().zeros(3)
-+ *** Warning: increasing stack size to...
- [0.000000000, 0.000000000, 2.87609907]
- sage: Z.zerosum(Delta=1,function="sincsquared_fast") # tol 1.0e-13
- 2.037500084595065
-@@ -624,6 +625,7 @@
- 1
- sage: Z = LFunctionZeroSum(E)
- sage: E.lseries().zeros(2)
-+ *** Warning: increasing stack size to...
- [0.000000000, 5.00317001]
-
- E is a rank 1 curve; the lowest noncentral zero has imaginary part
-@@ -831,6 +833,7 @@
-
- sage: E = EllipticCurve("11a")
- sage: E.lseries().zeros(2)
-+ *** Warning: increasing stack size to...
- [6.36261389, 8.60353962]
-
- E is a rank zero curve; the lowest zero has imaginary part ~6.36. The
---- a/sage/src/sage/schemes/elliptic_curves/lseries_ell.py
-+++ b/sage/src/sage/schemes/elliptic_curves/lseries_ell.py
-@@ -267,9 +267,11 @@
-
- sage: E = EllipticCurve('37a')
- sage: E.lseries().zeros(2)
-+ *** Warning: increasing stack size to...
- [0.000000000, 5.00317001]
-
- sage: a = E.lseries().zeros(20) # long time
-+ *** Warning: increasing stack size to...
- sage: point([(1,x) for x in a]) # graph (long time)
- Graphics object consisting of 1 graphics primitive
-
-@@ -305,6 +307,7 @@
-
- sage: E = EllipticCurve('37a')
- sage: E.lseries().zeros_in_interval(6, 10, 0.1) # long time
-+ *** Warning: increasing stack size to...
- [(6.87039122, 0.248922780), (8.01433081, -0.140168533), (9.93309835, -0.129943029)]
+--- a/sage/src/sage/doctest/parsing.py
++++ b/sage/src/sage/doctest/parsing.py
+@@ -38,6 +38,7 @@
+
+ float_regex = re.compile('\s*([+-]?\s*((\d*\.?\d+)|(\d+\.?))([eE][+-]?\d+)?)')
+ optional_regex = re.compile(r'(long time|not implemented|not tested|known bug)|([^ a-z]\s*optional\s*[:-]*((\s|\w)*))')
++pari_stack_warning_regex = re.compile(r'\s*\*\*\*.*(Warning: increasing stack size to )\d+\.')
+ find_sage_prompt = re.compile(r"^(\s*)sage: ", re.M)
+ find_sage_continuation = re.compile(r"^(\s*)\.\.\.\.:", re.M)
+ random_marker = re.compile('.*random', re.I)
+@@ -875,6 +876,7 @@
+ 'you'
"""
- from sage.lfunctions.lcalc import lcalc
-@@ -336,6 +339,7 @@
-
- sage: E = EllipticCurve('37a')
- sage: E.lseries().values_along_line(1, 0.5 + 20*I, 5)
-+ *** Warning: increasing stack size to...
- [(0.500000000, ...),
- (0.400000000 + 4.00000000*I, 3.31920245 - 2.60028054*I),
- (0.300000000 + 8.00000000*I, -0.886341185 - 0.422640337*I),
-@@ -374,6 +378,7 @@
-
- sage: E = EllipticCurve('37a')
- sage: vals = E.lseries().twist_values(1, -12, -4)
-+ *** Warning: increasing stack size to...
- sage: vals # abs tol 1e-15
- [(-11, 1.47824342), (-8, 8.9590946e-18), (-7, 1.85307619), (-4, 2.45138938)]
- sage: F = E.quadratic_twist(-8)
-@@ -414,7 +419,9 @@
-
- sage: E = EllipticCurve('37a')
- sage: E.lseries().twist_zeros(3, -4, -3) # long time
-- {-4: [1.60813783, 2.96144840, 3.89751747], -3: [2.06170900, 3.48216881, 4.45853219]}
-+ *** Warning: increasing stack size to...
-+ {-4: [1.60813783, 2.96144840, 3.89751747],
-+ -3: [2.06170900, 3.48216881, 4.45853219]}
- """
- from sage.lfunctions.lcalc import lcalc
- return lcalc.twist_zeros(n, dmin, dmax, L=self.__E)
---- a/sage/src/sage/lfunctions/lcalc.py
-+++ b/sage/src/sage/lfunctions/lcalc.py
-@@ -122,6 +122,7 @@
- sage: lcalc.zeros(5, L='--tau') # long time
- [9.22237940, 13.9075499, 17.4427770, 19.6565131, 22.3361036]
- sage: lcalc.zeros(3, EllipticCurve('37a')) # long time
-+ *** Warning: increasing stack size to...
- [0.000000000, 5.00317001, 6.87039122]
- """
- L = self._compute_L(L)
-@@ -231,6 +232,7 @@
-
- sage: E = EllipticCurve('389a')
- sage: E.lseries().values_along_line(0.5, 3, 5)
-+ *** Warning: increasing stack size to...
- [(0.000000000, 0.209951303),
- (0.500000000, -...e-16),
- (1.00000000, 0.133768433),
-@@ -376,6 +378,7 @@
-
- sage: E = EllipticCurve('37a')
- sage: lcalc.analytic_rank(E)
-+ *** Warning: increasing stack size to...
- 1
- """
- L = self._compute_L(L)
---- a/sage/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py
-+++ b/sage/src/sage/quadratic_forms/quadratic_form__ternary_Tornaria.py
-@@ -556,6 +556,7 @@
-
- sage: Q = DiagonalQuadraticForm(ZZ, [1, 1])
- sage: Q.representation_vector_list(10)
-+ *** Warning: increasing stack size to...
- [[(0, 0)],
- [(0, 1), (0, -1), (1, 0), (-1, 0)],
- [(1, 1), (-1, -1), (1, -1), (-1, 1)],
---- a/sage/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/elliptic_curves.rst
-+++ b/sage/src/doc/en/thematic_tutorials/explicit_methods_in_number_theory/elliptic_curves.rst
-@@ -372,6 +372,15 @@
- ::
-
- sage: L.zeros(10)
-- [0.000000000, 0.000000000, 2.87609907, 4.41689608, 5.79340263,
-- 6.98596665, 7.47490750, 8.63320525, 9.63307880, 10.3514333]
-+ *** Warning: increasing stack size to...
-+ [0.000000000,
-+ 0.000000000,
-+ 2.87609907,
-+ 4.41689608,
-+ 5.79340263,
-+ 6.98596665,
-+ 7.47490750,
-+ 8.63320525,
-+ 9.63307880,
-+ 10.3514333]
-
---- a/sage/src/sage/functions/orthogonal_polys.py
-+++ b/sage/src/sage/functions/orthogonal_polys.py
-@@ -1231,6 +1231,7 @@
- sage: legendre_P(4,x)
- 35/8*x^4 - 15/4*x^2 + 3/8
- sage: legendre_P(10000,x).coefficient(x,1)
-+ *** Warning: increasing stack size to...
- 0
- sage: var('t,x')
- (t, x)
---- a/sage/src/sage/libs/pari/tests.py
-+++ b/sage/src/sage/libs/pari/tests.py
-@@ -31,6 +31,7 @@
- sage: x = polygen(ZpFM(3,10))
- sage: pol = ((x-1)^50 + x)
- sage: pari(pol).poldisc()
-+ *** Warning: increasing stack size to...
- 2*3 + 3^4 + 2*3^6 + 3^7 + 2*3^8 + 2*3^9 + O(3^10)
-
- Getting the coefficients of a Laurent series behaves differently
+ got = self.human_readable_escape_sequences(got)
++ got = pari_stack_warning_regex.sub('', got)
+ if isinstance(want, MarkedOutput):
+ if want.random:
+ return True
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git
More information about the debian-science-commits
mailing list