Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta-PR: More # optional doctest tags #34998

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
246 commits
Select commit Hold shift + click to select a range
94b3b6a
Merge branch 'features' into sd117_more_optional_doctest_tags
mkoeppe Mar 14, 2023
e32dc24
Merge branch 'sage_geometry_more_optional_tags' into sd117_more_optio…
mkoeppe Mar 14, 2023
783a17c
src/sage/categories/homset.py: Add # optional
mkoeppe Feb 1, 2023
2f92a0d
src/sage/arith/misc.py: Add # optional
mkoeppe Feb 1, 2023
fcb44e4
src/sage/categories: Add # optional
mkoeppe Feb 1, 2023
252416c
More # optional
mkoeppe Feb 1, 2023
083c07b
src/sage/sets/recursively_enumerated_set.pyx: Add # optional
mkoeppe Feb 17, 2023
aba16df
src/sage/geometry/hyperplane_arrangement/plot.py: Mark doctests # opt…
mkoeppe Feb 19, 2023
b8d105f
src/sage/matrix/matrix2.pyx: Mark doctests # optional
mkoeppe Feb 19, 2023
95edbdf
src/sage/geometry/lattice_polytope.py: Mark doctests # optional
mkoeppe Feb 19, 2023
3e4bf3b
src/sage/geometry/polyhedron/base2.py: Fix # optional
mkoeppe Feb 20, 2023
c2a98d7
sage.structure: More # optional
mkoeppe Feb 20, 2023
421336d
src/sage/rings/integer_ring.pyx: Add # optional
mkoeppe Feb 20, 2023
c761d1b
src/sage/misc: More # optional
mkoeppe Feb 20, 2023
6651be0
sage.geometry: More # optional
mkoeppe Feb 21, 2023
233eeed
src/sage/geometry/pseudolines.py: More # optional
mkoeppe Feb 21, 2023
24807de
sage.geometry: More # optional
mkoeppe Feb 21, 2023
f511985
src/sage/geometry/relative_interior.py: More # optional
mkoeppe Feb 21, 2023
82e70a5
src/sage/misc/lazy_string.pyx: Add missing # optional
mkoeppe Feb 21, 2023
f84073a
src/sage/structure/coerce.pyx: Add missing # optional
mkoeppe Feb 21, 2023
95df042
sage.structure: More # optional
mkoeppe Feb 22, 2023
97d8aa6
src/sage/structure/factorization.py: Add # optional
mkoeppe Feb 22, 2023
0e9bcc3
sage.structure: More # optional
mkoeppe Feb 22, 2023
d76d681
src/sage/structure/formal_sum.py: Add # optional
mkoeppe Feb 22, 2023
00250dc
src/sage/structure/factory.pyx: Fix up # optional tag
mkoeppe Feb 22, 2023
f9ec151
src/sage/structure: Add missing # optional
mkoeppe Feb 23, 2023
54db3b1
src/sage/sets: Add # optional
mkoeppe Feb 23, 2023
a4fda67
src/sage/structure/unique_representation.py: Fix # optional
mkoeppe Feb 23, 2023
9d05a7e
src/sage/rings/finite_rings: More # optional
mkoeppe Feb 23, 2023
207c1b9
src/sage/structure/global_options.py: More # optional
mkoeppe Feb 23, 2023
e3e5340
src/sage/rings/polynomial: More # optional
mkoeppe Feb 23, 2023
020c5f5
src/sage/arith/misc.py: More # optional
mkoeppe Feb 23, 2023
204e48d
src/sage/categories: More # optional
mkoeppe Feb 23, 2023
bc8a75a
src/sage/misc: More # optional
mkoeppe Feb 23, 2023
337bb3d
src/sage/rings/finite_rings/integer_mod.pyx: Fix # optional
mkoeppe Feb 23, 2023
c4c2f1c
src/sage/sets/set.py: Fix # optional
mkoeppe Feb 23, 2023
791c134
sage.rings: Add more # optional
mkoeppe Feb 24, 2023
0be81b8
sage.repl: Add more # optional
mkoeppe Feb 24, 2023
089c807
sage.categories: Add more # optional
mkoeppe Feb 24, 2023
49ce92a
src/sage/rings/polynomial/multi_polynomial_element.py: Fix reformatte…
mkoeppe Feb 24, 2023
8827093
src/sage/{categories,rings}: Fix up # optional tags
mkoeppe Feb 25, 2023
31e7765
sage.matrix: More # optional
mkoeppe Feb 26, 2023
4b2f3f9
sage.rings.polynomial: More # optional
mkoeppe Feb 26, 2023
141efb3
sage.modules: More # optional
mkoeppe Feb 26, 2023
228e9f7
sage.modules, sage.matrix: More # optional
mkoeppe Feb 26, 2023
abc321f
sage.modules, sage.matrix: Fix up # optional
mkoeppe Feb 26, 2023
fd33003
src/sage/matrix/matrix2.pyx: More # optional
mkoeppe Feb 26, 2023
99a5936
src/sage/misc/sageinspect.py: More # optional
mkoeppe Feb 26, 2023
61acfb7
src/sage/matrix/matrix_polynomial_dense.pyx: Fix reformatted doctest
mkoeppe Feb 27, 2023
6c16480
sage.typeset: More # optional
mkoeppe Feb 27, 2023
701c64e
sage.tensor: More # optional
mkoeppe Feb 27, 2023
d01648e
sage.sets: More # optional
mkoeppe Feb 27, 2023
fc55240
sage.structure: More # optional
mkoeppe Feb 27, 2023
9e22869
sage.repl: More # optional
mkoeppe Feb 27, 2023
0fd4b68
sage.typeset: Restore '...' in doctest output
mkoeppe Feb 27, 2023
695d59b
src/sage/structure/indexed_generators.py: More # optional
mkoeppe Mar 1, 2023
74d1e90
sage.rings: More # optional
mkoeppe Mar 1, 2023
f5484ec
sage.sets: More # optional
mkoeppe Mar 1, 2023
5e924c4
src/sage/rings/polynomial/multi_polynomial_ideal.py: Fix # optional
mkoeppe Mar 1, 2023
c1536bf
src/sage/matrix/special.py: Mark doctests # optional - sage.symbolic
mkoeppe Feb 17, 2023
a85b3d4
More # optional
mkoeppe Feb 20, 2023
531c662
sage.sets: Add more # optional
mkoeppe Feb 24, 2023
93d3434
More # optional
mkoeppe Feb 26, 2023
9f5d52d
sage.misc: More # optional
mkoeppe Mar 2, 2023
eacc755
sage.repl: More # optional
mkoeppe Mar 2, 2023
b7fd2d6
src/sage/arith/misc.py: More # optional
mkoeppe Mar 3, 2023
7ecd503
sage.categories: Add more # optional
mkoeppe Mar 3, 2023
6d7a2b6
sage.categories: More # optional
mkoeppe Mar 3, 2023
d5bfc93
sage.categories: More # optional
mkoeppe Mar 3, 2023
b5042b9
sage.categories: More # optional
mkoeppe Mar 3, 2023
500f814
sage.structure: More # optional
mkoeppe Mar 3, 2023
7ab8818
sage.misc: More # optional
mkoeppe Mar 3, 2023
454af53
sage.rings: More # optional
mkoeppe Mar 3, 2023
c0ace87
sage.sets: More # optional
mkoeppe Mar 3, 2023
70cb6d3
sage.cpython: More # optional
mkoeppe Mar 3, 2023
979dc90
src/sage/rings/polynomial/flatten.py: More # optional
mkoeppe Mar 4, 2023
d3045d6
sage.rings: More # optional (fixup)
mkoeppe Mar 4, 2023
dddc068
sage.misc: More # optional (fixup)
mkoeppe Mar 4, 2023
410a94e
sage.categories: More # optional
mkoeppe Mar 4, 2023
969e402
sage.structure: More # optional
mkoeppe Mar 4, 2023
f84d4bd
sage.misc: More # optional
mkoeppe Mar 4, 2023
f53de64
sage.arith: More # optional
mkoeppe Mar 4, 2023
4e30a9b
sage.sets: More # optional
mkoeppe Mar 4, 2023
9151d25
sage.misc: More # optional
mkoeppe Mar 4, 2023
ca0f804
src/sage/categories/magmas.py: More # optional
mkoeppe Mar 4, 2023
c888f17
sage.categories: More # optional
mkoeppe Mar 4, 2023
b87bf58
sage.misc: More # optional
mkoeppe Mar 4, 2023
9993723
sage.structure: More # optional
mkoeppe Mar 5, 2023
81d0ad0
sage.categories: More # optional
mkoeppe Mar 5, 2023
6b4509b
sage.misc: More # optional
mkoeppe Mar 5, 2023
8892cfc
src/sage/rings/polynomial: More # optional
mkoeppe Mar 5, 2023
b023433
src/sage/rings: More # optional
mkoeppe Mar 5, 2023
88217f5
sage.categories: More # optional
mkoeppe Mar 5, 2023
a2f5207
src/sage/rings/polynomial/polynomial_ring.py: More # optional
mkoeppe Mar 5, 2023
64fcfd1
src/sage/rings: More # optional
mkoeppe Mar 5, 2023
efeaa15
sage.arith: More # optional
mkoeppe Mar 5, 2023
1e2a60e
sage.categories: More # optional
mkoeppe Mar 5, 2023
d47aa02
sage.rings.polynomial: More # optional
mkoeppe Mar 5, 2023
d17505f
sage.misc: More # optional
mkoeppe Mar 5, 2023
4f0bf6b
sage.categories: More # optional
mkoeppe Mar 5, 2023
a8ce96b
sage.graphs: Add # optional - networkx etc.
mkoeppe Mar 6, 2023
d4d5904
sage.symbolic: Add # optional - numpy, sympy
mkoeppe Mar 6, 2023
988ed16
sage.plot: Add # optional - numpy
mkoeppe Mar 6, 2023
1def27d
sage.functions: Add # optional - mpmath, numpy, sympy
mkoeppe Mar 6, 2023
e9d094e
sage.calculus: Add # optional - numpy, sympy
mkoeppe Mar 6, 2023
2157678
sage.repl: Add # optional - pexpect
mkoeppe Mar 6, 2023
8d24f08
sage.geometry, sage.manifolds: Add # optional - pplpy, numpy
mkoeppe Mar 6, 2023
5eb9b04
sage.structure: Add # optional - mpmath, numpy etc.
mkoeppe Mar 6, 2023
23274f3
sage.matrix, sage.modules: Add # optional - numpy, fpylll, etc.
mkoeppe Mar 6, 2023
a2782be
Add # optional - numpy etc.
mkoeppe Mar 6, 2023
b68c9a0
src/sage/rings/polynomial/ideal.py: Add # optional
mkoeppe Mar 6, 2023
a1cec07
sage.rings: More # optional
mkoeppe Mar 6, 2023
354ff52
sage.rings: More # optional
mkoeppe Mar 7, 2023
c3e6757
sage.structure: More # optional
mkoeppe Mar 7, 2023
d6da2c4
sage.misc: More # optional
mkoeppe Mar 7, 2023
e8415fd
sage.categories: More # optional
mkoeppe Mar 7, 2023
270c55a
sage.rings: More # optional
mkoeppe Mar 7, 2023
b7c4bd8
sage.arith: More # optional
mkoeppe Mar 7, 2023
b4d1d53
src/sage/rings/noncommutative_ideals.pyx: # optional
mkoeppe Mar 7, 2023
3a383c4
src/sage/groups/matrix_gps/finitely_generated.py: Mark doctests # opt…
mkoeppe Jul 24, 2022
ebbf874
src/sage/ext/fast_callable.pyx: Mark doctests # optional - sage.symbo…
mkoeppe Feb 1, 2023
6c77c6f
sage.arith: More # optional
mkoeppe Mar 8, 2023
a08a031
sage.misc: More # optional
mkoeppe Mar 8, 2023
861cc13
sage.categories: More # optional
mkoeppe Mar 8, 2023
f856711
src/sage/rings/polynomial/polynomial_element.pyx: More # optional
mkoeppe Mar 8, 2023
4cacc25
src/sage/categories/algebras_with_basis.py: Fix up
mkoeppe Mar 3, 2023
a925579
sage.rings: More # optional
mkoeppe Mar 4, 2023
92b03f5
sage.sets: More # optional
mkoeppe Mar 8, 2023
8869f28
sage.categories: More # optional
mkoeppe Mar 8, 2023
c11ee50
sage.sets: More # optional
mkoeppe Mar 8, 2023
977a40f
sage.misc: More # optional
mkoeppe Mar 8, 2023
6a2a772
sage.categories: In # optional, no commas between tags
mkoeppe Mar 8, 2023
6ad9589
sage.rings: In # optional, no commas between tags
mkoeppe Mar 8, 2023
bd1f696
sage.structure: In # optional, no commas between tags
mkoeppe Mar 8, 2023
0d01c11
sage.geometry: In # optional, no commas between tags
mkoeppe Mar 8, 2023
bd28d78
sage.misc: In # optional, no commas between tags
mkoeppe Mar 8, 2023
7a9ebef
In # optional, no commas between tags
mkoeppe Mar 8, 2023
77998ab
sage.features: Add feature sage.modules
mkoeppe Mar 3, 2023
887e5ed
sage.features: Add sage.libs.flint, sage.libs.ntl, sage.rings.polynom…
mkoeppe Mar 9, 2023
d6be3bb
src/sage/arith/misc.py: Add # optional - sage.libs.ntl
mkoeppe Mar 9, 2023
0fd307d
sage.misc: More # optional
mkoeppe Mar 9, 2023
9aa3305
sage.misc: More # optional
mkoeppe Mar 9, 2023
799a32a
sage.repl: More # optional
mkoeppe Mar 9, 2023
32a979e
sage.rings: More # optional
mkoeppe Mar 9, 2023
d2e85f4
src/sage/cpython/getattr.pyx: Fix up doctest
mkoeppe Mar 4, 2023
628bd94
src/sage/misc/cachefunc.pyx: Update doctest output
mkoeppe Feb 22, 2023
f80a0f1
sage.matrix: Add # optional
mkoeppe Mar 9, 2023
d31854c
sage.matrix, sage.modules: Add # optional
mkoeppe Mar 10, 2023
7890396
sage.modules: More # optional
mkoeppe Mar 11, 2023
134f5e7
sage.matrix: More # optional
mkoeppe Mar 11, 2023
33d47e6
sage.numerical: More # optional
mkoeppe Mar 11, 2023
c436d99
More # optional
mkoeppe Mar 11, 2023
49b967b
sage.arith: More # optional
mkoeppe Mar 11, 2023
3686a5f
sage.categories: More # optional
mkoeppe Mar 11, 2023
b4d8cb8
sage.combinat: More # optional
mkoeppe Mar 11, 2023
42d53ad
sage.groups.additive_abelian: More # optional
mkoeppe Mar 11, 2023
e3e8393
sage.arith: More # optional
mkoeppe Mar 12, 2023
1d8c4ce
sage.parallel: More # optional
mkoeppe Mar 12, 2023
268905c
sage.data_structures: More # optional
mkoeppe Mar 12, 2023
bf02951
src/sage/groups/old.pyx: Add # optional
mkoeppe Mar 12, 2023
1c7dc3e
sage.categories: More # optional
mkoeppe Mar 12, 2023
501522b
sage.matroids: More # optional
mkoeppe Mar 12, 2023
a9038b4
sage.structure: More # optional
mkoeppe Mar 12, 2023
c0dd952
src/sage/groups/additive_abelian/additive_abelian_wrapper.py: More # …
mkoeppe Mar 12, 2023
a9c42ca
sage.topology: Mark doctests # optional - sage.graphs
mkoeppe Mar 12, 2023
e9db499
sage.topology: Mark doctests # optional - sage.groups
mkoeppe Mar 12, 2023
6f4550a
sage.topology: Move import of pyparsing into method, mark doctests # …
mkoeppe Mar 12, 2023
563ab9f
sage.misc: More # optional
mkoeppe Mar 12, 2023
65f0d13
sage.combinat.{free_module,integer_vector}: Mark doctests # optional …
mkoeppe Mar 12, 2023
3146823
sage.matrix: More # optional
mkoeppe Mar 12, 2023
2310675
sage.cpython: More # optional
mkoeppe Mar 12, 2023
7e925bf
src/sage/env.py: More # optional
mkoeppe Mar 12, 2023
00b18cc
sage.matroids: More # optional
mkoeppe Mar 12, 2023
376b1b6
sage.numerical: More # optional
mkoeppe Mar 12, 2023
7f8fd4c
sage.repl: More # optional
mkoeppe Mar 12, 2023
a5314ff
sage.modules: More # optional
mkoeppe Mar 12, 2023
de20600
sage.misc: More # optional
mkoeppe Mar 12, 2023
2e2dfec
sage.parallel: More # optional
mkoeppe Mar 12, 2023
324d923
sage.rings: More # optional
mkoeppe Mar 13, 2023
9a3f52e
sage.rings.polynomial: More # optional
mkoeppe Mar 13, 2023
7901c52
sage.homology: More # optional
mkoeppe Mar 13, 2023
be6eaf0
sage.homology: More # optional
mkoeppe Mar 13, 2023
61cef70
sage.rings: More # optional
mkoeppe Mar 13, 2023
9cbb1ac
sage.typeset: More # optional
mkoeppe Mar 13, 2023
5502a30
sage.structure: More # optional
mkoeppe Mar 13, 2023
8192d1f
sage.groups: More # optional
mkoeppe Mar 13, 2023
c2aade6
sage.matrix: More # optional
mkoeppe Mar 13, 2023
c7e5da1
sage.typeset: More # optional
mkoeppe Mar 13, 2023
87ce07d
sage.structure: More # optional
mkoeppe Mar 13, 2023
be92a61
sage.misc: More # optional
mkoeppe Mar 13, 2023
98b9451
sage.modules: More # optional
mkoeppe Mar 13, 2023
332f5f5
sage.sets: More # optional
mkoeppe Mar 18, 2023
365a022
sage.misc: More # optional
mkoeppe Mar 18, 2023
72eaae2
sage.parallel: More # optional
mkoeppe Mar 18, 2023
34acf25
sage.homology: More # optional
mkoeppe Mar 18, 2023
30b9991
sage.groups: More # optional
mkoeppe Mar 18, 2023
ef48fa0
src/sage/geometry: More # optional
mkoeppe Mar 18, 2023
fa9d589
sage.matrix: More # optional
mkoeppe Mar 18, 2023
83309da
Merge tag '10.0.beta6' into sd117_more_optional_doctest_tags
mkoeppe Mar 26, 2023
305da46
Merge remote-tracking branch 'upstream/develop' into sd117_more_optio…
mkoeppe Apr 2, 2023
f8d13b6
sage.categories: Reformat # optional - sage... to narrower layout, us…
mkoeppe Apr 2, 2023
6dbd0c9
sage.categories: Reformat # optional - sage... to narrower layout, us…
mkoeppe Apr 2, 2023
69a62b3
sage.categories: Reformat # optional - sage... to narrower layout, us…
mkoeppe Apr 2, 2023
5637cfd
sage.categories: Reformat # optional - sage... to narrower layout, us…
mkoeppe Apr 2, 2023
6a4ae43
sage.categories: Add # optional; doctest cosmetics
mkoeppe Apr 2, 2023
c1ccac0
Fixups
mkoeppe Apr 3, 2023
b0a8d9c
Merge branch 'sage_categories_reformat_doctests' into sd117_more_opti…
mkoeppe Apr 3, 2023
93374c2
sage.matrix: Doctest cosmetics
mkoeppe Apr 3, 2023
47acb29
sage.matrix, sage.modules: More doctest cosmetics
mkoeppe Apr 4, 2023
7bc478d
sage.misc: Doctest cosmetics
mkoeppe Apr 4, 2023
9cf97eb
sage.[a-d]*: Doctest cosmetics
mkoeppe Apr 4, 2023
b6bf2bb
src/sage/matrix/matrix2.pyx: Fixup
mkoeppe Apr 4, 2023
4945f01
src/sage/misc/c3_controlled.pyx: Fix up
mkoeppe Apr 4, 2023
7112c9c
sage.structure: Doctest cosmetics
mkoeppe Apr 5, 2023
aa51f45
sage.sets: Doctest cosmetics
mkoeppe Apr 6, 2023
08c6956
sage.repl: Doctest cosmetics
mkoeppe Apr 6, 2023
f675728
sage.numerical: Doctest cosmetics
mkoeppe Apr 6, 2023
858026a
sage.plot: Doctest cosmetics
mkoeppe Apr 6, 2023
ec721bd
Doctest cosmetics
mkoeppe Apr 6, 2023
beb7986
sage.doctest: Doctest cosmetics
mkoeppe Apr 6, 2023
9294894
src/sage/sets/recursively_enumerated_set.pyx: Fix up
mkoeppe Apr 6, 2023
22e2196
Merge tag '10.0.beta8' into sage_categories_reformat_doctests
mkoeppe Apr 7, 2023
86d857a
Merge tag '10.0.beta8' into sd117_more_optional_doctest_tags
mkoeppe Apr 7, 2023
4fc45a1
sage.categories: More # optional
mkoeppe Apr 7, 2023
fb8c089
sage.categories: Align # optional
mkoeppe Apr 7, 2023
978fe20
Fixups
mkoeppe Apr 7, 2023
dae9b08
sage.rings: Add # optional
mkoeppe Apr 8, 2023
4d20f8a
sage.rings: Reformat doctests and # optional
mkoeppe Apr 8, 2023
49f068f
Merge branch 'sage_rings_optional_annotations' into sd117_more_option…
mkoeppe Apr 8, 2023
2e8a3bb
sage.rings: More # optional
mkoeppe Apr 8, 2023
2d4a62b
sage.rings: Reformat doctests and # optional
mkoeppe Apr 8, 2023
1c15000
src/sage/misc/cachefunc.pyx: Update doctest output
mkoeppe Feb 22, 2023
c1721ab
src/sage/rings/multi_power_series_ring_element.py: Fix up
mkoeppe Apr 8, 2023
a0e7176
sage.rings: Align # optional
mkoeppe Apr 8, 2023
82fa637
Merge branch 'sage_rings_optional_annotations' into sd117_more_option…
mkoeppe Apr 8, 2023
f00b281
sage.rings: Doctest cosmetics
mkoeppe Apr 8, 2023
ab389e2
sage.rings: More doctest cosmetics
mkoeppe Apr 9, 2023
1a09248
src/sage/rings/integer.pyx: Fix up
mkoeppe Apr 9, 2023
64d094c
src/sage/rings/polynomial/multi_polynomial_sequence.py: Doctest cosme…
mkoeppe Apr 9, 2023
0148f5c
src/sage/rings/polynomial/multi_polynomial_sequence.py: Fix up
mkoeppe Apr 9, 2023
d7b15d2
sage.rings: More doctest cosmetics
mkoeppe Apr 9, 2023
d8bd93c
src/sage/sets/set_from_iterator.py: Fix up doctest
mkoeppe Apr 9, 2023
4b6a8df
Merge branch 'sage_rings_optional_annotations' into sd117_more_option…
mkoeppe Apr 9, 2023
c2a9e90
Merge branch 'sage_categories_reformat_doctests' into sd117_more_opti…
mkoeppe Apr 9, 2023
e340092
Merge branch 'sage_quadratic_forms_modularization' into sd117_more_op…
mkoeppe Apr 14, 2023
ab44e66
Merge tag '10.0.rc0' into sd117_more_optional_doctest_tags
mkoeppe Apr 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 11 additions & 11 deletions src/sage/arith/functions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def lcm(a, b=None):

EXAMPLES::

sage: lcm(97,100)
sage: lcm(97, 100)
9700
sage: LCM(97,100)
sage: LCM(97, 100)
9700
sage: LCM(0,2)
sage: LCM(0, 2)
0
sage: LCM(-3,-5)
sage: LCM(-3, -5)
15
sage: LCM([1,2,3,4,5])
60
sage: v = LCM(range(1,10000)) # *very* fast!
sage: v = LCM(range(1, 10000)) # *very* fast!
sage: len(str(v))
4349

Expand All @@ -72,25 +72,25 @@ def lcm(a, b=None):

Make sure we try `\QQ` and not merely `\ZZ` (:trac:`13014`)::

sage: bool(lcm(2/5, 3/7) == lcm(SR(2/5), SR(3/7)))
sage: bool(lcm(2/5, 3/7) == lcm(SR(2/5), SR(3/7))) # optional - sage.symbolic
True

Make sure that the lcm of Expressions stays symbolic::

sage: parent(lcm(2, 4))
Integer Ring
sage: parent(lcm(SR(2), 4))
sage: parent(lcm(SR(2), 4)) # optional - sage.symbolic
Symbolic Ring
sage: parent(lcm(2, SR(4)))
sage: parent(lcm(2, SR(4))) # optional - sage.symbolic
Symbolic Ring
sage: parent(lcm(SR(2), SR(4)))
sage: parent(lcm(SR(2), SR(4))) # optional - sage.symbolic
Symbolic Ring

Verify that objects without lcm methods but which can't be
coerced to `\ZZ` or `\QQ` raise an error::

sage: F.<x,y> = FreeMonoid(2)
sage: lcm(x,y)
sage: F.<x,y> = FreeMonoid(2) # optional - sage.groups
sage: lcm(x,y) # optional - sage.groups
Traceback (most recent call last):
...
TypeError: unable to find lcm of x and y
Expand Down
1,194 changes: 604 additions & 590 deletions src/sage/arith/misc.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/sage/arith/multi_modular.pyx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - primecountpy
"""
Utility classes for multi-modular algorithms
"""
Expand Down
17 changes: 9 additions & 8 deletions src/sage/calculus/riemann.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1190,10 +1190,11 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
EXAMPLES::

sage: from sage.calculus.riemann import complex_to_spiderweb
sage: import numpy
sage: zval = numpy.array([[0, 1, 1000],[.2+.3j,1,-.3j],[0,0,0]],dtype = numpy.complex128)
sage: deriv = numpy.array([[.1]],dtype = numpy.float64)
sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,False,0.001)
sage: import numpy # optional - numpy
sage: zval = numpy.array([[0,1,1000], [.2+.3j,1,-.3j], [0,0,0]], # optional - numpy
....: dtype=numpy.complex128)
sage: deriv = numpy.array([[.1]],dtype = numpy.float64) # optional - numpy
sage: complex_to_spiderweb(zval, deriv, deriv, 4, 4, [0,0,0], 1, False, 0.001) # optional - numpy
array([[[1., 1., 1.],
[1., 1., 1.],
[1., 1., 1.]],
Expand All @@ -1206,7 +1207,7 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
[1., 1., 1.],
[1., 1., 1.]]])

sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,True,0.001)
sage: complex_to_spiderweb(zval, deriv, deriv, 4, 4, [0,0,0], 1, True, 0.001) # optional - numpy
array([[[1. , 1. , 1. ],
[1. , 0.05558355, 0.05558355],
[0.17301243, 0. , 0. ]],
Expand Down Expand Up @@ -1280,13 +1281,13 @@ cpdef complex_to_rgb(np.ndarray[COMPLEX_T, ndim = 2] z_values):
EXAMPLES::

sage: from sage.calculus.riemann import complex_to_rgb
sage: import numpy
sage: complex_to_rgb(numpy.array([[0, 1, 1000]], dtype = numpy.complex128))
sage: import numpy # optional - numpy
sage: complex_to_rgb(numpy.array([[0, 1, 1000]], dtype=numpy.complex128)) # optional - numpy
array([[[1. , 1. , 1. ],
[1. , 0.05558355, 0.05558355],
[0.17301243, 0. , 0. ]]])

sage: complex_to_rgb(numpy.array([[0, 1j, 1000j]], dtype = numpy.complex128))
sage: complex_to_rgb(numpy.array([[0, 1j, 1000j]], dtype=numpy.complex128)) # optional - numpy
array([[[1. , 1. , 1. ],
[0.52779177, 1. , 0.05558355],
[0.08650622, 0.17301243, 0. ]]])
Expand Down
80 changes: 40 additions & 40 deletions src/sage/calculus/test_sympy.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,98 +102,98 @@

And here are some actual tests of sympy::

sage: from sympy import Symbol, cos, sympify, pprint
sage: from sympy.abc import x
sage: from sympy import Symbol, cos, sympify, pprint # optional - sympy
sage: from sympy.abc import x # optional - sympy

::

sage: e = (1/cos(x)^3)._sympy_(); e
sage: e = (1/cos(x)^3)._sympy_(); e # optional - sympy
cos(x)**(-3)
sage: f = e.series(x, 0, int(10)); f
sage: f = e.series(x, 0, int(10)); f # optional - sympy
1 + 3*x**2/2 + 11*x**4/8 + 241*x**6/240 + 8651*x**8/13440 + O(x**10)

And the pretty-printer. Since unicode characters are not working on
some architectures, we disable it::

sage: from sympy.printing import pprint_use_unicode
sage: prev_use = pprint_use_unicode(False)
sage: pprint(e)
sage: from sympy.printing import pprint_use_unicode # optional - sympy
sage: prev_use = pprint_use_unicode(False) # optional - sympy
sage: pprint(e) # optional - sympy
1
-------
3
cos (x)

sage: pprint(f)
sage: pprint(f) # optional - sympy
2 4 6 8
3*x 11*x 241*x 8651*x / 10\
1 + ---- + ----- + ------ + ------- + O\x /
2 8 240 13440
sage: pprint_use_unicode(prev_use)
sage: pprint_use_unicode(prev_use) # optional - sympy
False

And the functionality to convert from sympy format to Sage format::

sage: e._sage_()
sage: e._sage_() # optional - sympy
cos(x)^(-3)
sage: e._sage_().taylor(x._sage_(), 0, 8)
sage: e._sage_().taylor(x._sage_(), 0, 8) # optional - sympy
8651/13440*x^8 + 241/240*x^6 + 11/8*x^4 + 3/2*x^2 + 1
sage: f._sage_()
sage: f._sage_() # optional - sympy
8651/13440*x^8 + 241/240*x^6 + 11/8*x^4 + 3/2*x^2 + Order(x^10) + 1

Mixing SymPy with Sage::

sage: import sympy
sage: var("x")._sympy_() + var("y")._sympy_()
sage: import sympy # optional - sympy
sage: var("x")._sympy_() + var("y")._sympy_() # optional - sympy
x + y
sage: o = var("omega")
sage: s = sympy.Symbol("x")
sage: t1 = s + o
sage: t2 = o + s
sage: type(t1)
sage: o = var("omega") # optional - sympy
sage: s = sympy.Symbol("x") # optional - sympy
sage: t1 = s + o # optional - sympy
sage: t2 = o + s # optional - sympy
sage: type(t1) # optional - sympy
<class 'sympy.core.add.Add'>
sage: type(t2)
sage: type(t2) # optional - sympy
<class 'sage.symbolic.expression.Expression'>
sage: t1, t2
sage: t1, t2 # optional - sympy
(omega + x, omega + x)
sage: e=sympy.sin(var("y"))+sage.all.cos(sympy.Symbol("x"))
sage: type(e)
sage: e = sympy.sin(var("y"))+sage.all.cos(sympy.Symbol("x")) # optional - sympy
sage: type(e) # optional - sympy
<class 'sympy.core.add.Add'>
sage: e
sage: e # optional - sympy
sin(y) + cos(x)
sage: e=e._sage_()
sage: type(e)
sage: e=e._sage_() # optional - sympy
sage: type(e) # optional - sympy
<class 'sage.symbolic.expression.Expression'>
sage: e
sage: e # optional - sympy
cos(x) + sin(y)
sage: e = sage.all.cos(var("y")**3)**4+var("x")**2
sage: e = e._sympy_()
sage: e
sage: e = sage.all.cos(var("y")**3)**4+var("x")**2 # optional - sympy
sage: e = e._sympy_() # optional - sympy
sage: e # optional - sympy
x**2 + cos(y**3)**4

::

sage: a = sympy.Matrix([1, 2, 3])
sage: a[1]
sage: a = sympy.Matrix([1, 2, 3]) # optional - sympy
sage: a[1] # optional - sympy
2

::

sage: sympify(1.5)
sage: sympify(1.5) # optional - sympy
1.50000000000000
sage: sympify(2)
sage: sympify(2) # optional - sympy
2
sage: sympify(-2)
sage: sympify(-2) # optional - sympy
-2

TESTS:

This was fixed in Sympy, see :trac:`14437`::

sage: from sympy import Function, Symbol, rsolve
sage: u = Function('u')
sage: n = Symbol('n', integer=True)
sage: f = u(n+2) - u(n+1) + u(n)/4
sage: expand(2**n * rsolve(f,u(n)))
sage: from sympy import Function, Symbol, rsolve # optional - sympy
sage: u = Function('u') # optional - sympy
sage: n = Symbol('n', integer=True) # optional - sympy
sage: f = u(n+2) - u(n+1) + u(n)/4 # optional - sympy
sage: expand(2**n * rsolve(f,u(n))) # optional - sympy
2*C1*n + C0

"""
67 changes: 38 additions & 29 deletions src/sage/categories/action.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ A group action `G \times S \rightarrow S` is a functor from `G` to Sets.
sage: import gc
sage: _ = gc.collect()
sage: A
<repr(<sage.categories.action.Action at 0x...>) failed: RuntimeError: This action acted on a set that became garbage collected>
<repr(<sage.categories.action.Action at 0x...>) failed:
RuntimeError: This action acted on a set that became garbage collected>

To avoid garbage collection of the underlying set, it is sufficient to
create a strong reference to it before the action is created.
Expand Down Expand Up @@ -265,15 +266,17 @@ cdef class Action(Functor):
sage: R = (ZZ['x'])['y']
sage: A = R.get_action(P,operator.mul,True)
sage: A # indirect doctest
Right scalar multiplication by Univariate Polynomial Ring in x over
Rational Field on Univariate Polynomial Ring in y over Univariate
Polynomial Ring in x over Integer Ring
Right scalar multiplication
by Univariate Polynomial Ring in x over Rational Field
on Univariate Polynomial Ring in y over
Univariate Polynomial Ring in x over Integer Ring

In this example, the underlying set is the ring ``R``. This is the same
as the left domain, which is different from the codomain of the action::

sage: A.codomain()
Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field
Univariate Polynomial Ring in y
over Univariate Polynomial Ring in x over Rational Field
sage: A.codomain() == R
False
sage: A.left_domain() is R
Expand All @@ -294,7 +297,8 @@ cdef class Action(Functor):
sage: import gc
sage: _ = gc.collect()
sage: A
<repr(<sage.categories.action.Action at 0x...>) failed: RuntimeError: This action acted on a set that became garbage collected>
<repr(<sage.categories.action.Action at 0x...>) failed:
RuntimeError: This action acted on a set that became garbage collected>
"""
S = self.US()
if S is None:
Expand Down Expand Up @@ -329,24 +333,28 @@ cdef class InverseAction(Action):

EXAMPLES::

sage: V = QQ^3
sage: v = V((1, 2, 3))
sage: V = QQ^3 # optional - sage.modules
sage: v = V((1, 2, 3)) # optional - sage.modules
sage: cm = get_coercion_model()

sage: a = cm.get_action(V, QQ, operator.mul)
sage: a
Right scalar multiplication by Rational Field on Vector space of dimension 3 over Rational Field
sage: ~a
Right inverse action by Rational Field on Vector space of dimension 3 over Rational Field
sage: (~a)(v, 1/3)
sage: a = cm.get_action(V, QQ, operator.mul) # optional - sage.modules
sage: a # optional - sage.modules
Right scalar multiplication by Rational Field
on Vector space of dimension 3 over Rational Field
sage: ~a # optional - sage.modules
Right inverse action by Rational Field
on Vector space of dimension 3 over Rational Field
sage: (~a)(v, 1/3) # optional - sage.modules
(3, 6, 9)

sage: b = cm.get_action(QQ, V, operator.mul)
sage: b
Left scalar multiplication by Rational Field on Vector space of dimension 3 over Rational Field
sage: ~b
Left inverse action by Rational Field on Vector space of dimension 3 over Rational Field
sage: (~b)(1/3, v)
sage: b = cm.get_action(QQ, V, operator.mul) # optional - sage.modules
sage: b # optional - sage.modules
Left scalar multiplication by Rational Field
on Vector space of dimension 3 over Rational Field
sage: ~b # optional - sage.modules
Left inverse action by Rational Field
on Vector space of dimension 3 over Rational Field
sage: (~b)(1/3, v) # optional - sage.modules
(3, 6, 9)

sage: c = cm.get_action(ZZ, list, operator.mul)
Expand Down Expand Up @@ -390,11 +398,11 @@ cdef class InverseAction(Action):

Check that this action can be pickled (:trac:`29031`)::

sage: V = QQ^3
sage: v = V((1, 2, 3))
sage: cm = get_coercion_model()
sage: a = cm.get_action(V, QQ, operator.mul)
sage: loads(dumps(~a)) is not None
sage: V = QQ^3 # optional - sage.modules
sage: v = V((1, 2, 3)) # optional - sage.modules
sage: cm = get_coercion_model() # optional - sage.modules
sage: a = cm.get_action(V, QQ, operator.mul) # optional - sage.modules
sage: loads(dumps(~a)) is not None # optional - sage.modules
True
"""
return (type(self), (self._action,))
Expand Down Expand Up @@ -434,8 +442,9 @@ cdef class PrecomposedAction(Action):
sage: c,x = v[0]
sage: y = x.modular_symbol_rep()
sage: coercion_model.get_action(QQ, parent(y), op=operator.mul)
Left scalar multiplication by Rational Field on Abelian Group of all Formal Finite Sums over Rational Field
with precomposition on right by Coercion map:
Left scalar multiplication by Rational Field
on Abelian Group of all Formal Finite Sums over Rational Field
with precomposition on right by Coercion map:
From: Abelian Group of all Formal Finite Sums over Integer Ring
To: Abelian Group of all Formal Finite Sums over Rational Field
"""
Expand Down Expand Up @@ -542,8 +551,8 @@ cdef class ActionEndomorphism(Morphism):

sage: A = ZZ['x'].get_action(QQ, self_on_left=False, op=operator.mul)
sage: A
Left scalar multiplication by Rational Field on Univariate Polynomial
Ring in x over Integer Ring
Left scalar multiplication by Rational Field
on Univariate Polynomial Ring in x over Integer Ring
sage: A(1/2)
Action of 1/2 on Univariate Polynomial Ring in x over Integer Ring
under Left scalar multiplication by Rational Field on Univariate
Expand Down
Loading