Skip to content

Commit f06727c

Browse files
author
Release Manager
committed
gh-36950: `sage.plot`: Update `# needs`, doctest cosmetics; fix `sig_on_count` doctest dataflow warnings <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> Fixes #36920 <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> In part cherry picked from: - #35095 <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> - Depends on #36905 (merged here) <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #36950 Reported by: Matthias Köppe Reviewer(s): David Coudert
2 parents eae15fe + 49babd6 commit f06727c

18 files changed

+78
-58
lines changed

src/sage/doctest/sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def _process_doc(self, doctests, doc, namespace, start):
238238
# Line number refers to the end of the docstring
239239
sigon = doctest.Example(sig_on_count_doc_doctest, "0\n", lineno=docstring.count("\n"))
240240
sigon.sage_source = sig_on_count_doc_doctest
241-
sigon.optional_tags = frozenset()
241+
sigon.optional_tags = frozenset(self.file_optional_tags)
242242
sigon.probed_tags = frozenset()
243243
dt.examples.append(sigon)
244244
doctests.append(dt)

src/sage/libs/ntl/ntl_ZZ_pEX_linkage.pxi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ cdef inline int celement_pow(ZZ_pEX_c* res, ZZ_pEX_c* x, long e, ZZ_pEX_c *modul
332332
sage: (x+1)^(-2)
333333
1/(x^2 + 2*x + 1)
334334
sage: f = x+(a+1)
335-
sage: f**50 == sum(binomial(50,i)*(a+1)**i*x**(50-i) for i in range(51))
335+
sage: f**50 == sum(binomial(50,i)*(a+1)**i*x**(50-i) for i in range(51)) # needs sage.symbolic
336336
True
337337
338338
TESTS:

src/sage/misc/converting_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
This is used e.g. in the result of a variety, to allow access to the
2626
result no matter how a generator is identified::
2727
28-
sage: # needs sage.rings.number_field
28+
sage: # needs sage.libs.singular sage.rings.number_field
2929
sage: K.<x,y> = QQ[]
3030
sage: I = ideal([x^2 + 2*y - 5, x + y + 3])
3131
sage: V = sorted(I.variety(AA), key=str)

src/sage/misc/replace_dot_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def process_line(location, line, replacements, row_index, verbose=False):
298298
sage: from sage.misc.replace_dot_all import *
299299
sage: location = os.path.join(sage.env.SAGE_SRC, 'sage/plot/arc.py')
300300
sage: replacements = find_replacements(location, package_regex='sage[.]plot[.]all', verbose=True); replacements
301-
[[476, 24, 'from sage.plot.graphics import Graphics']]
301+
[[477, 24, 'from sage.plot.graphics import Graphics']]
302302
sage: with open(location, "r") as file:
303303
....: lines = file.readlines()
304304
sage: row_index, col_number, *_ = replacements[0]

src/sage/misc/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def __eq__(self, other):
293293
294294
EXAMPLES::
295295
296-
sage: # needs sage.modules sage.plot
296+
sage: # needs sage.modules sage.plot sage.symbolic
297297
sage: rows = [['a', 'b', 'c'], [1,plot(sin(x)),3], [4,5,identity_matrix(2)]]
298298
sage: T = table(rows, header_row=True)
299299
sage: T2 = table(rows, header_row=True)

src/sage/plot/animate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,8 @@ def make_image(self, frame, filename, **kwds):
453453
....: floor(G.ymin()), ceil(G.ymax()))
454454
....: G.save_image(filename, **kwds)
455455
456-
sage: B = MyAnimation([graphs.CompleteGraph(n) for n in range(7,11)], figsize=5)
456+
sage: B = MyAnimation([graphs.CompleteGraph(n)
457+
....: for n in range(7,11)], figsize=5)
457458
sage: d = B.png()
458459
sage: v = os.listdir(d); v.sort(); v
459460
['00000000.png', '00000001.png', '00000002.png', '00000003.png']

src/sage/plot/arc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(self, x, y, r1, r2, angle, s1, s2, options):
5656
5757
EXAMPLES::
5858
59+
sage: # needs sage.symbolic
5960
sage: A = arc((2,3),1,1,pi/4,(0,pi))
6061
sage: A[0].x == 2
6162
True

src/sage/plot/colors.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def mod_one(x):
215215
0.0
216216
sage: mod_one(-11/7)
217217
0.4285714285714286
218-
sage: mod_one(pi) + mod_one(-pi)
218+
sage: mod_one(pi) + mod_one(-pi) # needs sage.symbolic
219219
1.0
220220
"""
221221
x = float(x)
@@ -1146,9 +1146,10 @@ def hue(h, s=1, v=1):
11461146
This function makes it easy to sample a broad range of colors for
11471147
graphics::
11481148
1149+
sage: # needs sage.symbolic
11491150
sage: p = Graphics()
11501151
sage: for phi in xsrange(0, 2 * pi, 1 / pi):
1151-
....: p += plot(sin(x + phi), (x, -7, 7), rgbcolor = hue(phi))
1152+
....: p += plot(sin(x + phi), (x, -7, 7), rgbcolor=hue(phi))
11521153
sage: p
11531154
Graphics object consisting of 20 graphics primitives
11541155

src/sage/plot/ellipse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def plot3d(self):
220220
TESTS::
221221
222222
sage: from sage.plot.ellipse import Ellipse
223-
sage: Ellipse(0,0,2,1,pi/4,{}).plot3d()
223+
sage: Ellipse(0,0,2,1,pi/4,{}).plot3d() # needs sage.symbolic
224224
Traceback (most recent call last):
225225
...
226226
NotImplementedError

src/sage/plot/graphics.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def is_Graphics(x):
6464
sage: from sage.plot.graphics import is_Graphics
6565
sage: is_Graphics(1)
6666
False
67-
sage: is_Graphics(disk((0.0, 0.0), 1, (0, pi/2)))
67+
sage: is_Graphics(disk((0.0, 0.0), 1, (0, pi/2))) # needs sage.symbolic
6868
True
6969
"""
7070
return isinstance(x, Graphics)
@@ -1359,6 +1359,7 @@ def _set_scale(self, subplot, scale=None, base=None):
13591359
13601360
EXAMPLES::
13611361
1362+
sage: # needs sage.symbolic
13621363
sage: p = plot(x, 1, 10)
13631364
sage: fig = p.matplotlib()
13641365
sage: ax = fig.get_axes()[0]
@@ -1373,6 +1374,7 @@ def _set_scale(self, subplot, scale=None, base=None):
13731374
13741375
TESTS::
13751376
1377+
sage: # needs sage.symbolic
13761378
sage: p._set_scale(ax, 'log')
13771379
Traceback (most recent call last):
13781380
...
@@ -1797,7 +1799,7 @@ def show(self, **kwds):
17971799
17981800
::
17991801
1800-
sage: G.show(scale='semilogy', base=(3,2)) # base ignored for x-axis # needs sage.symbolic
1802+
sage: G.show(scale='semilogy', base=(3,2)) # base ignored for x-axis # needs sage.symbolic
18011803
18021804
The scale can be also given as a 2-tuple or a 3-tuple.::
18031805

0 commit comments

Comments
 (0)