Skip to content

Commit 3916f8e

Browse files
author
Release Manager
committed
Trac #34602: add some missing EXAMPLES
that apparently do not provoke any rst error URL: https://trac.sagemath.org/34602 Reported by: chapoton Ticket author(s): Frédéric Chapoton Reviewer(s): Marc Mezzarobba
2 parents 2111efa + a052558 commit 3916f8e

File tree

6 files changed

+50
-42
lines changed

6 files changed

+50
-42
lines changed

src/sage/categories/magmas.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,13 @@ def product(self, x, y):
774774

775775
def __init_extra__(self):
776776
"""
777+
EXAMPLES::
778+
777779
sage: S = Semigroups().example("free")
778780
sage: S('a') * S('b') # indirect doctest
779781
'ab'
780782
sage: S('a').__class__._mul_ == S('a').__class__._mul_parent
781783
True
782-
783784
"""
784785
# This should instead register the multiplication to the coercion model
785786
# But this is not yet implemented in the coercion model

src/sage/combinat/sf/sf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,8 @@ def __init__(self, t, domain, codomain):
16051605

16061606
def __call__(self, partition):
16071607
"""
1608+
EXAMPLES::
1609+
16081610
sage: Sym = SymmetricFunctions(QQ['x'])
16091611
sage: p = Sym.p(); s = Sym.s()
16101612
sage: p[1] + s[1] # indirect doctest

src/sage/functions/bessel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,8 @@ def _derivative_(self, a, z, diff_param=None):
14341434

14351435
def _print_latex_(self, a, z):
14361436
"""
1437+
EXAMPLES::
1438+
14371439
sage: latex(struve_L(2,x))
14381440
L_{{2}}({x})
14391441
"""

src/sage/groups/perm_gps/partn_ref/automorphism_group_canonical_label.pyx

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ REFERENCE:
9999
100100
"""
101101

102-
#*****************************************************************************
102+
# ****************************************************************************
103103
# Copyright (C) 2006 - 2011 Robert L. Miller <[email protected]>
104104
#
105105
# This program is free software: you can redistribute it and/or modify
106106
# it under the terms of the GNU General Public License as published by
107107
# the Free Software Foundation, either version 2 of the License, or
108108
# (at your option) any later version.
109-
# http://www.gnu.org/licenses/
110-
#*****************************************************************************
109+
# https://www.gnu.org/licenses/
110+
# ****************************************************************************
111111

112112
from libc.string cimport memcmp, memcpy
113113
from cysignals.memory cimport sig_malloc, sig_realloc, sig_free
@@ -134,24 +134,25 @@ cdef int compare_structures_trivial(int *gamma_1, int *gamma_2, void *S1, void *
134134
def test_get_aut_gp_and_can_lab_trivially(int n=6,
135135
list partition=[[0,1,2],[3,4],[5]], canonical_label=True, base=False):
136136
"""
137-
sage: tttt = sage.groups.perm_gps.partn_ref.automorphism_group_canonical_label.test_get_aut_gp_and_can_lab_trivially
138-
sage: tttt()
139-
12
140-
sage: tttt(canonical_label=False, base=False)
141-
12
142-
sage: tttt(canonical_label=False, base=True)
143-
12
144-
sage: tttt(canonical_label=True, base=True)
145-
12
146-
sage: tttt(n=0, partition=[])
147-
1
148-
sage: tttt(n=0, partition=[], canonical_label=False, base=False)
149-
1
150-
sage: tttt(n=0, partition=[], canonical_label=False, base=True)
151-
1
152-
sage: tttt(n=0, partition=[], canonical_label=True, base=True)
153-
1
137+
TESTS::
154138
139+
sage: tttt = sage.groups.perm_gps.partn_ref.automorphism_group_canonical_label.test_get_aut_gp_and_can_lab_trivially
140+
sage: tttt()
141+
12
142+
sage: tttt(canonical_label=False, base=False)
143+
12
144+
sage: tttt(canonical_label=False, base=True)
145+
12
146+
sage: tttt(canonical_label=True, base=True)
147+
12
148+
sage: tttt(n=0, partition=[])
149+
1
150+
sage: tttt(n=0, partition=[], canonical_label=False, base=False)
151+
1
152+
sage: tttt(n=0, partition=[], canonical_label=False, base=True)
153+
1
154+
sage: tttt(n=0, partition=[], canonical_label=True, base=True)
155+
1
155156
"""
156157
cdef aut_gp_and_can_lab *output
157158
cdef Integer I = Integer(0)

src/sage/knots/knotinfo.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -375,33 +375,35 @@ def items(self):
375375
@cached_method
376376
def __getitem__(self, item):
377377
r"""
378-
sage: from sage.knots.knotinfo import KnotInfo
379-
sage: L = KnotInfo.L4a1_0
380-
sage: L[L.items.alternating]
381-
'Y'
382-
sage: L[L.items.arc_notation]
383-
'{{6, 4}, {3, 5}, {4, 2}, {1, 3}, {2, 6}, {5, 1}}'
384-
sage: L[L.items.braid_notation]
385-
'{3, {-2, -2, -1, 2, -1}}'
386-
sage: L[0]
387-
Traceback (most recent call last):
388-
...
389-
KeyError: "Item must be an instance of <enum 'KnotInfoColumns'>"
378+
EXAMPLES::
379+
380+
sage: from sage.knots.knotinfo import KnotInfo
381+
sage: L = KnotInfo.L4a1_0
382+
sage: L[L.items.alternating]
383+
'Y'
384+
sage: L[L.items.arc_notation]
385+
'{{6, 4}, {3, 5}, {4, 2}, {1, 3}, {2, 6}, {5, 1}}'
386+
sage: L[L.items.braid_notation]
387+
'{3, {-2, -2, -1, 2, -1}}'
388+
sage: L[0]
389+
Traceback (most recent call last):
390+
...
391+
KeyError: "Item must be an instance of <enum 'KnotInfoColumns'>"
390392
"""
391393
if not isinstance(item, KnotInfoColumns):
392-
raise KeyError('Item must be an instance of %s' %(KnotInfoColumns))
394+
raise KeyError('Item must be an instance of %s' % (KnotInfoColumns))
393395
if item.column_type() == item.types.OnlyLinks and self.is_knot():
394-
raise KeyError('Item not available for knots' %(KnotInfoColumns))
396+
raise KeyError('Item not available for knots' % (KnotInfoColumns))
395397
if item.column_type() == item.types.OnlyKnots and not self.is_knot():
396-
raise KeyError('Item not available for links' %(KnotInfoColumns))
398+
raise KeyError('Item not available for links' % (KnotInfoColumns))
397399

398400
l = db.read(item)
399401
ind = db.read_row_dict()[self.name][0]
400402
offset = 0
401403
if item.column_type() == item.types.OnlyLinks:
402404
offset = self._offset_knots()
403405

404-
return l[ind-offset]
406+
return l[ind - offset]
405407

406408
def _offset_knots(self):
407409
r"""

src/sage/rings/padics/padic_capped_absolute_element.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@ AUTHORS:
99
- Genya Zaytman: documentation
1010
- David Harvey: doctests
1111
"""
12-
13-
#*****************************************************************************
12+
# ****************************************************************************
1413
# Copyright (C) 2007-2013 David Roe <[email protected]>
1514
# William Stein <[email protected]>
1615
#
1716
# Distributed under the terms of the GNU General Public License (GPL)
1817
# as published by the Free Software Foundation; either version 2 of
1918
# the License, or (at your option) any later version.
2019
#
21-
# http://www.gnu.org/licenses/
22-
#*****************************************************************************
23-
20+
# https://www.gnu.org/licenses/
21+
# ****************************************************************************
2422
include "sage/libs/linkages/padics/mpz.pxi"
2523
include "CA_template.pxi"
2624

@@ -89,6 +87,8 @@ cdef class pAdicCappedAbsoluteElement(CAElement):
8987
"""
9088
def lift(self):
9189
"""
90+
EXAMPLES::
91+
9292
sage: R = ZpCA(3)
9393
sage: R(10).lift()
9494
10

0 commit comments

Comments
 (0)