diff --git a/src/.relint.yml b/src/.relint.yml index 2c9faa323a7..e0b275296aa 100644 --- a/src/.relint.yml +++ b/src/.relint.yml @@ -52,3 +52,12 @@ pattern: 'from\s+sage(|[.](arith|categories|combinat|ext|graphs(|[.]decompositions)|interfaces|libs|matrix|misc|numerical(|[.]backends)|rings(|[.]finite_rings)|sets))[.]all\s+import' # imports from .all are allowed in all.py; also allow in some modules that need sage.all filePattern: '(.*/|)(?!(all|benchmark|dev_tools|parsing|sage_eval))[^/.]*[.](py|pyx|pxi)$' + +# Magic doctest comments + +- name: 'multiline_doctest_comment: magic comment on a continuation line' + hint: | + magic doctest comments should appear on the "sage:" line, not "....:" lines + # see optional_regex in src/sage/doctest/parsing.py + # "indirect doctest" is from src/bin/sage-coverage + pattern: '^[ ]*[.][.][.][.]:.*#.*(arb216|arb218|py2|py3|long time|not implemented|not tested|known bug|optional|indirect doctest)' diff --git a/src/doc/en/constructions/plotting.rst b/src/doc/en/constructions/plotting.rst index 75a0e0e3bbc..58eb17a98c6 100644 --- a/src/doc/en/constructions/plotting.rst +++ b/src/doc/en/constructions/plotting.rst @@ -301,10 +301,10 @@ Here is an example of a plot of a parametric surface in 3-space: :: sage: maxima.plot3d_parametric(["v*sin(u)","v*cos(u)","v"], ["u","v"], - ....: [-3.2,3.2],[0,3]) # optional -- pops up a window. + ....: [-3.2,3.2],[0,3]) sage: opts = '[gnuplot_term, ps], [gnuplot_out_file, "sin-cos-plot.eps"]' sage: maxima.plot3d_parametric(["v*sin(u)","v*cos(u)","v"], ["u","v"], - ....: [-3.2,3.2],[0,3],opts) # optional -- pops up a window. + ....: [-3.2,3.2],[0,3],opts) To illustrate how to pass gnuplot options in , here is an example of a plot of a set of points involving the Riemann zeta function diff --git a/src/doc/en/developer/coding_basics.rst b/src/doc/en/developer/coding_basics.rst index 0371341a3ab..81be2129d6b 100644 --- a/src/doc/en/developer/coding_basics.rst +++ b/src/doc/en/developer/coding_basics.rst @@ -1092,9 +1092,9 @@ framework. Here is a comprehensive list: sage: print("The sum of 1 and 1 equals 5") # abs tol 1 The sum of 2 and 2 equals 4 - sage: e^(i*pi/4).n() # rel tol 1e-1 + sage: e^(i*pi/4).n() # rel tol 1e-1 0.7 + 0.7*I - sage: ((x+1.001)^4).expand() # rel tol 2 + sage: ((x+1.001)^4).expand() # rel tol 2 x^4 + 4*x^3 + 6*x^2 + 4*x + 1 sage: M = matrix.identity(3) + random_matrix(RR,3,3)/10^3 sage: M^2 # abs tol 1e-2 @@ -1219,6 +1219,22 @@ framework. Here is a comprehensive list: 8193 # 32-bit 2147491840 # 64-bit +Per coding style (:ref:`section-coding-python`), the magic comment +should be separated by at least 2 spaces. + +For multiline doctests, the comment should appear on the first +`physical line `_ +of the doctest (the line with the prompt ``sage:``), not on the +continuation lines (the lines with the prompt ``....:``):: + + sage: print(ZZ.random_element()) # random + 42 + sage: for _ in range(3): # random + ....: print(QQ.random_element()) + 1 + 1/77 + -1/2 + Using ``search_src`` from the Sage prompt (or ``grep``), one can easily find the aforementioned keywords. In the case of ``todo: not implemented``, one can use the results of such a search to direct diff --git a/src/doc/pt/tutorial/interfaces.rst b/src/doc/pt/tutorial/interfaces.rst index 3c080cc3cfc..386ef6456e5 100644 --- a/src/doc/pt/tutorial/interfaces.rst +++ b/src/doc/pt/tutorial/interfaces.rst @@ -233,8 +233,8 @@ cálculos). Não digite ``...``: sage: x, y = QQ['x, y'].gens() sage: f = 9*y^8 - 9*x^2*y^7 - 18*x^3*y^6 - 18*x^5*y^6 + 9*x^6*y^4 \ - ....: + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - 9*x^12*y^3 \ - ....: - 18*x^13*y^2 + 9*x^16 + ....: + 18*x^7*y^5 + 36*x^8*y^4 + 9*x^10*y^4 - 18*x^11*y^2 - 9*x^12*y^3 \ + ....: - 18*x^13*y^2 + 9*x^16 sage: factor(f) (9) * (-x^5 + y^2)^2 * (x^6 - 2*x^3*y^2 - x^2*y^3 + y^4) @@ -305,38 +305,38 @@ Um gráfico em duas dimensões de diversas funções (não digite ``...``): :: - sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested - ....: '[plot_format,openmath]') # not tested + sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]', '[x,0,1]', # not tested + ....: '[plot_format,openmath]') Um gráfico em 3D que você pode mover com o seu mouse: :: sage: maxima.plot3d("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested - ....: '[plot_format, openmath]') # not tested + ....: '[plot_format, openmath]') - sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested - ....: "[grid, 50, 50]",'[plot_format, openmath]') # not tested + sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested + ....: "[grid, 50, 50]",'[plot_format, openmath]') O próximo gráfico é a famosa faixa de Möbious: :: - sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2))," \ # not tested - ....: "y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]", # not tested - ....: '[plot_format, openmath]') # not tested + sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2))," # not tested + ....: "y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]", + ....: '[plot_format, openmath]') E agora a famosa garrafa de Klein: :: - sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)"\ - ....: "- 10.0") + sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)" + ....: "- 10.0") 5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0 sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)") -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) sage: maxima.plot3d("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested - ....: "[y, -%pi, %pi]", "['grid, 40, 40]", # not tested - ....: '[plot_format, openmath]') # not tested + ....: "[y, -%pi, %pi]", "['grid, 40, 40]", + ....: '[plot_format, openmath]') diff --git a/src/sage/calculus/ode.pyx b/src/sage/calculus/ode.pyx index 22d8d7d491e..5425a7b0131 100644 --- a/src/sage/calculus/ode.pyx +++ b/src/sage/calculus/ode.pyx @@ -327,12 +327,12 @@ class ode_solver(): sage: T = ode_solver() # not tested sage: T.algorithm = "bsimp" # not tested sage: vander = van_der_pol() # not tested - sage: T.function=vander # not tested - sage: T.ode_solve(y_0 = [1,0], t_span=[0,2000], # not tested - ....: num_points=1000) # not tested + sage: T.function = vander # not tested + sage: T.ode_solve(y_0=[1, 0], t_span=[0, 2000], # not tested + ....: num_points=1000) sage: from tempfile import NamedTemporaryFile # not tested sage: with NamedTemporaryFile(suffix=".png") as f: # not tested - ....: T.plot_solution(i=0, filename=f.name) # not tested + ....: T.plot_solution(i=0, filename=f.name) """ def __init__(self,function=None,jacobian=None,h = 1e-2,error_abs=1e-10,error_rel=1e-10, a=False,a_dydt=False,scale_abs=False,algorithm="rkf45",y_0=None,t_span=None,params = []): diff --git a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py index 004bc2331ce..b75cbcb3e5d 100644 --- a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py +++ b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py @@ -197,7 +197,7 @@ def simple_reflection(self, i): sage: W = ReflectionGroup((1,1,4), index_set=[1,3,'asdf']) # optional - gap3 sage: for i in W.index_set(): # optional - gap3 - ....: print('%s %s'%(i, W.simple_reflection(i))) # optional - gap3 + ....: print('%s %s'%(i, W.simple_reflection(i))) 1 (1,7)(2,4)(5,6)(8,10)(11,12) 3 (1,4)(2,8)(3,5)(7,10)(9,11) asdf (2,5)(3,9)(4,6)(8,11)(10,12) @@ -447,7 +447,7 @@ def reflection(self, i): sage: W = ReflectionGroup((1,1,4)) # optional - gap3 sage: for i in W.reflection_index_set(): # optional - gap3 - ....: print('%s %s'%(i, W.reflection(i))) # optional - gap3 + ....: print('%s %s'%(i, W.reflection(i))) 1 (1,7)(2,4)(5,6)(8,10)(11,12) 2 (1,4)(2,8)(3,5)(7,10)(9,11) 3 (2,5)(3,9)(4,6)(8,11)(10,12) @@ -472,7 +472,7 @@ def reflections(self): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: reflections = W.reflections() # optional - gap3 sage: for index in sorted(reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, reflections[index])) 1 (1,4)(2,3)(5,6) 2 (1,3)(2,5)(4,6) 3 (1,5)(2,4)(3,6) @@ -480,7 +480,7 @@ def reflections(self): sage: W = ReflectionGroup((1,1,3),reflection_index_set=['a','b','c']) # optional - gap3 sage: reflections = W.reflections() # optional - gap3 sage: for index in sorted(reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, reflections[index])) a (1,4)(2,3)(5,6) b (1,3)(2,5)(4,6) c (1,5)(2,4)(3,6) @@ -488,14 +488,14 @@ def reflections(self): sage: W = ReflectionGroup((3,1,1)) # optional - gap3 sage: reflections = W.reflections() # optional - gap3 sage: for index in sorted(reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, reflections[index])) 1 (1,2,3) 2 (1,3,2) sage: W = ReflectionGroup((1,1,3), (3,1,2)) # optional - gap3 sage: reflections = W.reflections() # optional - gap3 sage: for index in sorted(reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, reflections[index])) 1 (1,6)(2,5)(7,8) 2 (1,5)(2,7)(6,8) 3 (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30) @@ -562,7 +562,7 @@ def distinguished_reflection(self, i): sage: W = ReflectionGroup((1,1,4), hyperplane_index_set=('a','b','c','d','e','f')) # optional - gap3 sage: for i in W.hyperplane_index_set(): # optional - gap3 - ....: print('%s %s'%(i, W.distinguished_reflection(i))) # optional - gap3 + ....: print('%s %s'%(i, W.distinguished_reflection(i))) a (1,7)(2,4)(5,6)(8,10)(11,12) b (1,4)(2,8)(3,5)(7,10)(9,11) c (2,5)(3,9)(4,6)(8,11)(10,12) @@ -596,7 +596,7 @@ def distinguished_reflections(self): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: distinguished_reflections = W.distinguished_reflections() # optional - gap3 sage: for index in sorted(distinguished_reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, distinguished_reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, distinguished_reflections[index])) 1 (1,4)(2,3)(5,6) 2 (1,3)(2,5)(4,6) 3 (1,5)(2,4)(3,6) @@ -604,7 +604,7 @@ def distinguished_reflections(self): sage: W = ReflectionGroup((1,1,3),hyperplane_index_set=['a','b','c']) # optional - gap3 sage: distinguished_reflections = W.distinguished_reflections() # optional - gap3 sage: for index in sorted(distinguished_reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, distinguished_reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, distinguished_reflections[index])) a (1,4)(2,3)(5,6) b (1,3)(2,5)(4,6) c (1,5)(2,4)(3,6) @@ -612,13 +612,13 @@ def distinguished_reflections(self): sage: W = ReflectionGroup((3,1,1)) # optional - gap3 sage: distinguished_reflections = W.distinguished_reflections() # optional - gap3 sage: for index in sorted(distinguished_reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, distinguished_reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, distinguished_reflections[index])) 1 (1,2,3) sage: W = ReflectionGroup((1,1,3), (3,1,2)) # optional - gap3 sage: distinguished_reflections = W.distinguished_reflections() # optional - gap3 sage: for index in sorted(distinguished_reflections.keys()): # optional - gap3 - ....: print('%s %s'%(index, distinguished_reflections[index])) # optional - gap3 + ....: print('%s %s'%(index, distinguished_reflections[index])) 1 (1,6)(2,5)(7,8) 2 (1,5)(2,7)(6,8) 3 (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30) diff --git a/src/sage/categories/finite_complex_reflection_groups.py b/src/sage/categories/finite_complex_reflection_groups.py index f1897267140..dc604a26917 100644 --- a/src/sage/categories/finite_complex_reflection_groups.py +++ b/src/sage/categories/finite_complex_reflection_groups.py @@ -898,7 +898,7 @@ def generalized_noncrossing_partitions(self, m, c=None, positive=False): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: sorted([w.reduced_word() for w in chain] # optional - gap3 - ....: for chain in W.generalized_noncrossing_partitions(2)) # optional - gap3 + ....: for chain in W.generalized_noncrossing_partitions(2)) [[[], [], [1, 2]], [[], [1], [2]], [[], [1, 2], []], @@ -913,7 +913,7 @@ def generalized_noncrossing_partitions(self, m, c=None, positive=False): [[2], [1, 2, 1], []]] sage: sorted([w.reduced_word() for w in chain] # optional - gap3 - ....: for chain in W.generalized_noncrossing_partitions(2, positive=True)) # optional - gap3 + ....: for chain in W.generalized_noncrossing_partitions(2, positive=True)) [[[], [1, 2], []], [[], [1, 2, 1], [1]], [[1], [2], []], diff --git a/src/sage/combinat/abstract_tree.py b/src/sage/combinat/abstract_tree.py index f5008f1a826..b449cc89365 100644 --- a/src/sage/combinat/abstract_tree.py +++ b/src/sage/combinat/abstract_tree.py @@ -1937,8 +1937,8 @@ def __setitem_rec__(self, idx, i, value): TESTS:: sage: x = OrderedTree([[[], []],[[]]]) - sage: with x.clone() as x: - ....: x[0,1] = OrderedTree([[[]]]) # indirect doctest + sage: with x.clone() as x: # indirect doctest + ....: x[0,1] = OrderedTree([[[]]]) sage: x [[[], [[[]]]], [[]]] """ diff --git a/src/sage/combinat/crystals/alcove_path.py b/src/sage/combinat/crystals/alcove_path.py index 91923aee027..75badb3bde2 100644 --- a/src/sage/combinat/crystals/alcove_path.py +++ b/src/sage/combinat/crystals/alcove_path.py @@ -193,9 +193,9 @@ class CrystalOfAlcovePaths(UniqueRepresentation, Parent): sage: K = crystals.KirillovReshetikhin(['B',3,1],2,1) sage: T = crystals.TensorProduct(K,K) sage: g = T.digraph() #long time - sage: for e in g.edges(sort=False): #long time - ....: if e[0].phi(0) == 1 and e[2] == 0: #long time - ....: g.delete_edge(e) #long time + sage: for e in g.edges(sort=False): #long time + ....: if e[0].phi(0) == 1 and e[2] == 0: + ....: g.delete_edge(e) sage: C = crystals.AlcovePaths(['B',3,1],[0,2,0], highest_weight_crystal=False) sage: g2 = C.digraph() #long time diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index d850d6eeb8d..12e7604f8ad 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -772,8 +772,8 @@ def v_4_1_BIBD(v, check=True): sage: from sage.combinat.designs.bibd import v_4_1_BIBD # long time sage: for n in range(13,100): # long time - ....: if n%12 in [1,4]: # long time - ....: _ = v_4_1_BIBD(n, check = True) # long time + ....: if n%12 in [1,4]: + ....: _ = v_4_1_BIBD(n, check = True) TESTS: @@ -787,8 +787,8 @@ def v_4_1_BIBD(v, check=True): Check some larger `(v,4,1)`-BIBD (see :trac:`17557`):: sage: for v in range(400): # long time - ....: if v%12 in [1,4]: # long time - ....: _ = designs.balanced_incomplete_block_design(v,4) # long time + ....: if v%12 in [1,4]: + ....: _ = designs.balanced_incomplete_block_design(v,4) """ k = 4 if v == 0: @@ -1262,7 +1262,7 @@ def BIBD_5q_5_for_q_prime_power(q): sage: from sage.combinat.designs.bibd import BIBD_5q_5_for_q_prime_power sage: for q in [25, 45, 65, 85, 125, 145, 185, 205, 305, 405, 605]: # long time - ....: _ = BIBD_5q_5_for_q_prime_power(q/5) # long time + ....: _ = BIBD_5q_5_for_q_prime_power(q/5) """ from sage.rings.finite_rings.finite_field_constructor import FiniteField diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index 5ae0db2e294..bac1c481b89 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -2201,7 +2201,7 @@ def _latex_(self): # verify that :trac:`30976` is fixed sage: IS = IncidenceStructure([1,2,3], [[1,2], [2,3]]) sage: if latex.has_file("tikz.sty"): # optional - latex - ....: IS._latex_() # optional - latex + ....: IS._latex_() ...UserWarning: The hypergraph is drawn as a set of closed curves... \begin{tikzpicture}... diff --git a/src/sage/combinat/designs/orthogonal_arrays.py b/src/sage/combinat/designs/orthogonal_arrays.py index 388a3a777cc..58685efb162 100644 --- a/src/sage/combinat/designs/orthogonal_arrays.py +++ b/src/sage/combinat/designs/orthogonal_arrays.py @@ -1183,7 +1183,7 @@ def incomplete_orthogonal_array(k,n,holes,resolvable=False, existence=False): sage: iOA = designs.incomplete_orthogonal_array(10,153,[9]*10) # long time sage: OA9 = designs.orthogonal_arrays.build(10,9) # long time sage: for i in range(10): # long time - ....: iOA.extend([[153-9*(i+1)+x for x in B] for B in OA9]) # long time + ....: iOA.extend([[153-9*(i+1)+x for x in B] for B in OA9]) sage: is_orthogonal_array(iOA,10,153) # long time True diff --git a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py index fad25aff6da..2f69ddc6ad8 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py @@ -668,8 +668,8 @@ def thwart_lemma_3_5(k,n,m,a,b,c,d=0,complement=False,explain_construction=False ....: [10, 13, 78, 9, 9, 13, 1], ....: [10, 13, 79, 9, 9, 13, 1]] sage: for k,n,m,a,b,c,d in l: # not tested -- too long - ....: OA = thwart_lemma_3_5(k,n,m,a,b,c,d,complement=True) # not tested -- too long - ....: assert is_orthogonal_array(OA,k,n*m+a+b+c+d,verbose=True) # not tested -- too long + ....: OA = thwart_lemma_3_5(k,n,m,a,b,c,d,complement=True) + ....: assert is_orthogonal_array(OA,k,n*m+a+b+c+d,verbose=True) sage: print(designs.orthogonal_arrays.explain_construction(10,1046)) Lemma 3.5 with n=13,m=79,a=9,b=1,c=0,d=9 from: diff --git a/src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx b/src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx index 3fee26e2a22..53a0a586ff2 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +++ b/src/sage/combinat/designs/orthogonal_arrays_find_recursive.pyx @@ -541,7 +541,7 @@ cpdef find_thwart_lemma_3_5(int k,int N): 12 3994 (12, 19, 207, 16, 13, 13, 19, True) sage: for k,n in kn: # not tested -- too long - ....: assert designs.orthogonal_array(k,n,existence=True) is True # not tested -- too long + ....: assert designs.orthogonal_array(k,n,existence=True) is True """ from .orthogonal_arrays_build_recursive import thwart_lemma_3_5 cdef int n,m,a,b,c,d,NN,na,nb,nc diff --git a/src/sage/combinat/designs/resolvable_bibd.py b/src/sage/combinat/designs/resolvable_bibd.py index 944a1b6d4a7..abfb3d4630b 100644 --- a/src/sage/combinat/designs/resolvable_bibd.py +++ b/src/sage/combinat/designs/resolvable_bibd.py @@ -399,9 +399,9 @@ def v_4_1_rbibd(v,existence=False): TESTS:: - sage: for q in prime_powers(2,30): + sage: for q in prime_powers(2,30): # indirect doctest ....: if (3*q+1)%12 == 4: - ....: _ = designs.resolvable_balanced_incomplete_block_design(3*q+1,4) # indirect doctest + ....: _ = designs.resolvable_balanced_incomplete_block_design(3*q+1,4) """ # Volume 1, VII.7.5.a from [BJL99]_ if v%3 != 1 or not is_prime_power((v-1)//3): diff --git a/src/sage/combinat/designs/steiner_quadruple_systems.py b/src/sage/combinat/designs/steiner_quadruple_systems.py index ee8d8102f28..b5526a58f2d 100644 --- a/src/sage/combinat/designs/steiner_quadruple_systems.py +++ b/src/sage/combinat/designs/steiner_quadruple_systems.py @@ -705,8 +705,8 @@ def steiner_quadruple_system(n, check = False): TESTS:: sage: for n in range(4, 100): # long time - ....: if (n%6) in [2,4]: # long time - ....: sqs = designs.steiner_quadruple_system(n, check=True) # long time + ....: if (n%6) in [2,4]: + ....: sqs = designs.steiner_quadruple_system(n, check=True) """ n = int(n) if not ((n%6) in [2, 4]): diff --git a/src/sage/combinat/finite_state_machine.py b/src/sage/combinat/finite_state_machine.py index 29671fb28ed..2c1f52e9588 100644 --- a/src/sage/combinat/finite_state_machine.py +++ b/src/sage/combinat/finite_state_machine.py @@ -14121,8 +14121,8 @@ def __repr__(self): sage: T = Transducer([(0, 0, 0, 0)], ....: initial_states=[0], final_states=[0]) sage: it = FSMProcessIterator(T, input_tape=[0, 0]) - sage: for current in it: - ....: print(current) # indirect doctest + sage: for current in it: # indirect doctest + ....: print(current) process (1 branch) + at state 0 +-- tape at 1, [[0]] @@ -14289,10 +14289,10 @@ def _push_branch_(self, state, tape_cache, outputs): +-- tape at 0, [[]] + at state 'b' +-- tape at 0, [[]] - sage: it._push_branches_( + sage: it._push_branches_( # indirect doctest ....: A.state('c'), ....: deepcopy(it._current_[((0, 0),)][A.state('a')][0]), - ....: [[]]) # indirect doctest + ....: [[]]) sage: it._current_ process (3 branches) + at state 'a' diff --git a/src/sage/combinat/fqsym.py b/src/sage/combinat/fqsym.py index 14d39076494..03c53e6520b 100644 --- a/src/sage/combinat/fqsym.py +++ b/src/sage/combinat/fqsym.py @@ -1089,11 +1089,11 @@ def _M_to_F_on_basis(self, w): sage: M = FQSym.M() sage: F(M[3, 2, 1] - 4 * F[4, 2, 1, 3]) F[3, 2, 1] - 4*F[4, 2, 1, 3] - sage: all(F(M._M_to_F_on_basis(w)) == M[w] for i in range(5) + sage: all(F(M._M_to_F_on_basis(w)) == M[w] for i in range(5) # indirect doctest ....: for w in Permutations(i)) True sage: all(M(F(M[w])) == M[w] for i in range(5) - ....: for w in Permutations(i)) # indirect doctest + ....: for w in Permutations(i)) True sage: M[3, 2, 1] == F[3, 2, 1] True diff --git a/src/sage/combinat/integer_vector.py b/src/sage/combinat/integer_vector.py index 94a5010f445..fb20ab69f29 100644 --- a/src/sage/combinat/integer_vector.py +++ b/src/sage/combinat/integer_vector.py @@ -289,8 +289,8 @@ def gale_ryser_theorem(p1, p2, algorithm="gale", ....: print(s1, s2) sage: for algorithm in ["gale", "ryser"]: # long time - ....: for i in range(50): # long time - ....: test_algorithm(algorithm, 3, 10) # long time + ....: for i in range(50): + ....: test_algorithm(algorithm, 3, 10) Null matrix:: diff --git a/src/sage/combinat/parallelogram_polyomino.py b/src/sage/combinat/parallelogram_polyomino.py index 40ab068f205..43e644a3972 100644 --- a/src/sage/combinat/parallelogram_polyomino.py +++ b/src/sage/combinat/parallelogram_polyomino.py @@ -1024,44 +1024,44 @@ def check(self): sage: pp = ParallelogramPolyomino([[0, 1], [1, 0]]) sage: pp = ParallelogramPolyomino([[1], [1]]) - sage: pp = ParallelogramPolyomino( + sage: pp = ParallelogramPolyomino( # indirect doctest ....: [[1, 0], [0, 1]] - ....: ) # indirect doctest + ....: ) Traceback (most recent call last): ... ValueError: the lower and upper paths are crossing - sage: pp = ParallelogramPolyomino([[1], [0, 1]]) # indirect doctest + sage: pp = ParallelogramPolyomino([[1], [0, 1]]) # indirect doctest Traceback (most recent call last): ... ValueError: the lower and upper paths have different sizes (2 != 1) - sage: pp = ParallelogramPolyomino([[1], [0]]) # indirect doctest + sage: pp = ParallelogramPolyomino([[1], [0]]) # indirect doctest Traceback (most recent call last): ... ValueError: the two paths have distinct ends - sage: pp = ParallelogramPolyomino([[0], [1]]) # indirect doctest + sage: pp = ParallelogramPolyomino([[0], [1]]) # indirect doctest Traceback (most recent call last): ... ValueError: the two paths have distinct ends - sage: pp = ParallelogramPolyomino([[0], [0]]) # indirect doctest + sage: pp = ParallelogramPolyomino([[0], [0]]) # indirect doctest Traceback (most recent call last): ... ValueError: the lower or the upper path can...t be equal to [0] - sage: pp = ParallelogramPolyomino([[], [0]]) # indirect doctest + sage: pp = ParallelogramPolyomino([[], [0]]) # indirect doctest Traceback (most recent call last): ... ValueError: the lower or the upper path can...t be equal to [] - sage: pp = ParallelogramPolyomino([[0], []]) # indirect doctest + sage: pp = ParallelogramPolyomino([[0], []]) # indirect doctest Traceback (most recent call last): ... ValueError: the lower or the upper path can...t be equal to [] - sage: pp = ParallelogramPolyomino([[], []]) # indirect doctest + sage: pp = ParallelogramPolyomino([[], []]) # indirect doctest Traceback (most recent call last): ... ValueError: the lower or the upper path can...t be equal to [] @@ -4149,9 +4149,9 @@ def check_element(self, el, check): EXAMPLES:: sage: PPS = ParallelogramPolyominoes(3) - sage: ParallelogramPolyomino( + sage: ParallelogramPolyomino( # indirect doctest ....: [[0, 1, 1], [1, 1, 0]] - ....: ) in PPS # indirect doctest + ....: ) in PPS True """ if el.size() != self.size(): @@ -4322,9 +4322,9 @@ def check_element(self, el, check): EXAMPLES:: sage: PPS = ParallelogramPolyominoes() - sage: ParallelogramPolyomino( + sage: ParallelogramPolyomino( # indirect doctest ....: [[0, 1, 1], [1, 1, 0]] - ....: ) in PPS # indirect doctest + ....: ) in PPS True """ pass diff --git a/src/sage/combinat/root_system/reflection_group_complex.py b/src/sage/combinat/root_system/reflection_group_complex.py index fe3eae18357..68159babb11 100644 --- a/src/sage/combinat/root_system/reflection_group_complex.py +++ b/src/sage/combinat/root_system/reflection_group_complex.py @@ -534,7 +534,7 @@ def distinguished_reflection(self, i): sage: W = ReflectionGroup((1,1,3),(3,1,2)) # optional - gap3 sage: for i in range(W.number_of_reflection_hyperplanes()): # optional - gap3 - ....: W.distinguished_reflection(i+1) # optional - gap3 + ....: W.distinguished_reflection(i+1) (1,6)(2,5)(7,8) (1,5)(2,7)(6,8) (3,9,15)(4,10,16)(12,17,23)(14,18,24)(20,25,29)(21,22,26)(27,28,30) @@ -1136,7 +1136,7 @@ def reflection_eigenvalues_family(self): sage: W = ReflectionGroup((3,1,2)) # optional - gap3 sage: reflection_eigenvalues = W.reflection_eigenvalues_family() # optional - gap3 sage: for elt in sorted(reflection_eigenvalues.keys()): # optional - gap3 - ....: print('%s %s'%(elt, reflection_eigenvalues[elt])) # optional - gap3 + ....: print('%s %s'%(elt, reflection_eigenvalues[elt])) () [0, 0] (1,3,9)(2,4,10)(6,11,17)(8,12,18)(14,19,23)(15,16,20)(21,22,24) [1/3, 0] (1,3,9)(2,16,24)(4,20,21)(5,7,13)(6,12,23)(8,19,17)(10,15,22)(11,18,14) [1/3, 1/3] @@ -1150,7 +1150,7 @@ def reflection_eigenvalues_family(self): sage: W = ReflectionGroup(23) # optional - gap3 sage: reflection_eigenvalues = W.reflection_eigenvalues_family() # optional - gap3 sage: for elt in sorted(reflection_eigenvalues.keys()): # optional - gap3 - ....: print('%s %s'%(elt, reflection_eigenvalues[elt])) # optional - gap3 + ....: print('%s %s'%(elt, reflection_eigenvalues[elt])) () [0, 0, 0] (1,8,4)(2,21,3)(5,10,11)(6,18,17)(7,9,12)(13,14,15)(16,23,19)(20,25,26)(22,24,27)(28,29,30) [1/3, 2/3, 0] (1,16)(2,5)(4,7)(6,9)(8,10)(11,13)(12,14)(17,20)(19,22)(21,24)(23,25)(26,28)(27,29) [1/2, 0, 0] @@ -1183,7 +1183,7 @@ def reflection_eigenvalues(self, w, is_class_representative=False): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print('%s %s'%(w.reduced_word(), W.reflection_eigenvalues(w))) # optional - gap3 + ....: print('%s %s'%(w.reduced_word(), W.reflection_eigenvalues(w))) [] [0, 0] [2] [1/2, 0] [1] [1/2, 0] @@ -1634,10 +1634,10 @@ def invariant_form(self, brute_force=False): sage: tests = [['A',3],['B',3],['F',4],(4,2,2),4,7] # optional - gap3 sage: for ty in tests: # optional - gap3 - ....: W = ReflectionGroup(ty) # optional - gap3 - ....: A = W.invariant_form() # optional - gap3 - ....: B = W.invariant_form(brute_force=True) # optional - gap3 - ....: print("{} {}".format(ty, A == B/B[0,0])) # optional - gap3 + ....: W = ReflectionGroup(ty) + ....: A = W.invariant_form() + ....: B = W.invariant_form(brute_force=True) + ....: print("{} {}".format(ty, A == B/B[0,0])) ['A', 3] True ['B', 3] True ['F', 4] True @@ -1941,7 +1941,7 @@ def conjugacy_class_representative(self): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print('%s %s'%(w.reduced_word(), w.conjugacy_class_representative().reduced_word())) # optional - gap3 + ....: print('%s %s'%(w.reduced_word(), w.conjugacy_class_representative().reduced_word())) [] [] [2] [1] [1] [1] @@ -2085,7 +2085,7 @@ def is_coxeter_element(self, which_primitive=1, is_class_representative=False): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print('%s %s'%(w.reduced_word(), w.is_coxeter_element())) # optional - gap3 + ....: print('%s %s'%(w.reduced_word(), w.is_coxeter_element())) [] False [2] False [1] False @@ -2113,7 +2113,7 @@ def is_h_regular(self, is_class_representative=False): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print('%s %s'%(w.reduced_word(), w.is_h_regular())) # optional - gap3 + ....: print('%s %s'%(w.reduced_word(), w.is_h_regular())) [] False [2] False [1] False @@ -2157,8 +2157,8 @@ def is_regular(self, h, is_class_representative=False): sage: W = ReflectionGroup(23); h = W.coxeter_number() # optional - gap3 sage: for w in W: # optional - gap3 - ....: if w.is_regular(h): # optional - gap3 - ....: w.reduced_word() # optional - gap3 + ....: if w.is_regular(h): + ....: w.reduced_word() [1, 2, 3] [2, 1, 3] [1, 3, 2] diff --git a/src/sage/combinat/root_system/reflection_group_element.pyx b/src/sage/combinat/root_system/reflection_group_element.pyx index 5d6efdf5a76..65e41ff1726 100644 --- a/src/sage/combinat/root_system/reflection_group_element.pyx +++ b/src/sage/combinat/root_system/reflection_group_element.pyx @@ -197,11 +197,11 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): EXAMPLES:: - sage: W = ReflectionGroup((3,1,2)) # optional - gap3 + sage: W = ReflectionGroup((3,1,2)) # optional - gap3 sage: data = {w: [w.to_matrix(), w.to_matrix(on_space="dual")] for w in W} # optional - gap3 - sage: for w in W.iteration_tracking_words(): # optional - gap3 - ....: w.reduced_word() # optional - gap3 - ....: mats = [w.to_matrix(), w.to_matrix(on_space="dual")] # optional - gap3 + sage: for w in W.iteration_tracking_words(): # optional - gap3 + ....: w.reduced_word() + ....: mats = [w.to_matrix(), w.to_matrix(on_space="dual")] ....: mats ....: assert data[w] == mats [] @@ -369,7 +369,7 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): sage: W = ReflectionGroup((3,1,2)) # optional - gap3 sage: w = W.from_reduced_word([1, 2, 1, 1, 2]) # optional - gap3 sage: for alpha in W.independent_roots(): # optional - gap3 - ....: print("%s -> %s"%(alpha,w.action(alpha))) # optional - gap3 + ....: print("%s -> %s"%(alpha,w.action(alpha))) (1, 0) -> (E(3), 0) (-1, 1) -> (-E(3), E(3)^2) """ @@ -392,7 +392,7 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): sage: W = ReflectionGroup((3,1,2)) # optional - gap3 sage: w = W.from_reduced_word([1, 2, 1, 1, 2]) # optional - gap3 sage: for alpha in W.independent_roots(): # optional - gap3 - ....: print("%s -> %s"%(alpha, w * alpha)) # optional - gap3 + ....: print("%s -> %s"%(alpha, w * alpha)) (1, 0) -> (E(3), 0) (-1, 1) -> (-E(3), E(3)^2) """ @@ -444,8 +444,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), # optional - gap3 - ....: [w.action_on_root(beta,side="left") for beta in W.positive_roots()])) # optional - gap3 + ....: print("%s %s"%(w.reduced_word(), + ....: [w.action_on_root(beta,side="left") for beta in W.positive_roots()])) [] [(1, 0), (0, 1), (1, 1)] [2] [(1, 1), (0, -1), (1, 0)] [1] [(-1, 0), (1, 1), (0, 1)] @@ -495,8 +495,8 @@ cdef class ComplexReflectionGroupElement(PermutationGroupElement): sage: W = ReflectionGroup((1,1,3)) # optional - gap3 sage: for w in W: # optional - gap3 - ....: w.reduced_word() # optional - gap3 - ....: w.fix_space() # optional - gap3 + ....: w.reduced_word() + ....: w.fix_space() [] Vector space of degree 2 and dimension 2 over Rational Field Basis matrix: @@ -755,7 +755,7 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), w.length())) # optional - gap3 + ....: print("%s %s"%(w.reduced_word(), w.length())) [] 0 [2] 1 [1] 1 @@ -885,8 +885,8 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: w.reduced_word() # optional - gap3 - ....: [w.to_matrix(), w.to_matrix(on_space="dual")] # optional - gap3 + ....: w.reduced_word() + ....: [w.to_matrix(), w.to_matrix(on_space="dual")] [] [ [1 0] [1 0] @@ -977,8 +977,8 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), # optional - gap3 - ....: [w.action(weight,side="left") for weight in W.fundamental_weights()])) # optional - gap3 + ....: print("%s %s"%(w.reduced_word(), + ....: [w.action(weight,side="left") for weight in W.fundamental_weights()])) [] [(2/3, 1/3), (1/3, 2/3)] [2] [(2/3, 1/3), (1/3, -1/3)] [1] [(-1/3, 1/3), (1/3, 2/3)] @@ -990,10 +990,10 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['B',3]) # optional - gap3 sage: all(w.action(alpha,side="right") == w.action_on_root(alpha,side="right") # optional - gap3 - ....: for w in W for alpha in W.simple_roots()) # optional - gap3 + ....: for w in W for alpha in W.simple_roots()) True sage: all(w.action(alpha,side="left") == w.action_on_root(alpha,side="left") #optional - gap3 - ....: for w in W for alpha in W.simple_roots()) # optional - gap3 + ....: for w in W for alpha in W.simple_roots()) True """ W = self._parent @@ -1037,13 +1037,13 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: w = W.from_reduced_word([1,2]) # optional - gap3 sage: for root in W.positive_roots(): # optional - gap3 - ....: print("%s -> %s"%(root, w*root)) # optional - gap3 + ....: print("%s -> %s"%(root, w*root)) (1, 0) -> (0, 1) (0, 1) -> (-1, -1) (1, 1) -> (-1, 0) sage: for root in W.positive_roots(): # optional - gap3 - ....: print("%s -> %s"%(root, root*w)) # optional - gap3 + ....: print("%s -> %s"%(root, root*w)) (1, 0) -> (-1, -1) (0, 1) -> (1, 0) (1, 1) -> (0, -1) @@ -1102,8 +1102,8 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), # optional - gap3 - ....: [w.action_on_root(beta,side="left") for beta in W.positive_roots()])) # optional - gap3 + ....: print("%s %s"%(w.reduced_word(), + ....: [w.action_on_root(beta,side="left") for beta in W.positive_roots()])) [] [(1, 0), (0, 1), (1, 1)] [2] [(1, 1), (0, -1), (1, 0)] [1] [(-1, 0), (1, 1), (0, 1)] @@ -1113,8 +1113,8 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), # optional - gap3 - ....: [w.action_on_root(beta,side="right") for beta in W.positive_roots()])) # optional - gap3 + ....: print("%s %s"%(w.reduced_word(), + ....: [w.action_on_root(beta,side="right") for beta in W.positive_roots()])) [] [(1, 0), (0, 1), (1, 1)] [2] [(1, 1), (0, -1), (1, 0)] [1] [(-1, 0), (1, 1), (0, 1)] @@ -1136,7 +1136,7 @@ cdef class RealReflectionGroupElement(ComplexReflectionGroupElement): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), w.inversion_set())) # optional - gap3 + ....: print("%s %s"%(w.reduced_word(), w.inversion_set())) [] [] [2] [(0, 1)] [1] [(1, 0)] diff --git a/src/sage/combinat/root_system/reflection_group_real.py b/src/sage/combinat/root_system/reflection_group_real.py index 9d7c9a92bbf..3c507167b8d 100644 --- a/src/sage/combinat/root_system/reflection_group_real.py +++ b/src/sage/combinat/root_system/reflection_group_real.py @@ -326,7 +326,7 @@ def iteration(self, algorithm="breadth", tracking_words=True): sage: W = ReflectionGroup(["B",2]) # optional - gap3 sage: for w in W.iteration("breadth",True): # optional - gap3 - ....: print("%s %s"%(w, w._reduced_word)) # optional - gap3 + ....: print("%s %s"%(w, w._reduced_word)) () [] (1,3)(2,6)(5,7) [1] (1,5)(2,4)(6,8) [0] @@ -567,7 +567,7 @@ def fundamental_weights(self): sage: S = W.simple_reflections() # optional - gap3 sage: N = W.fundamental_weights() # optional - gap3 sage: for i in W.index_set(): # optional - gap3 - ....: for j in W.index_set(): # optional - gap3 + ....: for j in W.index_set(): ....: print("{} {} {} {}".format(i, j, N[i], N[i]*S[j].to_matrix())) 1 1 (3/4, 1/2, 1/4) (-1/4, 1/2, 1/4) 1 2 (3/4, 1/2, 1/4) (3/4, 1/2, 1/4) @@ -801,9 +801,9 @@ def right_coset_representatives(self): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: rcr = w.right_coset_representatives() # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), # optional - gap3 - ....: [v.reduced_word() for v in rcr])) # optional - gap3 + ....: rcr = w.right_coset_representatives() + ....: print("%s %s"%(w.reduced_word(), + ....: [v.reduced_word() for v in rcr])) [] [[], [2], [1], [2, 1], [1, 2], [1, 2, 1]] [2] [[], [2], [1]] [1] [[], [1], [1, 2]] @@ -830,9 +830,9 @@ def left_coset_representatives(self): sage: W = ReflectionGroup(['A',2]) # optional - gap3 sage: for w in W: # optional - gap3 - ....: lcr = w.left_coset_representatives() # optional - gap3 - ....: print("%s %s"%(w.reduced_word(), # optional - gap3 - ....: [v.reduced_word() for v in lcr])) # optional - gap3 + ....: lcr = w.left_coset_representatives() + ....: print("%s %s"%(w.reduced_word(), + ....: [v.reduced_word() for v in lcr])) [] [[], [2], [1], [1, 2], [2, 1], [1, 2, 1]] [2] [[], [2], [1]] [1] [[], [1], [2, 1]] diff --git a/src/sage/combinat/shifted_primed_tableau.py b/src/sage/combinat/shifted_primed_tableau.py index 5b3354953f4..2ca02da12da 100644 --- a/src/sage/combinat/shifted_primed_tableau.py +++ b/src/sage/combinat/shifted_primed_tableau.py @@ -2673,8 +2673,8 @@ def _add_strip(sub_tab, full_tab, length): sage: list(ShiftedPrimedTableaux([3,1], weight=(2,2))) # indirect doctest [[(1, 1, 2), (2,)], [(1, 1, 2'), (2,)]] - sage: list(ShiftedPrimedTableaux([3,1], weight=(2,2), - ....: primed_diagonal=True)) # indirect doctest + sage: list(ShiftedPrimedTableaux([3,1], weight=(2,2), # indirect doctest + ....: primed_diagonal=True)) [[(1, 1, 2), (2,)], [(1, 1, 2), (2',)], [(1, 1, 2'), (2,)], diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index aa1268a6a27..3809ee07ecc 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -243,7 +243,8 @@ def skipfile(filename, tested_optional_tags=False): sage: skipfile(filename) True sage: with open(filename, "w") as f: - ....: _ = f.write("# sage.doctest: optional - xyz") + ....: _ = f.write("# sage.doctest: " # broken in two source lines to avoid the pattern + ....: "optional - xyz") # of relint (multiline_doctest_comment) sage: skipfile(filename, False) 'optional - xyz' sage: bool(skipfile(filename, False)) diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py index 83f310e8b98..3e2570e889e 100644 --- a/src/sage/functions/other.py +++ b/src/sage/functions/other.py @@ -1819,10 +1819,10 @@ def __init__(self): product(sin(m), m, 1, n) sage: isinstance(r.operator(), sage.functions.other.Function_prod) True - sage: r = sympy(sprod(sin(m), m, 1, n)).sage(); r # known bug + sage: r = sympy(sprod(sin(m), m, 1, n)).sage(); r # known bug product(sin(m), m, 1, n) - sage: isinstance(r.operator(), - ....: sage.functions.other.Function_prod) # known bug + sage: isinstance(r.operator(), # known bug + ....: sage.functions.other.Function_prod) True sage: giac(sprod(m, m, 1, n)).sage() factorial(n) diff --git a/src/sage/geometry/cone.py b/src/sage/geometry/cone.py index 1b0a74d9111..e4be119d032 100644 --- a/src/sage/geometry/cone.py +++ b/src/sage/geometry/cone.py @@ -6458,9 +6458,9 @@ def random_cone(lattice=None, min_ambient_dim=0, max_ambient_dim=None, we will loop with an absurd, unattainable, number of rays:: sage: K = random_cone(min_ambient_dim=3, # long time - ....: max_ambient_dim=3, # long time - ....: min_rays=7, # long time - ....: max_rays=9) # long time + ....: max_ambient_dim=3, + ....: min_rays=7, + ....: max_rays=9) sage: K.nrays() >= 7 # long time True sage: K.lattice_dim() # long time diff --git a/src/sage/geometry/lattice_polytope.py b/src/sage/geometry/lattice_polytope.py index 9745bc14c49..778e7934d3f 100644 --- a/src/sage/geometry/lattice_polytope.py +++ b/src/sage/geometry/lattice_polytope.py @@ -3182,10 +3182,11 @@ def _palp_PM_max(self, check=False): ((2,3), (2,3)), ((1,2), (1,2)), ((1,3), (1,3))] - sage: PMs = [i._palp_PM_max(check=True) - ....: for i in ReflexivePolytopes(2)] # long time - sage: all(len(i) == len(j.automorphisms_of_rows_and_columns()) - ....: for j, i in PMs) # long time + sage: PMs = ( i._palp_PM_max(check=True) + ....: for i in ReflexivePolytopes(2) ) + sage: results = ( len(i) == len(j.automorphisms_of_rows_and_columns()) + ....: for j, i in PMs ) + sage: all(results) # long time True """ def PGE(S, u, v): diff --git a/src/sage/geometry/polyhedron/backend_cdd.py b/src/sage/geometry/polyhedron/backend_cdd.py index 442aabbd328..f0e7e3ada8b 100644 --- a/src/sage/geometry/polyhedron/backend_cdd.py +++ b/src/sage/geometry/polyhedron/backend_cdd.py @@ -54,8 +54,8 @@ def _init_from_Vrepresentation(self, vertices, rays, lines, verbose=False): EXAMPLES:: - sage: Polyhedron(vertices=[(0,0)], rays=[(1,1)], - ....: lines=[(1,-1)], backend='cdd', base_ring=QQ) # indirect doctest + sage: Polyhedron(vertices=[(0,0)], rays=[(1,1)], # indirect doctest + ....: lines=[(1,-1)], backend='cdd', base_ring=QQ) A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex, 1 ray, 1 line """ @@ -106,8 +106,8 @@ def _init_from_Hrepresentation(self, ieqs, eqns, verbose=False): EXAMPLES:: - sage: Polyhedron(ieqs=[(0,1,1)], eqns=[(0,1,-1)], - ....: backend='cdd', base_ring=QQ) # indirect doctest + sage: Polyhedron(ieqs=[(0,1,1)], eqns=[(0,1,-1)], # indirect doctest + ....: backend='cdd', base_ring=QQ) A 1-dimensional polyhedron in QQ^2 defined as the convex hull of 1 vertex and 1 ray @@ -217,7 +217,7 @@ def _init_from_cdd_output(self, cddout): TESTS:: - sage: p = Polyhedron(vertices = [[0,0],[1,0],[0,1],[1,1]], backend='cdd', base_ring=QQ) # indirect doctest + sage: p = Polyhedron(vertices = [[0,0],[1,0],[0,1],[1,1]], backend='cdd', base_ring=QQ) # indirect doctest sage: p.vertices() (A vertex at (0, 0), A vertex at (1, 0), A vertex at (0, 1), A vertex at (1, 1)) diff --git a/src/sage/geometry/polyhedron/backend_cdd_rdf.py b/src/sage/geometry/polyhedron/backend_cdd_rdf.py index 2f3795a4b0f..afcf08d28bf 100644 --- a/src/sage/geometry/polyhedron/backend_cdd_rdf.py +++ b/src/sage/geometry/polyhedron/backend_cdd_rdf.py @@ -123,8 +123,8 @@ def _init_from_Vrepresentation_and_Hrepresentation(self, Vrep, Hrep, verbose=Fal sage: parent = Polyhedra_RDF_cdd(RDF, 1, 'cdd') sage: Vrep = [[[0.0], [1.0]], [], []] sage: Hrep = [[[0.0, 1.0], [1.0, -1.0]], []] - sage: p = Polyhedron_RDF_cdd(parent, Vrep, Hrep, - ....: Vrep_minimal=True, Hrep_minimal=True) # indirect doctest + sage: p = Polyhedron_RDF_cdd(parent, Vrep, Hrep, # indirect doctest + ....: Vrep_minimal=True, Hrep_minimal=True) sage: p A 1-dimensional polyhedron in RDF^1 defined as the convex hull of 2 vertices @@ -144,8 +144,8 @@ def _init_from_Vrepresentation_and_Hrepresentation(self, Vrep, Hrep, verbose=Fal sage: Vrep = [[], [], [[1.0]]] sage: Hrep = [[], []] - sage: p = Polyhedron_RDF_cdd(parent, Vrep, Hrep, - ....: Vrep_minimal=True, Hrep_minimal=True) # indirect doctest + sage: p = Polyhedron_RDF_cdd(parent, Vrep, Hrep, # indirect doctest + ....: Vrep_minimal=True, Hrep_minimal=True) sage: p A 1-dimensional polyhedron in RDF^1 defined as the convex hull of 1 vertex and 1 line diff --git a/src/sage/geometry/polyhedron/backend_field.py b/src/sage/geometry/polyhedron/backend_field.py index 996d6c1a7ac..2183b0a92b6 100644 --- a/src/sage/geometry/polyhedron/backend_field.py +++ b/src/sage/geometry/polyhedron/backend_field.py @@ -248,7 +248,8 @@ def _init_Vrepresentation(self, vertices, rays, lines): sage: Vrep = [[[0], [1]], [], []] sage: Hrep = [[[0, 1], [1, -1]], []] sage: p = Polyhedron_field(parent, Vrep, Hrep, # indirect doctest # optional - sage.rings.number_field - ....: Vrep_minimal=True, Hrep_minimal=True) + ....: Vrep_minimal=True, + ....: Hrep_minimal=True) sage: p.vertices_list() # optional - sage.rings.number_field [[0], [1]] """ @@ -268,8 +269,10 @@ def _init_Vrepresentation_backend(self, Vrep): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,1/sqrt(2)),(sqrt(2),0),(4,sqrt(5)/6)], # optional - sage.rings.number_field - ....: base_ring=AA, backend='field') # indirect doctest + sage: p = Polyhedron(vertices=[(0, 1/sqrt(2)), # indirect doctest # optional - sage.rings.number_field + ....: (sqrt(2), 0), + ....: (4, sqrt(5)/6)], + ....: base_ring=AA, backend='field') sage: p.Hrepresentation() # optional - sage.rings.number_field (An inequality (-0.1582178750233332?, 1.097777812326429?) x + 0.2237538646678492? >= 0, An inequality (-0.1419794359520263?, -1.698172434277148?) x + 1.200789243901438? >= 0, @@ -311,8 +314,10 @@ def _init_Hrepresentation_backend(self, Hrep): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,1/sqrt(2)),(sqrt(2),0),(4,sqrt(5)/6)], # optional - sage.rings.number_field - ....: base_ring=AA, backend='field') # indirect doctest + sage: p = Polyhedron(vertices=[(0, 1/sqrt(2)), # indirect doctest # optional - sage.rings.number_field + ....: (sqrt(2), 0), + ....: (4, sqrt(5)/6)], + ....: base_ring=AA, backend='field') sage: p.Hrepresentation() # optional - sage.rings.number_field (An inequality (-0.1582178750233332?, 1.097777812326429?) x + 0.2237538646678492? >= 0, An inequality (-0.1419794359520263?, -1.698172434277148?) x + 1.200789243901438? >= 0, diff --git a/src/sage/geometry/polyhedron/backend_normaliz.py b/src/sage/geometry/polyhedron/backend_normaliz.py index af0c2c459a7..8499e3704d0 100644 --- a/src/sage/geometry/polyhedron/backend_normaliz.py +++ b/src/sage/geometry/polyhedron/backend_normaliz.py @@ -2222,7 +2222,8 @@ class functions. G = `\Zmod{2}` act on P as follows:: sage: P = Polyhedron(vertices=[[0,0,1],[0,0,-1],[1,0,1],[-1,0,-1],[0,1,1], # optional - pynormaliz - ....: [0,-1,-1],[1,1,1],[-1,-1,-1]],backend='normaliz') # optional - pynormaliz + ....: [0,-1,-1],[1,1,1],[-1,-1,-1]], + ....: backend='normaliz') sage: K = P.restricted_automorphism_group(output = 'permutation') # optional - pynormaliz sage: G = K.subgroup(gens = [K([(0,2),(1,3),(4,6),(5,7)])]) # optional - pynormaliz sage: conj_reps = G.conjugacy_classes_representatives() # optional - pynormaliz @@ -2447,7 +2448,8 @@ class functions of the acting group. A character `\rho` is effective if If the `H^*`-series is not polynomial, then it is not effective:: sage: P = Polyhedron(vertices=[[0,0,1],[0,0,-1],[1,0,1],[-1,0,-1],[0,1,1], # optional - pynormaliz - ....: [0,-1,-1],[1,1,1],[-1,-1,-1]],backend='normaliz') # optional - pynormaliz + ....: [0,-1,-1],[1,1,1],[-1,-1,-1]], + ....: backend='normaliz') sage: G = P.restricted_automorphism_group(output = 'permutation') # optional - pynormaliz sage: H = G.subgroup(gens = [G([(0,2),(1,3),(4,6),(5,7)])]) # optional - pynormaliz sage: Hstar = P.Hstar_function(H); Hstar # optional - pynormaliz diff --git a/src/sage/geometry/polyhedron/backend_ppl.py b/src/sage/geometry/polyhedron/backend_ppl.py index 1caafb52a93..364dc219776 100644 --- a/src/sage/geometry/polyhedron/backend_ppl.py +++ b/src/sage/geometry/polyhedron/backend_ppl.py @@ -281,8 +281,8 @@ def _init_Vrepresentation_from_ppl(self, minimize): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,1/2),(2,0),(4,5/6)], - ....: backend='ppl') # indirect doctest + sage: p = Polyhedron(vertices=[(0,1/2), (2,0), (4,5/6)], # indirect doctest + ....: backend='ppl') sage: p.Hrepresentation() (An inequality (1, 4) x - 2 >= 0, An inequality (1, -12) x + 6 >= 0, @@ -321,8 +321,8 @@ def _init_Hrepresentation_from_ppl(self, minimize): EXAMPLES:: - sage: p = Polyhedron(vertices=[(0,1/2),(2,0),(4,5/6)], - ....: backend='ppl') # indirect doctest + sage: p = Polyhedron(vertices=[(0,1/2), (2,0), (4,5/6)], # indirect doctest + ....: backend='ppl') sage: p.Hrepresentation() (An inequality (1, 4) x - 2 >= 0, An inequality (1, -12) x + 6 >= 0, diff --git a/src/sage/geometry/polyhedron/base_QQ.py b/src/sage/geometry/polyhedron/base_QQ.py index c41c5e39daf..0c1cec7fedf 100644 --- a/src/sage/geometry/polyhedron/base_QQ.py +++ b/src/sage/geometry/polyhedron/base_QQ.py @@ -1030,7 +1030,8 @@ class functions. G = `\Zmod{2}` act on P as follows:: sage: P = Polyhedron(vertices=[[0,0,1],[0,0,-1],[1,0,1],[-1,0,-1],[0,1,1], # optional - pynormaliz - ....: [0,-1,-1],[1,1,1],[-1,-1,-1]],backend='normaliz') # optional - pynormaliz + ....: [0,-1,-1],[1,1,1],[-1,-1,-1]], + ....: backend='normaliz') sage: K = P.restricted_automorphism_group(output = 'permutation') # optional - pynormaliz sage: G = K.subgroup(gens = [K([(0,2),(1,3),(4,6),(5,7)])]) # optional - pynormaliz sage: conj_reps = G.conjugacy_classes_representatives() # optional - pynormaliz @@ -1165,7 +1166,8 @@ class functions of the acting group. A character `\rho` is effective if If the `H^*`-series is not polynomial, then it is not effective:: sage: P = Polyhedron(vertices=[[0,0,1],[0,0,-1],[1,0,1],[-1,0,-1],[0,1,1], # optional - pynormaliz - ....: [0,-1,-1],[1,1,1],[-1,-1,-1]],backend='normaliz') # optional - pynormaliz + ....: [0,-1,-1],[1,1,1],[-1,-1,-1]], + ....: backend='normaliz') sage: G = P.restricted_automorphism_group(output = 'permutation') # optional - pynormaliz sage: H = G.subgroup(gens = [G([(0,2),(1,3),(4,6),(5,7)])]) # optional - pynormaliz sage: Hstar = P.Hstar_function(H); Hstar # optional - pynormaliz diff --git a/src/sage/geometry/polyhedron/base_ZZ.py b/src/sage/geometry/polyhedron/base_ZZ.py index 4255f0232df..35b5346f924 100644 --- a/src/sage/geometry/polyhedron/base_ZZ.py +++ b/src/sage/geometry/polyhedron/base_ZZ.py @@ -412,7 +412,7 @@ def ehrhart_polynomial(self, engine=None, variable='t', verbose=False, dual=None t^6 + 6*t^5 + 15*t^4 + 20*t^3 + 15*t^2 + 6*t + 1 sage: def hypercube(d): - ....: return Polyhedron(vertices=list(product([0,1],repeat=d)),backend='normaliz') # optional - pynormaliz + ....: return Polyhedron(vertices=list(product([0,1],repeat=d)),backend='normaliz') sage: hypercube(3).ehrhart_polynomial(engine='normaliz') # optional - pynormaliz t^3 + 3*t^2 + 3*t + 1 sage: hypercube(4).ehrhart_polynomial(engine='normaliz') # optional - pynormaliz diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx index 833455f1371..a415bc44671 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx @@ -355,8 +355,8 @@ cdef class CombinatorialPolyhedron(SageObject): TESTS:: - sage: C = CombinatorialPolyhedron([[0,1,2],[0,1,3], - ....: [0,2,3],[1,2,3]]) # indirect doctest + sage: C = CombinatorialPolyhedron([[0,1,2], [0,1,3], # indirect doctest + ....: [0,2,3], [1,2,3]]) sage: TestSuite(sage.geometry.polyhedron.combinatorial_polyhedron.base.CombinatorialPolyhedron).run() """ diff --git a/src/sage/graphs/base/c_graph.pyx b/src/sage/graphs/base/c_graph.pyx index ae5461c72df..f47ebc07628 100644 --- a/src/sage/graphs/base/c_graph.pyx +++ b/src/sage/graphs/base/c_graph.pyx @@ -4586,7 +4586,7 @@ cdef class CGraphBackend(GenericGraphBackend): ....: return h ... sage: all( random_acyclic(100, .2).is_directed_acyclic() # long time - ....: for i in range(50)) # long time + ....: for i in range(50)) True TESTS:: diff --git a/src/sage/graphs/bliss.pyx b/src/sage/graphs/bliss.pyx index 8c99ae1a184..86af7ea988e 100644 --- a/src/sage/graphs/bliss.pyx +++ b/src/sage/graphs/bliss.pyx @@ -708,12 +708,12 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True): sage: G = Graph(graphs.CompleteMultipartiteGraph([8, 2]), sparse=True) # optional - bliss sage: for i,j in G.edges(labels=False, sort=False): # optional - bliss - ....: if 0 <= i < 3: # optional - bliss - ....: G.set_edge_label(i, j, "A") # optional - bliss - ....: if 3 <= i < 6: # optional - bliss - ....: G.set_edge_label(i, j, "B") # optional - bliss - ....: if 6 <= i < 8: # optional - bliss - ....: G.set_edge_label(i, j, "C") # optional - bliss + ....: if 0 <= i < 3: + ....: G.set_edge_label(i, j, "A") + ....: if 3 <= i < 6: + ....: G.set_edge_label(i, j, "B") + ....: if 6 <= i < 8: + ....: G.set_edge_label(i, j, "C") sage: factor(automorphism_group(G).cardinality()) # optional - bliss 2^4 * 3^2 @@ -740,12 +740,12 @@ cpdef automorphism_group(G, partition=None, use_edge_labels=True): sage: G = Graph(graphs.CompleteMultipartiteGraph([8,8,8,5]),sparse=True)# optional - bliss sage: for i,j in G.edges(labels=False, sort=False): # optional - bliss - ....: if 0 <= i < 3: # optional - bliss - ....: G.set_edge_label(i, j, "A") # optional - bliss - ....: if 3 <= i < 6: # optional - bliss - ....: G.set_edge_label(i, j, "B") # optional - bliss - ....: if 6 <= i < 8: # optional - bliss - ....: G.set_edge_label(i, j, "C") # optional - bliss + ....: if 0 <= i < 3: + ....: G.set_edge_label(i, j, "A") + ....: if 3 <= i < 6: + ....: G.set_edge_label(i, j, "B") + ....: if 6 <= i < 8: + ....: G.set_edge_label(i, j, "C") sage: automorphism_group(G).cardinality() == prod( factorial(n) for n in [3,3,2,8,8,5,2] ) # optional - bliss True sage: automorphism_group(G, use_edge_labels=False).cardinality() == prod( factorial(n) for n in [8,8,8,5,3] ) # optional - bliss diff --git a/src/sage/graphs/digraph.py b/src/sage/graphs/digraph.py index 6f53142db9e..2a63c18f3b1 100644 --- a/src/sage/graphs/digraph.py +++ b/src/sage/graphs/digraph.py @@ -987,7 +987,7 @@ def is_directed_acyclic(self, certificate=False): ....: return h ... sage: all(random_acyclic(100, .2).is_directed_acyclic() # long time - ....: for i in range(50)) # long time + ....: for i in range(50)) True TESTS: diff --git a/src/sage/graphs/generators/random.py b/src/sage/graphs/generators/random.py index 1b0f4cd9d4d..c2d43aae2d7 100644 --- a/src/sage/graphs/generators/random.py +++ b/src/sage/graphs/generators/random.py @@ -1443,8 +1443,8 @@ def RandomTreePowerlaw(n, gamma=3, tries=1000, seed=None): :: sage: G = graphs.RandomTreePowerlaw(15, 2) - sage: if G: - ....: G.show() # random output, long time + sage: if G: # random output, long time + ....: G.show() """ if seed is None: seed = int(current_randstate().long_seed() % sys.maxsize) @@ -1483,8 +1483,8 @@ def RandomRegular(d, n, seed=None): :: sage: G = graphs.RandomRegular(3, 20) - sage: if G: - ....: G.show() # random output, long time + sage: if G: # random output, long time + ....: G.show() REFERENCES: diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 8a95e53d8f8..29c33406774 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py @@ -21181,9 +21181,9 @@ def show3d(self, bgcolor=(1, 1, 1), vertex_colors=None, vertex_size=0.06, sage: A5 = AlternatingGroup(5); A5 Alternating group of order 5!/2 as a permutation group sage: G = A5.cayley_graph() - sage: G.show3d(vertex_size=0.03, edge_size=0.01, edge_size2=0.02, + sage: G.show3d(vertex_size=0.03, edge_size=0.01, edge_size2=0.02, # long time ....: vertex_colors={(1,1,1): list(G)}, bgcolor=(0,0,0), - ....: color_by_label=True, iterations=200) # long time + ....: color_by_label=True, iterations=200) Some :class:`~sage.plot.plot3d.tachyon.Tachyon` examples:: diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py index a2adea43d04..5e1f32703bd 100644 --- a/src/sage/graphs/graph.py +++ b/src/sage/graphs/graph.py @@ -6713,9 +6713,9 @@ def clique_number(self, algorithm="Cliquer", cliques=None, solver=None, verbose= sage: g.clique_number(algorithm="MILP") 2 sage: for i in range(10): # optional - mcqd - ....: g = graphs.RandomGNP(15,.5) # optional - mcqd - ....: if g.clique_number() != g.clique_number(algorithm="mcqd"): # optional - mcqd - ....: print("This is dead wrong !") # optional - mcqd + ....: g = graphs.RandomGNP(15,.5) + ....: if g.clique_number() != g.clique_number(algorithm="mcqd"): + ....: print("This is dead wrong !") """ self._scream_if_not_simple(allow_loops=False) if algorithm == "Cliquer": diff --git a/src/sage/graphs/graph_editor.py b/src/sage/graphs/graph_editor.py index d4d8722369f..fc1fc72ccc8 100644 --- a/src/sage/graphs/graph_editor.py +++ b/src/sage/graphs/graph_editor.py @@ -64,10 +64,10 @@ def graph_editor(graph=None, **display_options): Using different display options:: - sage: e = graph_editor(graphs.PetersenGraph(), width=300, height=300, # optional - phitigra - ....: default_radius=12, default_vertex_color='orange', # optional - phitigra - ....: default_edge_color='#666', show_vertex_labels=False) # optional - phitigra - sage: e.show() # not tested + sage: e = graph_editor(graphs.PetersenGraph(), width=300, height=300, # optional - phitigra + ....: default_radius=12, default_vertex_color='orange', + ....: default_edge_color='#666', show_vertex_labels=False) + sage: e.show() # not tested .. NOTE:: diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py index df88bbe2713..de21154bbb2 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- r""" Common graphs @@ -682,7 +681,7 @@ class GraphGenerators(): sage: L = list(graphs(5,augment='vertices',loops=True)) # long time sage: for i in [0..5]: # long time - ....: print((i, len([g for g in L if g.order() == i]))) # long time + ....: print((i, len([g for g in L if g.order() == i]))) (0, 1) (1, 2) (2, 6) @@ -1752,10 +1751,10 @@ def plantri_gen(self, options=""): An overview of the number of quadrangulations on up to 12 vertices. This agrees with :oeis:`A113201`:: - sage: for i in range(4,13): # optional plantri - ....: cmd = '-qm2c2 {}'.format(i) # optional plantri - ....: L = len(list(graphs.plantri_gen(cmd))) # optional plantri - ....: print("{:2d} {:3d}".format(i, L)) # optional plantri + sage: for i in range(4, 13): # optional plantri + ....: cmd = '-qm2c2 {}'.format(i) + ....: L = len(list(graphs.plantri_gen(cmd))) + ....: print("{:2d} {:3d}".format(i, L)) 4 1 5 1 6 2 @@ -2115,8 +2114,8 @@ def triangulations(self, order, minimum_degree=None, minimum_connectivity=None, agrees with :oeis:`A081621`:: sage: for i in range(12, 23): # optional plantri - ....: L = len(list(graphs.triangulations(i, minimum_connectivity=5))) # optional plantri - ....: print("{} {:3d}".format(i,L)) # optional plantri + ....: L = len(list(graphs.triangulations(i, minimum_connectivity=5))) + ....: print("{} {:3d}".format(i,L)) 12 1 13 0 14 1 @@ -2273,8 +2272,8 @@ def quadrangulations(self, order, minimum_degree=None, minimum_connectivity=None agrees with :oeis:`A113201`:: sage: for i in range(4,13): # optional plantri - ....: L = len(list(graphs.quadrangulations(i))) # optional plantri - ....: print("{:2d} {:3d}".format(i,L)) # optional plantri + ....: L = len(list(graphs.quadrangulations(i))) + ....: print("{:2d} {:3d}".format(i,L)) 4 1 5 1 6 2 diff --git a/src/sage/graphs/graph_plot_js.py b/src/sage/graphs/graph_plot_js.py index 3843cafec07..cf7e37dce4b 100644 --- a/src/sage/graphs/graph_plot_js.py +++ b/src/sage/graphs/graph_plot_js.py @@ -183,7 +183,7 @@ def gen_html_code(G, sage: g.show(method="js", vertex_labels=True,edge_labels=True, ....: link_distance=200, gravity=.05, charge=-500, ....: edge_partition=[[("11", "12", "2"), ("21", "21", "a")]], - ....: edge_thickness=4) # optional -- internet + ....: edge_thickness=4) TESTS:: diff --git a/src/sage/graphs/line_graph.pyx b/src/sage/graphs/line_graph.pyx index 426bb4feaf3..9b0b1b6156a 100644 --- a/src/sage/graphs/line_graph.pyx +++ b/src/sage/graphs/line_graph.pyx @@ -442,9 +442,9 @@ def root_graph(g, verbose=False): ....: gl = g.line_graph(labels=False) ....: d = root_graph(gl) sage: for i,g in enumerate(graphs(6)): # long time - ....: if not g.is_connected(): # long time - ....: continue # long time - ....: test(g) # long time + ....: if not g.is_connected(): + ....: continue + ....: test(g) Non line-graphs:: diff --git a/src/sage/graphs/strongly_regular_db.pyx b/src/sage/graphs/strongly_regular_db.pyx index 945b2301159..04aa1322837 100644 --- a/src/sage/graphs/strongly_regular_db.pyx +++ b/src/sage/graphs/strongly_regular_db.pyx @@ -2873,13 +2873,13 @@ def strongly_regular_graph(int v, int k, int l, int mu=-1, bint existence=False, sage: from sage.graphs.strongly_regular_db import apparently_feasible_parameters sage: for p in sorted(apparently_feasible_parameters(1300)): # not tested - ....: if graphs.strongly_regular_graph(*p,existence=True) is True: # not tested - ....: try: # not tested - ....: _ = graphs.strongly_regular_graph(*p) # not tested - ....: print(p, "built successfully") # not tested - ....: except RuntimeError as e: # not tested - ....: if 'Brouwer' not in str(e): # not tested - ....: raise # not tested + ....: if graphs.strongly_regular_graph(*p,existence=True) is True: + ....: try: + ....: _ = graphs.strongly_regular_graph(*p) + ....: print(p, "built successfully") + ....: except RuntimeError as e: + ....: if 'Brouwer' not in str(e): + ....: raise `\mu=0` behaves correctly (:trac:`19712`):: diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py index e5eccd45942..32a434d3bd9 100644 --- a/src/sage/groups/fqf_orthogonal.py +++ b/src/sage/groups/fqf_orthogonal.py @@ -512,9 +512,9 @@ def _isom_fqf(A, B=None): TESTS:: sage: for p in primes_first_n(7)[1:]: # long time - ....: q = matrix.diagonal(QQ, 3 * [2/p]) # long time - ....: q = TorsionQuadraticForm(q) # long time - ....: assert q.orthogonal_group().order()==GO(3, p).order() # long time + ....: q = matrix.diagonal(QQ, 3 * [2/p]) + ....: q = TorsionQuadraticForm(q) + ....: assert q.orthogonal_group().order()==GO(3, p).order() """ def orbits(G, L): r""" diff --git a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx index 841368e81e8..6707d26db3d 100644 --- a/src/sage/groups/perm_gps/partn_ref/data_structures.pyx +++ b/src/sage/groups/perm_gps/partn_ref/data_structures.pyx @@ -1221,7 +1221,7 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, sage: for i in range(2,9): ....: test_Sn_on_m_points(i,i,0,1) sage: for i in range(2,9): # long time - ....: test_Sn_on_m_points(i,i,1,1) # long time + ....: test_Sn_on_m_points(i,i,1,1) sage: test_Sn_on_m_points(8,8,1,1) sage: def test_stab_chain_fns_1(n, gap, contains): ....: perm1 = sum([[2*i+1,2*i] for i in range(n)], []) @@ -1232,7 +1232,7 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, sage: for n in range(1,11): ....: test_stab_chain_fns_1(n, 0, 1) sage: for n in range(1,9): # long time - ....: test_stab_chain_fns_1(n, 1, 1) # long time + ....: test_stab_chain_fns_1(n, 1, 1) sage: test_stab_chain_fns_1(11, 1, 1) sage: def test_stab_chain_fns_2(n, gap, contains): ....: perms = [] @@ -1245,7 +1245,7 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, sage: for n in range(2,11): ....: test_stab_chain_fns_2(n, 0, 1) sage: for n in range(2,11): # long time - ....: test_stab_chain_fns_2(n, 1, 1) # long time + ....: test_stab_chain_fns_2(n, 1, 1) sage: test_stab_chain_fns_2(11, 1, 1) sage: def test_stab_chain_fns_3(n, gap, contains): ....: perm1 = [(-i)%n for i in range( n )] @@ -1256,7 +1256,7 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, sage: for n in range(2,20): ....: test_stab_chain_fns_3(n, 0, 1) sage: for n in range(2,14): # long time - ....: test_stab_chain_fns_3(n, 1, 1) # long time + ....: test_stab_chain_fns_3(n, 1, 1) sage: test_stab_chain_fns_3(20, 1, 1) sage: def test_stab_chain_fns_4(n, g, gap, contains): ....: perms = [] @@ -1266,22 +1266,22 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, ....: perms.append(perm) ....: SC_test_list_perms(perms, n, limit, gap, 0, contains) sage: for n in range(4,9): # long time - ....: test_stab_chain_fns_4(n, 1, 1, 0) # long time - ....: test_stab_chain_fns_4(n, 2, 1, 0) # long time - ....: test_stab_chain_fns_4(n, 2, 1, 0) # long time - ....: test_stab_chain_fns_4(n, 2, 1, 0) # long time - ....: test_stab_chain_fns_4(n, 2, 1, 0) # long time - ....: test_stab_chain_fns_4(n, 3, 1, 0) # long time + ....: test_stab_chain_fns_4(n, 1, 1, 0) + ....: test_stab_chain_fns_4(n, 2, 1, 0) + ....: test_stab_chain_fns_4(n, 2, 1, 0) + ....: test_stab_chain_fns_4(n, 2, 1, 0) + ....: test_stab_chain_fns_4(n, 2, 1, 0) + ....: test_stab_chain_fns_4(n, 3, 1, 0) sage: for n in range(4,9): # not tested, known bug (see :trac:`32187`) ....: test_stab_chain_fns_4(n, 1, 0, 1) ....: for j in range(6): ....: test_stab_chain_fns_4(n, 2, 0, 1) ....: test_stab_chain_fns_4(n, 3, 0, 1) sage: for n in range(4,8): # long time - ....: test_stab_chain_fns_4(n, 1, 1, 1) # long time - ....: test_stab_chain_fns_4(n, 2, 1, 1) # long time - ....: test_stab_chain_fns_4(n, 2, 1, 1) # long time - ....: test_stab_chain_fns_4(n, 3, 1, 1) # long time + ....: test_stab_chain_fns_4(n, 1, 1, 1) + ....: test_stab_chain_fns_4(n, 2, 1, 1) + ....: test_stab_chain_fns_4(n, 2, 1, 1) + ....: test_stab_chain_fns_4(n, 3, 1, 1) sage: test_stab_chain_fns_4(8, 2, 1, 1) sage: def test_stab_chain_fns_5(n, gap, contains): ....: perms = [] @@ -1294,12 +1294,12 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, ....: perm2 = list(range(m)) + perm2 ....: SC_test_list_perms([perm1, perm2], n, limit, gap, 0, contains) sage: for n in [4..9]: # long time - ....: for _ in range(2): # long time - ....: test_stab_chain_fns_5(n, 1, 0) # long time + ....: for _ in range(2): + ....: test_stab_chain_fns_5(n, 1, 0) sage: for n in [4..8]: # long time - ....: test_stab_chain_fns_5(n, 0, 1) # long time + ....: test_stab_chain_fns_5(n, 0, 1) sage: for n in [4..9]: # long time - ....: test_stab_chain_fns_5(n, 1, 1) # long time + ....: test_stab_chain_fns_5(n, 1, 1) sage: def random_perm(x): ....: shuffle(x) ....: return x @@ -1310,9 +1310,9 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, ....: perms.append(perm) ....: SC_test_list_perms(perms, m*(n//m), limit, gap, 0, contains) sage: for m in range(2,9): # long time - ....: for n in range(m,3*m): # long time - ....: for k in range(1,3): # long time - ....: test_stab_chain_fns_6(m,n,k, 1, 0) # long time + ....: for n in range(m,3*m): + ....: for k in range(1,3): + ....: test_stab_chain_fns_6(m,n,k, 1, 0) sage: for m in range(2,10): ....: for n in range(m,4*m): ....: for k in range(1,3): @@ -1340,8 +1340,8 @@ def SC_test_list_perms(list L, int n, int limit, bint gap, bint limit_complain, ....: test_stab_chain_fns_7(n, 1, 0, 1) ....: test_stab_chain_fns_7(n, 0, 0, 1) sage: for n in [6..14]: # long time - ....: test_stab_chain_fns_7(n, 1, 1, 1) # long time - ....: test_stab_chain_fns_7(n, 0, 1, 1) # long time + ....: test_stab_chain_fns_7(n, 1, 1, 1) + ....: test_stab_chain_fns_7(n, 0, 1, 1) sage: test_stab_chain_fns_7(20, 1, 1, 1) sage: test_stab_chain_fns_7(20, 0, 1, 1) diff --git a/src/sage/interfaces/frobby.py b/src/sage/interfaces/frobby.py index 21668a48d31..17c7f06f05f 100644 --- a/src/sage/interfaces/frobby.py +++ b/src/sage/interfaces/frobby.py @@ -52,7 +52,7 @@ def __call__(self, action, input=None, options=[], verbose=False): We compute the lcm of an ideal provided in Monos format. :: sage: frobby("analyze", input="vars x,y,z;[x^2,x*y];", # optional - frobby - ....: options=["lcm", "iformat monos", "oformat 4ti2"]) # optional - frobby + ....: options=["lcm", "iformat monos", "oformat 4ti2"]) ' 2 1 0\n\n2 generators\n3 variables\n' @@ -276,9 +276,9 @@ def irreducible_decomposition(self, monomial_ideal): sage: rings = [ZZ['x'], CC['x,y']] # optional - frobby sage: allOK = True # optional - frobby sage: for ring in rings: # optional - frobby - ....: id0 = ring.ideal(0) # optional - frobby - ....: decom0 = frobby.irreducible_decomposition(id0) # optional - frobby - ....: allOK = allOK and decom0 == [id0] # optional - frobby + ....: id0 = ring.ideal(0) + ....: decom0 = frobby.irreducible_decomposition(id0) + ....: allOK = allOK and decom0 == [id0] sage: allOK # optional - frobby True @@ -288,9 +288,9 @@ def irreducible_decomposition(self, monomial_ideal): sage: rings = [ZZ['x'], CC['x,y']] # optional - frobby sage: allOK = True # optional - frobby sage: for ring in rings: # optional - frobby - ....: id1 = ring.ideal(1) # optional - frobby - ....: decom1 = frobby.irreducible_decomposition(id1) # optional - frobby - ....: allOK = allOK and decom1 == [id1] # optional - frobby + ....: id1 = ring.ideal(1) + ....: decom1 = frobby.irreducible_decomposition(id1) + ....: allOK = allOK and decom1 == [id1] sage: allOK # optional - frobby True """ diff --git a/src/sage/interfaces/gap.py b/src/sage/interfaces/gap.py index 6f546349872..41e4491304e 100644 --- a/src/sage/interfaces/gap.py +++ b/src/sage/interfaces/gap.py @@ -1255,10 +1255,10 @@ def save_workspace(self): sage: ORIGINAL_WORKSPACE = sage.interfaces.gap.WORKSPACE sage: import tempfile - sage: with tempfile.NamedTemporaryFile(prefix="0"*80) as f: + sage: with tempfile.NamedTemporaryFile(prefix="0"*80) as f: # long time (4s on sage.math, 2013) ....: sage.interfaces.gap.WORKSPACE = f.name ....: gap = Gap() - ....: gap('3+2') # long time (4s on sage.math, 2013) + ....: gap('3+2') 5 sage: sage.interfaces.gap.WORKSPACE = ORIGINAL_WORKSPACE """ diff --git a/src/sage/interfaces/gp.py b/src/sage/interfaces/gp.py index d3c8756a69c..49b1a8a06fb 100644 --- a/src/sage/interfaces/gp.py +++ b/src/sage/interfaces/gp.py @@ -617,7 +617,7 @@ def _next_var_name(self): sage: g = Gp(stacksize=10^4,init_list_length=12000) # long time sage: for n in [1..13000]: # long time - ....: a = g(n) # long time + ....: a = g(n) sage: g('length(sage)') # long time 24000 """ diff --git a/src/sage/interfaces/kenzo.py b/src/sage/interfaces/kenzo.py index e005b5b6832..3607dd7879e 100644 --- a/src/sage/interfaces/kenzo.py +++ b/src/sage/interfaces/kenzo.py @@ -493,7 +493,7 @@ def basis(self, dim): sage: kenzo_chcm # optional - kenzo [K... Chain-Complex] sage: for i in range(6): # optional - kenzo - ....: print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) # optional - kenzo + ....: print("Basis in dimension %i: %s" % (i, kenzo_chcm.basis(i))) Basis in dimension 0: ['G0G0', 'G0G1', 'G0G2'] Basis in dimension 1: ['G1G0', 'G1G1'] Basis in dimension 2: None @@ -1157,8 +1157,8 @@ def SAbstractSimplex(simplex, dim): EXAMPLES:: sage: from sage.libs.ecl import EclObject, ecl_eval - sage: from sage.interfaces.kenzo import KenzoObject,\ - ....: SAbstractSimplex # optional - kenzo + sage: from sage.interfaces.kenzo import ( # optional - kenzo + ....: KenzoObject, SAbstractSimplex) sage: KAbSm = KenzoObject(ecl_eval("(ABSM 15 'K)")) # optional - kenzo sage: SAbSm1 = SAbstractSimplex(KAbSm, 2) # optional - kenzo sage: SAbSm2 = SAbstractSimplex(KAbSm, 7) # optional - kenzo @@ -1193,8 +1193,8 @@ def KAbstractSimplex(simplex): EXAMPLES:: sage: from sage.topology.simplicial_set import AbstractSimplex - sage: from sage.interfaces.kenzo import KAbstractSimplex,\ - ....: SAbstractSimplex # optional - kenzo + sage: from sage.interfaces.kenzo import ( # optional - kenzo + ....: KAbstractSimplex, SAbstractSimplex) sage: SAbSm = AbstractSimplex(1, (2,0,3,2,1), name = 'SAbSm') # optional - kenzo sage: KAbSm = KAbstractSimplex(SAbSm) # optional - kenzo sage: SAbSm2 = SAbstractSimplex(KAbSm, 1) # optional - kenzo @@ -1290,8 +1290,9 @@ def SFiniteSimplicialSet(ksimpset, limit): EXAMPLES:: sage: from sage.topology.simplicial_set import SimplicialSet - sage: from sage.interfaces.kenzo import AbstractSimplex,\ - ....: KFiniteSimplicialSet, SFiniteSimplicialSet, Sphere # optional - kenzo + sage: from sage.interfaces.kenzo import ( # optional - kenzo + ....: AbstractSimplex, KFiniteSimplicialSet, + ....: SFiniteSimplicialSet, Sphere) sage: s0 = AbstractSimplex(0, name='s0') # optional - kenzo sage: s1 = AbstractSimplex(0, name='s1') # optional - kenzo sage: s2 = AbstractSimplex(0, name='s2') # optional - kenzo @@ -1299,8 +1300,10 @@ def SFiniteSimplicialSet(ksimpset, limit): sage: s02 = AbstractSimplex(1, name='s02') # optional - kenzo sage: s12 = AbstractSimplex(1, name='s12') # optional - kenzo sage: s012 = AbstractSimplex(2, name='s012') # optional - kenzo - sage: Triangle = SimplicialSet({s01: (s1, s0),\ - ....: s02: (s2, s0), s12: (s2, s1)}, base_point = s0) # optional - kenzo + sage: Triangle = SimplicialSet({s01: (s1, s0), # optional - kenzo + ....: s02: (s2, s0), + ....: s12: (s2, s1)}, + ....: base_point = s0) sage: KTriangle = KFiniteSimplicialSet(Triangle) # optional - kenzo sage: STriangle = SFiniteSimplicialSet(KTriangle, 1) # optional - kenzo sage: STriangle.homology() # optional - kenzo @@ -1645,8 +1648,8 @@ def sum(self, object=None): sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: idx2 = idnt.sum(idnt) # optional - kenzo - sage: idx5 = idx2.sum(\ - ....: (opps_id, idnt, idnt, null, idx2.sum(idnt), opps_id)) # optional - kenzo + sage: idx5 = idx2.sum( # optional - kenzo + ....: (opps_id, idnt, idnt, null, idx2.sum(idnt), opps_id)) sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1711,8 +1714,8 @@ def substract(self, object=None): sage: null # optional - kenzo [K... Morphism (degree 0): K... -> K...] sage: idx2 = idnt.substract(opps_id) # optional - kenzo - sage: opps_idx2 = idx2.substract\ - ....: ((opps_id, idnt, idnt, null, idx2.substract(opps_id))) # optional - kenzo + sage: opps_idx2 = idx2.substract( # optional - kenzo + ....: (opps_id, idnt, idnt, null, idx2.substract(opps_id))) sage: kenzo_chcm.basis(4) # optional - kenzo ['G4G0', 'G4G1'] sage: idx2.evaluation(4, [2, 'G4G0', -5, 'G4G1']) # optional - kenzo @@ -1861,13 +1864,14 @@ def build_morphism(source_complex, target_complex, degree, algorithm, strategy, EXAMPLES:: - sage: from sage.interfaces.kenzo import KenzoChainComplex,\ - ....: build_morphism # optional - kenzo + sage: from sage.interfaces.kenzo import (KenzoChainComplex, + ....: build_morphism) sage: from sage.libs.ecl import ecl_eval sage: ZCC = KenzoChainComplex(ecl_eval("(z-chcm)")) # optional - kenzo - sage: A = build_morphism(ZCC, ZCC, -1,\ - ....: ecl_eval("#'(lambda (comb) (cmbn (1- (degr comb))))"),\ - ....: "cmbn", ["zero morphism on ZCC"]) # optional - kenzo + sage: A = build_morphism( # optional - kenzo + ....: ZCC, ZCC, -1, + ....: ecl_eval("#'(lambda (comb) (cmbn (1- (degr comb))))"), + ....: "cmbn", ["zero morphism on ZCC"]) sage: A.target_complex() # optional - kenzo [K... Chain-Complex] sage: A.degree() # optional - kenzo diff --git a/src/sage/lfunctions/zero_sums.pyx b/src/sage/lfunctions/zero_sums.pyx index 1b584caec25..324194f1c5b 100644 --- a/src/sage/lfunctions/zero_sums.pyx +++ b/src/sage/lfunctions/zero_sums.pyx @@ -1725,7 +1725,7 @@ cdef class LFunctionZeroSum_EllipticCurve(LFunctionZeroSum_abstract): sage: N = 3455601108357547341532253864901605231198511505793733138900595189472144724781456635380154149870961231592352897621963802238155192936274322687070 sage: Z = LFunctionZeroSum(E,N) sage: Z.analytic_rank_upper_bound(max_Delta=2.37,adaptive=False, # long time - ....: root_number=1,bad_primes=bad_primes,ncpus=2) # long time + ....: root_number=1,bad_primes=bad_primes,ncpus=2) 32 """ # Helper function: compute zero sum and apply parity if not False diff --git a/src/sage/manifolds/differentiable/characteristic_cohomology_class.py b/src/sage/manifolds/differentiable/characteristic_cohomology_class.py index 1af1c0c6d74..7289f67b913 100644 --- a/src/sage/manifolds/differentiable/characteristic_cohomology_class.py +++ b/src/sage/manifolds/differentiable/characteristic_cohomology_class.py @@ -1301,9 +1301,9 @@ def get_local(self, cmat): sage: g = M.metric() sage: nab = g.connection() sage: e = M.frames()[0] # select standard frame - sage: cmat = [ [nab.curvature_form(i, j, e) # long time - ....: for j in TM.irange()] # long time - ....: for i in TM.irange()] # long time + sage: cmat = [ [nab.curvature_form(i, j, e) # long time + ....: for j in TM.irange()] + ....: for i in TM.irange()] Import the algorithm:: @@ -1500,8 +1500,8 @@ def get_local(self, cmat): sage: nab = g.connection() sage: e = M.frames()[0] # select standard frame sage: cmat = [ [nab.curvature_form(i, j, e) # long time - ....: for j in TM.irange()] # long time - ....: for i in TM.irange()] # long time + ....: for j in TM.irange()] + ....: for i in TM.irange()] Import the algorithm:: @@ -1797,9 +1797,9 @@ def get_local(self, cmat): sage: g = M.metric() sage: nab = g.connection() sage: e = M.frames()[0] # select the standard frame - sage: cmat = [ [nab.curvature_form(i, j, e) # long time - ....: for j in TM.irange()] # long time - ....: for i in TM.irange()] # long time + sage: cmat = [ [nab.curvature_form(i, j, e) # long time + ....: for j in TM.irange()] + ....: for i in TM.irange() ] Import the algorithm:: diff --git a/src/sage/matrix/matrix2.pyx b/src/sage/matrix/matrix2.pyx index 3f022f421ee..0538f2fdb1c 100644 --- a/src/sage/matrix/matrix2.pyx +++ b/src/sage/matrix/matrix2.pyx @@ -17062,8 +17062,9 @@ cdef class Matrix(Matrix1): sage: K1 = random_cone(max_ambient_dim=5) sage: K2 = random_cone(max_ambient_dim=5) - sage: all(L.change_ring(SR).is_positive_operator_on(K1, K2) - ....: for L in K1.positive_operators_gens(K2)) # long time + sage: results = ( L.change_ring(SR).is_positive_operator_on(K1, K2) + ....: for L in K1.positive_operators_gens(K2) ) + sage: all(results) # long time True Technically we could test this, but for now only closed convex cones @@ -17210,8 +17211,9 @@ cdef class Matrix(Matrix1): ``cross_positive_operators_gens`` method):: sage: K = random_cone(max_ambient_dim=5) - sage: all(L.change_ring(SR).is_cross_positive_on(K) - ....: for L in K.cross_positive_operators_gens()) # long time + sage: results = ( L.change_ring(SR).is_cross_positive_on(K) + ....: for L in K.cross_positive_operators_gens() ) + sage: all(results) # long time True Technically we could test this, but for now only closed convex cones @@ -17346,8 +17348,8 @@ cdef class Matrix(Matrix1): case is tested by the ``Z_operators_gens`` method):: sage: K = random_cone(max_ambient_dim=5) - sage: all(L.change_ring(SR).is_Z_operator_on(K) - ....: for L in K.Z_operators_gens()) # long time + sage: all(L.change_ring(SR).is_Z_operator_on(K) # long time + ....: for L in K.Z_operators_gens()) True Technically we could test this, but for now only closed convex cones @@ -17464,8 +17466,8 @@ cdef class Matrix(Matrix1): ``lyapunov_like_basis`` method):: sage: K = random_cone(max_ambient_dim=5) - sage: all(L.change_ring(SR).is_lyapunov_like_on(K) - ....: for L in K.lyapunov_like_basis()) # long time + sage: all(L.change_ring(SR).is_lyapunov_like_on(K) # long time + ....: for L in K.lyapunov_like_basis()) True Technically we could test this, but for now only closed convex cones @@ -17504,8 +17506,8 @@ cdef class Matrix(Matrix1): sage: R = K.lattice().vector_space().base_ring() sage: L = random_matrix(R, K.lattice_dim()) sage: actual = L.is_lyapunov_like_on(K) # long time - sage: expected = (L.is_cross_positive_on(K) and - ....: (-L).is_cross_positive_on(K)) # long time + sage: expected = (L.is_cross_positive_on(K) and # long time + ....: (-L).is_cross_positive_on(K)) sage: actual == expected # long time True """ diff --git a/src/sage/matroids/lean_matrix.pyx b/src/sage/matroids/lean_matrix.pyx index 70510e53797..6004819fe0a 100644 --- a/src/sage/matroids/lean_matrix.pyx +++ b/src/sage/matroids/lean_matrix.pyx @@ -987,7 +987,7 @@ cdef class BinaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = BinaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = BinaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -1011,7 +1011,7 @@ cdef class BinaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = BinaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = BinaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -1596,7 +1596,7 @@ cdef class TernaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = TernaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = TernaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -1634,7 +1634,7 @@ cdef class TernaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = TernaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = TernaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -2155,7 +2155,7 @@ cdef class QuaternaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = QuaternaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = QuaternaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -2186,7 +2186,7 @@ cdef class QuaternaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = QuaternaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = QuaternaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -2235,7 +2235,7 @@ cdef class QuaternaryMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = QuaternaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = QuaternaryMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 sage: A = None @@ -2776,8 +2776,8 @@ cdef class PlusMinusOneMatrix(LeanMatrix): EXAMPLES:: - sage: M = Matroid(graphs.CompleteGraph(4).incidence_matrix(oriented=True), - ....: regular=True) # indirect doctest + sage: M = Matroid(graphs.CompleteGraph(4).incidence_matrix(oriented=True), # indirect doctest + ....: regular=True) sage: M.is_isomorphic(matroids.Wheel(3)) True """ @@ -2788,7 +2788,7 @@ cdef class PlusMinusOneMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = PlusMinusOneMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = PlusMinusOneMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 """ @@ -2830,7 +2830,7 @@ cdef class PlusMinusOneMatrix(LeanMatrix): EXAMPLES:: sage: from sage.matroids.lean_matrix import * - sage: A = PlusMinusOneMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # Indirect doctest + sage: A = PlusMinusOneMatrix(2, 2, Matrix(GF(4, 'x'), [[0, 0], [0, 0]])) # indirect doctest sage: A.nrows() 2 sage: A = None diff --git a/src/sage/matroids/linear_matroid.pyx b/src/sage/matroids/linear_matroid.pyx index 5c697a696b4..a4980a96492 100644 --- a/src/sage/matroids/linear_matroid.pyx +++ b/src/sage/matroids/linear_matroid.pyx @@ -269,8 +269,8 @@ cdef class LinearMatroid(BasisExchangeMatroid): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: LinearMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], - ....: [0, 1, 1, 2, 3]])) # indirect doctest + sage: LinearMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], # indirect doctest + ....: [0, 1, 1, 2, 3]])) Linear matroid of rank 2 on 5 elements represented over the Finite Field of size 5 """ @@ -292,8 +292,8 @@ cdef class LinearMatroid(BasisExchangeMatroid): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: M = LinearMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], - ....: [0, 1, 1, 2, 3]])) # indirect doctest + sage: M = LinearMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], # indirect doctest + ....: [0, 1, 1, 2, 3]])) sage: M = None """ if self._prow is not NULL: @@ -3071,8 +3071,8 @@ cdef class BinaryMatroid(LinearMatroid): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: BinaryMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], - ....: [0, 1, 1, 2, 3]])) # indirect doctest + sage: BinaryMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], # indirect doctest + ....: [0, 1, 1, 2, 3]])) Binary matroid of rank 2 on 5 elements, type (1, 7) """ cdef BinaryMatrix A @@ -4136,8 +4136,8 @@ cdef class TernaryMatroid(LinearMatroid): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: TernaryMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], - ....: [0, 1, 1, 2, 3]])) # indirect doctest + sage: TernaryMatroid(matrix=Matrix(GF(5), [[1, 0, 1, 1, 1], # indirect doctest + ....: [0, 1, 1, 2, 3]])) Ternary matroid of rank 2 on 5 elements, type 1+ """ cdef TernaryMatrix A @@ -5041,8 +5041,9 @@ cdef class QuaternaryMatroid(LinearMatroid): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: QuaternaryMatroid(matrix=Matrix(GF(4, 'x'), - ....: [[1, 0, 1, 1, 1], [0, 1, 1, 1, 1]])) # indirect doctest + sage: QuaternaryMatroid(matrix=Matrix(GF(4, 'x'), # indirect doctest + ....: [[1, 0, 1, 1, 1], + ....: [0, 1, 1, 1, 1]])) Quaternary matroid of rank 2 on 5 elements """ cdef QuaternaryMatrix A @@ -5760,8 +5761,8 @@ cdef class RegularMatroid(LinearMatroid): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: RegularMatroid(matrix=Matrix(ZZ, [[1, 0, 1, 1, 1], - ....: [0, 1, 1, 1, 1]])) # indirect doctest + sage: RegularMatroid(matrix=Matrix(ZZ, [[1, 0, 1, 1, 1], # indirect doctest + ....: [0, 1, 1, 1, 1]])) Regular matroid of rank 2 on 5 elements with 7 bases """ LinearMatroid.__init__(self, matrix, groundset, reduced_matrix, ring=ZZ, keep_initial_representation=keep_initial_representation) diff --git a/src/sage/matroids/minor_matroid.py b/src/sage/matroids/minor_matroid.py index bc567d1d4ce..907bb54356f 100644 --- a/src/sage/matroids/minor_matroid.py +++ b/src/sage/matroids/minor_matroid.py @@ -132,8 +132,8 @@ def __init__(self, matroid, contractions=None, deletions=None): EXAMPLES:: sage: from sage.matroids.advanced import * - sage: M = MinorMatroid(matroids.named_matroids.Fano(), - ....: contractions=set(), deletions=set(['g'])) # indirect doctest + sage: M = MinorMatroid(matroids.named_matroids.Fano(), # indirect doctest + ....: contractions=set(), deletions=set(['g'])) sage: M.is_isomorphic(matroids.Wheel(3)) True """ diff --git a/src/sage/misc/cachefunc.pyx b/src/sage/misc/cachefunc.pyx index 8ac07e65f49..bae02139bc2 100644 --- a/src/sage/misc/cachefunc.pyx +++ b/src/sage/misc/cachefunc.pyx @@ -2485,12 +2485,12 @@ cdef class GloballyCachedMethodCaller(CachedMethodCaller): sage: class MyParent(Parent): ....: pass - sage: class MyElement(): + sage: class MyElement(): # indirect doctest ....: def __init__(self, x): ....: self.x = x ....: def parent(self): ....: return MyParent() - ....: @cached_in_parent_method #indirect doctest + ....: @cached_in_parent_method ....: def f(self): ....: return self.x^2 sage: a = MyElement(2) @@ -3124,13 +3124,13 @@ cdef class CachedInParentMethod(CachedMethod): sage: class MyParent(Parent): ....: pass - sage: class Foo: + sage: class Foo: # indirect doctest ....: def __init__(self, x): ....: self._x = x ....: self._parent = MyParent() ....: def parent(self): ....: return self._parent - ....: @cached_in_parent_method #indirect doctest + ....: @cached_in_parent_method ....: def f(self): ....: return self._x^2 sage: a = Foo(2) diff --git a/src/sage/misc/profiler.py b/src/sage/misc/profiler.py index c442c67693b..6fac3e4c095 100644 --- a/src/sage/misc/profiler.py +++ b/src/sage/misc/profiler.py @@ -29,7 +29,7 @@ class Profiler: EXAMPLES:: sage: def f(): # not tested - ....: p = Profiler() # not tested + ....: p = Profiler() Calling ``p(message)`` creates a checkpoint:: diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py index 2585c327a42..5a69dbcb0cc 100644 --- a/src/sage/misc/sagedoc.py +++ b/src/sage/misc/sagedoc.py @@ -885,8 +885,9 @@ def _search_src_or_doc(what, string, extra1='', extra2='', extra3='', results to stdout:: sage: from sage.misc.sagedoc import _search_src_or_doc - sage: _search_src_or_doc('src', r'def _search_src_or_doc\(', - ....: interact=True) # long time + sage: _search_src_or_doc('src', # long time + ....: r'def _search_src_or_doc\(', + ....: interact=True) misc/sagedoc.py:...: def _search_src_or_doc(what, string, extra1='', extra2='', extra3='', """ diff --git a/src/sage/numerical/backends/generic_backend.pyx b/src/sage/numerical/backends/generic_backend.pyx index 83970d90758..20eb36cbd00 100644 --- a/src/sage/numerical/backends/generic_backend.pyx +++ b/src/sage/numerical/backends/generic_backend.pyx @@ -777,7 +777,7 @@ cdef class GenericBackend: sage: p = MixedIntegerLinearProgram(solver="Nonexistent_LP_solver") # optional - Nonexistent_LP_solver sage: b = p.new_variable(binary=True) # optional - Nonexistent_LP_solver sage: for u,v in graphs.CycleGraph(5).edges(labels=False): # optional - Nonexistent_LP_solver - ....: p.add_constraint(b[u]+b[v]<=1) # optional - Nonexistent_LP_solver + ....: p.add_constraint(b[u]+b[v]<=1) sage: p.set_objective(p.sum(b[x] for x in range(5))) # optional - Nonexistent_LP_solver sage: p.solve() # optional - Nonexistent_LP_solver 2.0 @@ -812,7 +812,7 @@ cdef class GenericBackend: sage: p = MixedIntegerLinearProgram(solver="Nonexistent_LP_solver") # optional - Nonexistent_LP_solver sage: b = p.new_variable(binary=True) # optional - Nonexistent_LP_solver sage: for u,v in graphs.CycleGraph(5).edges(labels=False): # optional - Nonexistent_LP_solver - ....: p.add_constraint(b[u]+b[v]<=1) # optional - Nonexistent_LP_solver + ....: p.add_constraint(b[u]+b[v]<=1) sage: p.set_objective(p.sum(b[x] for x in range(5))) # optional - Nonexistent_LP_solver sage: p.solve() # optional - Nonexistent_LP_solver 2.0 diff --git a/src/sage/plot/animate.py b/src/sage/plot/animate.py index 1fc61ad0dd7..bac4068f4de 100644 --- a/src/sage/plot/animate.py +++ b/src/sage/plot/animate.py @@ -233,8 +233,8 @@ def __init__(self, v=None, **kwds): EXAMPLES:: sage: x = SR.var("x") - sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.3)], - ....: xmin=0, xmax=2*pi, figsize=[2,1]) # indirect doctest + sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.3)], # indirect doctest + ....: xmin=0, xmax=2*pi, figsize=[2,1]) sage: a # optional -- ImageMagick # long time Animation with 21 frames """ diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py index 4accb309580..9a46eaefe76 100644 --- a/src/sage/plot/contour_plot.py +++ b/src/sage/plot/contour_plot.py @@ -1161,8 +1161,9 @@ def f(x,y): return x**2 + y**2 - 2 The same circle with different line and fill colors:: - sage: implicit_plot(f, (-3,3), (-3,3), color='red', fill=True, fillcolor='green', - ....: plot_points=500) # long time + sage: implicit_plot(f, (-3,3), (-3,3), color='red', # long time + ....: fill=True, fillcolor='green', + ....: plot_points=500) Graphics object consisting of 2 graphics primitives .. PLOT:: @@ -1307,8 +1308,8 @@ def f(x,y): symbolic expression the user should increase the number of plot points to avoid artifacts:: - sage: implicit_plot(lambda x, y: x^2 + y^2 - 2, (x,-3,3), (y,-3,3), - ....: fill=True, plot_points=500) # long time + sage: implicit_plot(lambda x, y: x^2 + y^2 - 2, (x,-3,3), # long time + ....: (y,-3,3), fill=True, plot_points=500) Graphics object consisting of 2 graphics primitives .. PLOT:: diff --git a/src/sage/plot/plot3d/parametric_plot3d.py b/src/sage/plot/plot3d/parametric_plot3d.py index e16df517fb8..d1b352410da 100644 --- a/src/sage/plot/plot3d/parametric_plot3d.py +++ b/src/sage/plot/plot3d/parametric_plot3d.py @@ -415,8 +415,12 @@ def g(x,y): return x, y+sin(y), x**2 + y**2 sage: f_x = K * (cos(u)*cos(2*v)+sqrt(2)*sin(u)*cos(v)) sage: f_y = K * (cos(u)*sin(2*v)-sqrt(2)*sin(u)*sin(v)) sage: f_z = 3 * K * cos(u) - sage: parametric_plot3d([f_x, f_y, f_z], (u,-2*pi,2*pi), (v,0,pi), - ....: plot_points=[90,90], frame=False, color="orange") # long time -- about 30 seconds + sage: parametric_plot3d([f_x, f_y, f_z], # long time + ....: (u,-2*pi,2*pi), + ....: (v,0,pi), + ....: plot_points=[90,90], + ....: frame=False, + ....: color="orange") Graphics3d Object .. PLOT:: diff --git a/src/sage/quadratic_forms/genera/genus.py b/src/sage/quadratic_forms/genera/genus.py index 4b1ee85dcdb..788e7be30c9 100644 --- a/src/sage/quadratic_forms/genera/genus.py +++ b/src/sage/quadratic_forms/genera/genus.py @@ -2972,8 +2972,8 @@ def _compute_representative(self, LLL=True): ....: G = genera((1,2), det, even=False) ....: assert all(g==Genus(g.representative()) for g in G) sage: for det in range(1, 9): # long time (8s, 2020) - ....: G = genera((2,2), det, even=False) # long time - ....: assert all(g==Genus(g.representative()) for g in G) # long time + ....: G = genera((2,2), det, even=False) + ....: assert all(g==Genus(g.representative()) for g in G) """ from sage.modules.free_quadratic_module_integer_symmetric import IntegralLattice, local_modification q = self.rational_representative() diff --git a/src/sage/rings/asymptotic/term_monoid.py b/src/sage/rings/asymptotic/term_monoid.py index f8a009b6282..38a130bbd60 100644 --- a/src/sage/rings/asymptotic/term_monoid.py +++ b/src/sage/rings/asymptotic/term_monoid.py @@ -4968,13 +4968,13 @@ def _default_kwds_construction_(self): sage: T = TermMonoid('B', G, ZZ) sage: T._default_kwds_construction_() {'coefficient': 1, 'valid_from': {'x': 0}} - sage: T.from_construction((None, {'growth': G.gen()})) # indirect doctest + sage: T.from_construction((None, {'growth': G.gen()})) # indirect doctest B(x, x >= 0) - sage: T.from_construction( - ....: (None, {'growth': G.gen(), 'coefficient': 2})) # indirect doctest + sage: T.from_construction( # indirect doctest + ....: (None, {'growth': G.gen(), 'coefficient': 2})) B(2*x, x >= 0) - sage: T.from_construction( - ....: (None, {'growth': G.gen(), 'valid_from': {'x': 5}})) # indirect doctest + sage: T.from_construction( # indirect doctest + ....: (None, {'growth': G.gen(), 'valid_from': {'x': 5}})) B(x, x >= 5) """ defaults = {} diff --git a/src/sage/rings/padics/padic_generic_element.pyx b/src/sage/rings/padics/padic_generic_element.pyx index 7f0a64aa5ef..09fd404df21 100644 --- a/src/sage/rings/padics/padic_generic_element.pyx +++ b/src/sage/rings/padics/padic_generic_element.pyx @@ -3836,9 +3836,9 @@ cdef class pAdicGenericElement(LocalGenericElement): sage: S. = W[] sage: R. = W.extension(x^8 + 15*a*x - 5) sage: y = R.random_element() - sage: for n in [5, 10, 15]: + sage: for n in [5, 10, 15]: # indirect doctest ....: z = y**n - ....: assert z.nth_root(n)**n == z # indirect doctest + ....: assert z.nth_root(n)**n == z """ ring = self.parent() diff --git a/src/sage/rings/tests.py b/src/sage/rings/tests.py index c6f1a9ecbbf..fc88f0e2a7c 100644 --- a/src/sage/rings/tests.py +++ b/src/sage/rings/tests.py @@ -450,8 +450,9 @@ def test_karatsuba_multiplication(base_ring, maxdeg1, maxdeg2, Some more aggressive tests:: - sage: for C in [QQ, ZZ[I], ZZ[I, sqrt(2)], GF(49, 'a'), MatrixSpace(GF(17), 3)]: - ....: sage.rings.tests.test_karatsuba_multiplication(C, 10, 10) # long time + sage: testrings = [QQ, ZZ[I], ZZ[I, sqrt(2)], GF(49, 'a'), MatrixSpace(GF(17), 3)] + sage: for C in testrings: # long time + ....: sage.rings.tests.test_karatsuba_multiplication(C, 10, 10) sage: sage.rings.tests.test_karatsuba_multiplication(ZZ, 10000, 10000, ref_mul=lambda f,g: f*g, base_ring_random_elt_args=[100000]) """ diff --git a/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py b/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py index 1ff68f8d4cd..ef39c87dabb 100644 --- a/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py +++ b/src/sage/schemes/cyclic_covers/cycliccover_finite_field.py @@ -1110,8 +1110,9 @@ def frobenius_polynomial(self): sage: p = 1117 sage: x = PolynomialRing(GF(p),"x").gen() sage: f = x^9 + 4*x^2 + 10*x + 4 - sage: CyclicCover(2, f).frobenius_polynomial() == \ - ....: HyperellipticCurve(f).frobenius_polynomial() # long time + sage: P1 = CyclicCover(2, f).frobenius_polynomial() + sage: P2 = HyperellipticCurve(f).frobenius_polynomial() + sage: P1 == P2 # long time True sage: f = 2*x^5 + 4*x^3 + x^2 + 2*x + 1 sage: CyclicCover(2, f).frobenius_polynomial() == \ diff --git a/src/sage/schemes/elliptic_curves/ell_rational_field.py b/src/sage/schemes/elliptic_curves/ell_rational_field.py index f1b7d937748..418bfd8995f 100644 --- a/src/sage/schemes/elliptic_curves/ell_rational_field.py +++ b/src/sage/schemes/elliptic_curves/ell_rational_field.py @@ -1752,7 +1752,7 @@ def analytic_rank_upper_bound(self, sage: bad_primes = [2,3,5,7,11,13,17,19,48463] sage: N = 3455601108357547341532253864901605231198511505793733138900595189472144724781456635380154149870961231592352897621963802238155192936274322687070 sage: E.analytic_rank_upper_bound(max_Delta=2.37,adaptive=False, # long time - ....: N=N,root_number=1,bad_primes=bad_primes,ncpus=2) # long time + ....: N=N,root_number=1,bad_primes=bad_primes,ncpus=2) 32 """ Z = LFunctionZeroSum_EllipticCurve(self, N) diff --git a/src/sage/schemes/elliptic_curves/padics.py b/src/sage/schemes/elliptic_curves/padics.py index e4d88113716..c5a9e25973b 100644 --- a/src/sage/schemes/elliptic_curves/padics.py +++ b/src/sage/schemes/elliptic_curves/padics.py @@ -292,7 +292,7 @@ def padic_regulator(self, p, prec=20, height=None, check_hypotheses=True): sage: max_prec = 30 # make sure we get past p^2 # long time sage: full = E.padic_regulator(5, max_prec) # long time sage: for prec in range(1, max_prec): # long time - ....: assert E.padic_regulator(5, prec) == full # long time + ....: assert E.padic_regulator(5, prec) == full A case where the generator belongs to the formal group already (:trac:`3632`):: @@ -663,7 +663,7 @@ def padic_height(self, p, prec=20, sigma=None, check_hypotheses=True): sage: max_prec = 30 # make sure we get past p^2 # long time sage: full = E.padic_height(5, max_prec)(P) # long time sage: for prec in range(1, max_prec): # long time - ....: assert E.padic_height(5, prec)(P) == full # long time + ....: assert E.padic_height(5, prec)(P) == full A supersingular prime for a curve:: @@ -865,7 +865,7 @@ def padic_height_via_multiply(self, p, prec=20, E2=None, check_hypotheses=True): sage: max_prec = 30 # make sure we get past p^2 # long time sage: full = E.padic_height(5, max_prec)(P) # long time sage: for prec in range(2, max_prec): # long time - ....: assert E.padic_height_via_multiply(5, prec)(P) == full # long time + ....: assert E.padic_height_via_multiply(5, prec)(P) == full """ if check_hypotheses: if not p.is_prime(): @@ -1047,7 +1047,7 @@ def padic_sigma(self, p, N=20, E2=None, check=False, check_hypotheses=True): sage: E2 = E.padic_E2(5, max_N) # long time sage: max_sigma = E.padic_sigma(p, max_N, E2=E2) # long time sage: for N in range(3, max_N): # long time - ....: sigma = E.padic_sigma(p, N, E2=E2) # long time + ....: sigma = E.padic_sigma(p, N, E2=E2) ....: assert sigma == max_sigma """ if check_hypotheses: @@ -1229,10 +1229,10 @@ def padic_sigma_truncated(self, p, N=20, lamb=0, E2=None, check_hypotheses=True) sage: E = EllipticCurve([1, 2, 3, 4, 7]) # long time sage: E2 = E.padic_E2(5, 50) # long time sage: for N in range(2, 10): # long time - ....: for lamb in range(10): # long time - ....: correct = E.padic_sigma(5, N + 3*lamb, E2=E2) # long time - ....: compare = E.padic_sigma_truncated(5, N=N, lamb=lamb, E2=E2) # long time - ....: assert compare == correct # long time + ....: for lamb in range(10): + ....: correct = E.padic_sigma(5, N + 3*lamb, E2=E2) + ....: compare = E.padic_sigma_truncated(5, N=N, lamb=lamb, E2=E2) + ....: assert compare == correct """ if check_hypotheses: p = __check_padic_hypotheses(self, p) diff --git a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py index 687ab8606df..0020c79393b 100644 --- a/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +++ b/src/sage/schemes/hyperelliptic_curves/monsky_washnitzer.py @@ -1526,7 +1526,7 @@ def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R. = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time - ....: x^3 - x + R(1/4), p, M) # long time + ....: x^3 - x + R(1/4), p, M) sage: B = A.change_ring(Integers(p**prec)); B # long time [74311982 57996908] [95877067 25828133] @@ -1544,7 +1544,7 @@ def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): sage: M = monsky_washnitzer.adjusted_prec(p, prec) sage: R. = PolynomialRing(Integers(p**M)) sage: A = monsky_washnitzer.matrix_of_frobenius( # long time - ....: x^3 - x + R(1/4), p, M) # long time + ....: x^3 - x + R(1/4), p, M) sage: B = A.change_ring(Integers(p**prec)) # long time sage: B.det() # long time 5 @@ -1563,13 +1563,13 @@ def matrix_of_frobenius(Q, p, M, trace=None, compute_exact_forms=False): sage: A = A.change_ring(Integers(p**max_prec)) # long time sage: result = [] # long time sage: for prec in range(1, max_prec): # long time - ....: M = monsky_washnitzer.adjusted_prec(p, prec) # long time - ....: R. = PolynomialRing(Integers(p^M),'x') # long time - ....: B = monsky_washnitzer.matrix_of_frobenius( # long time - ....: x^3 - x + R(1/4), p, M) # long time - ....: B = B.change_ring(Integers(p**prec)) # long time - ....: result.append(B == A.change_ring( # long time - ....: Integers(p**prec))) # long time + ....: M = monsky_washnitzer.adjusted_prec(p, prec) + ....: R. = PolynomialRing(Integers(p^M),'x') + ....: B = monsky_washnitzer.matrix_of_frobenius( + ....: x^3 - x + R(1/4), p, M) + ....: B = B.change_ring(Integers(p**prec)) + ....: result.append(B == A.change_ring( + ....: Integers(p**prec))) sage: result == [True] * (max_prec - 1) # long time True diff --git a/src/sage/sets/set_from_iterator.py b/src/sage/sets/set_from_iterator.py index 524ad3ae79b..a99a559b691 100644 --- a/src/sage/sets/set_from_iterator.py +++ b/src/sage/sets/set_from_iterator.py @@ -945,8 +945,8 @@ def __call__(self, f): TESTS:: sage: from sage.sets.set_from_iterator import set_from_method - sage: class A: - ....: @set_from_method() # indirect doctest + sage: class A: # indirect doctest + ....: @set_from_method() ....: def f(self): ....: return xsrange(3) sage: a = A() diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx index 54bfd3465ec..a7cd6adb7bd 100644 --- a/src/sage/symbolic/expression.pyx +++ b/src/sage/symbolic/expression.pyx @@ -5679,7 +5679,7 @@ cdef class Expression(Expression_abc): sage: cmd = 'subs({}={}, {})' # optional - maple sage: for s1,s2 in subs: # optional - maple - ....: maple.eval(cmd.format(s1,s2, E)) # optional - maple + ....: maple.eval(cmd.format(s1,s2, E)) 'y^4+y^2+y' 'x^4+x+y' 'x^4+x^2+x' @@ -5689,7 +5689,7 @@ cdef class Expression(Expression_abc): sage: cmd = '{} /. {} -> {}' # optional - mathematica sage: for s1,s2 in subs: # optional - mathematica - ....: mathematica.eval(cmd.format(E,s1,s2)) # optional - mathematica + ....: mathematica.eval(cmd.format(E,s1,s2)) 2 4 y + y + y 4 @@ -5701,7 +5701,7 @@ cdef class Expression(Expression_abc): The same, with formatting more suitable for cut and paste:: sage: for s1,s2 in subs: # optional - mathematica - ....: mathematica(cmd.format(E,s1,s2)) # optional - mathematica + ....: mathematica(cmd.format(E,s1,s2)) y + y^2 + y^4 x + x^4 + y x^4 + y diff --git a/src/sage/symbolic/random_tests.py b/src/sage/symbolic/random_tests.py index acc7d097a4e..18ef715cbc3 100644 --- a/src/sage/symbolic/random_tests.py +++ b/src/sage/symbolic/random_tests.py @@ -295,8 +295,8 @@ def random_expr(size, nvars=1, ncoeffs=None, var_frac=0.5, sage: my_internal = [(0.6, full_binary, 2), (0.2, full_unary, 1), ....: (0.2, [(1.0,f,f.number_of_arguments()) for f in some_functions])] sage: set_random_seed(1) - sage: random_expr(50, nvars=3, internal=my_internal, - ....: coeff_generator=CDF.random_element) # not tested # known bug + sage: random_expr(50, nvars=3, internal=my_internal, # not tested # known bug + ....: coeff_generator=CDF.random_element) (v1^(0.9713408427702117 + 0.195868299334218*I)/cot(-pi + v1^2 + v3) + tan(arctan(v2 + arctan2(-0.35859061674557324 + 0.9407509502498164*I, v3) - 0.8419115504372718 + 0.30375717982404615*I) + arctan2((0.2275357305882964 - 0.8258002386106038*I)/factorial(v2), -v3 - 0.7604559947718565 - 0.5543672548552057*I) + ceil(1/arctan2(v1, v1))))/v2 sage: random_expr(5, verbose=True) # not tested # known bug About to apply to [31]