Skip to content

Commit a052558

Browse files
committed
add some missing EXAMPLES
1 parent 4541564 commit a052558

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
@@ -374,33 +374,35 @@ def items(self):
374374
@cached_method
375375
def __getitem__(self, item):
376376
r"""
377-
sage: from sage.knots.knotinfo import KnotInfo
378-
sage: L = KnotInfo.L4a1_0
379-
sage: L[L.items.alternating]
380-
'Y'
381-
sage: L[L.items.arc_notation]
382-
'{{6, 4}, {3, 5}, {4, 2}, {1, 3}, {2, 6}, {5, 1}}'
383-
sage: L[L.items.braid_notation]
384-
'{3, {-2, -2, -1, 2, -1}}'
385-
sage: L[0]
386-
Traceback (most recent call last):
387-
...
388-
KeyError: "Item must be an instance of <enum 'KnotInfoColumns'>"
377+
EXAMPLES::
378+
379+
sage: from sage.knots.knotinfo import KnotInfo
380+
sage: L = KnotInfo.L4a1_0
381+
sage: L[L.items.alternating]
382+
'Y'
383+
sage: L[L.items.arc_notation]
384+
'{{6, 4}, {3, 5}, {4, 2}, {1, 3}, {2, 6}, {5, 1}}'
385+
sage: L[L.items.braid_notation]
386+
'{3, {-2, -2, -1, 2, -1}}'
387+
sage: L[0]
388+
Traceback (most recent call last):
389+
...
390+
KeyError: "Item must be an instance of <enum 'KnotInfoColumns'>"
389391
"""
390392
if not isinstance(item, KnotInfoColumns):
391-
raise KeyError('Item must be an instance of %s' %(KnotInfoColumns))
393+
raise KeyError('Item must be an instance of %s' % (KnotInfoColumns))
392394
if item.column_type() == item.types.OnlyLinks and self.is_knot():
393-
raise KeyError('Item not available for knots' %(KnotInfoColumns))
395+
raise KeyError('Item not available for knots' % (KnotInfoColumns))
394396
if item.column_type() == item.types.OnlyKnots and not self.is_knot():
395-
raise KeyError('Item not available for links' %(KnotInfoColumns))
397+
raise KeyError('Item not available for links' % (KnotInfoColumns))
396398

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

403-
return l[ind-offset]
405+
return l[ind - offset]
404406

405407
def _offset_knots(self):
406408
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)