From 33e7d7052928ed0e23a15082d1332c60c6068672 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 23 Apr 2026 10:16:01 -0400 Subject: [PATCH 1/2] src/sage/repl: remove all "needs sage.foo" tags These are unmaintained, and do nothing in upstream SageMath. --- src/sage/repl/display/fancy_repr.py | 7 ++-- src/sage/repl/display/formatter.py | 24 ++++++------ src/sage/repl/display/jsmol_iframe.py | 2 +- src/sage/repl/display/util.py | 2 +- src/sage/repl/interface_magic.py | 20 +++++----- src/sage/repl/interpreter.py | 18 ++++----- src/sage/repl/ipython_extension.py | 18 +++------ src/sage/repl/ipython_kernel/interact.py | 14 +++---- src/sage/repl/ipython_kernel/widgets.py | 14 +++---- src/sage/repl/load.py | 2 +- src/sage/repl/preparse.py | 17 ++++----- src/sage/repl/rich_output/backend_base.py | 1 - src/sage/repl/rich_output/backend_doctest.py | 16 ++++---- src/sage/repl/rich_output/backend_ipython.py | 4 +- src/sage/repl/rich_output/display_manager.py | 5 +-- src/sage/repl/rich_output/output_basic.py | 2 +- src/sage/repl/rich_output/pretty_print.py | 39 ++++++++++---------- src/sage/repl/user_globals.py | 1 - 18 files changed, 94 insertions(+), 112 deletions(-) diff --git a/src/sage/repl/display/fancy_repr.py b/src/sage/repl/display/fancy_repr.py index 852a7c05efb..ab015eeffb9 100644 --- a/src/sage/repl/display/fancy_repr.py +++ b/src/sage/repl/display/fancy_repr.py @@ -185,7 +185,6 @@ def __call__(self, obj, p, cycle): EXAMPLES:: - sage: # needs sage.modules sage: from sage.repl.display.fancy_repr import LargeMatrixHelpRepr sage: M = identity_matrix(40) sage: pp = LargeMatrixHelpRepr() @@ -196,9 +195,9 @@ def __call__(self, obj, p, cycle): Leads to:: - sage: M # needs sage.modules + sage: M 40 x 40 dense matrix over Integer Ring (use the '.str()' method...) - sage: [M, M] # needs sage.modules + sage: [M, M] [40 x 40 dense matrix over Integer Ring, 40 x 40 dense matrix over Integer Ring] """ @@ -317,7 +316,7 @@ def __call__(self, obj, p, cycle): sage: from sage.repl.display.fancy_repr import TallListRepr sage: format_list = TallListRepr().format_string - sage: format_list([1, 2, identity_matrix(2)]) # needs sage.modules + sage: format_list([1, 2, identity_matrix(2)]) '[\n [1 0]\n1, 2, [0 1]\n]' Check that :issue:`18743` is fixed:: diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py index ceea50f36eb..720cad82c3e 100644 --- a/src/sage/repl/display/formatter.py +++ b/src/sage/repl/display/formatter.py @@ -6,7 +6,7 @@ contains a new facility for displaying lists of matrices in an easier to read format:: - sage: [identity_matrix(i) for i in range(2, 5)] # needs sage.modules + sage: [identity_matrix(i) for i in range(2, 5)] [ [1 0 0 0] [1 0 0] [0 1 0 0] @@ -23,17 +23,17 @@ sage: from sage.repl.interpreter import get_test_shell sage: shell = get_test_shell() sage: shell.run_cell('%display ascii_art') - sage: shell.run_cell('integral(x^2/pi^x, x)') # needs sage.symbolic + sage: shell.run_cell('integral(x^2/pi^x, x)') -x / 2 2 \ -pi *\x *log (pi) + 2*x*log(pi) + 2/ -------------------------------------- 3 log (pi) - sage: shell.run_cell("i = var('i')") # needs sage.symbolic - sage: shell.run_cell('sum(i*x^i, i, 0, 10)') # needs sage.symbolic + sage: shell.run_cell("i = var('i')") + sage: shell.run_cell('sum(i*x^i, i, 0, 10)') 10 9 8 7 6 5 4 3 2 10*x + 9*x + 8*x + 7*x + 6*x + 5*x + 4*x + 3*x + 2*x + x - sage: shell.run_cell('StandardTableaux(4).list()') # needs sage.combinat + sage: shell.run_cell('StandardTableaux(4).list()') [ [ 1 4 1 3 [ 1 3 4 1 2 4 1 2 3 1 3 1 2 2 2 @@ -115,7 +115,7 @@ def format(self, obj, include=None, exclude=None): EXAMPLES:: - sage: [identity_matrix(i) for i in range(3,7)] # needs sage.modules + sage: [identity_matrix(i) for i in range(3,7)] [ [1 0 0 0 0 0] [1 0 0 0 0] [0 1 0 0 0 0] @@ -127,8 +127,8 @@ def format(self, obj, include=None, exclude=None): sage: from sage.repl.interpreter import get_test_shell sage: shell = get_test_shell() sage: shell.run_cell('%display ascii_art') # indirect doctest - sage: shell.run_cell("i = var('i')") # needs sage.symbolic - sage: shell.run_cell('sum(i*x^i, i, 0, 10)') # needs sage.symbolic + sage: shell.run_cell("i = var('i')") + sage: shell.run_cell('sum(i*x^i, i, 0, 10)') 10 9 8 7 6 5 4 3 2 10*x + 9*x + 8*x + 7*x + 6*x + 5*x + 4*x + 3*x + 2*x + x sage: shell.run_cell('%display default') @@ -223,11 +223,11 @@ def _ipython_float_precision_changed(change): sage: shell = get_test_shell() sage: shell.run_cell('%precision 4') '%.4f' - sage: shell.run_cell('matrix.options.precision') # indirect doctest # needs sage.modules + sage: shell.run_cell('matrix.options.precision') # indirect doctest 4 sage: shell.run_cell('%precision') '%r' - sage: shell.run_cell('matrix.options.precision') # indirect doctest # needs sage.modules + sage: shell.run_cell('matrix.options.precision') # indirect doctest None """ try: @@ -299,8 +299,8 @@ def __call__(self, obj): sage: fmt(2) ---- calling ipython formatter ---- '2' - sage: a = identity_matrix(ZZ, 2) # needs sage.modules - sage: fmt([a, a]) # needs sage.modules + sage: a = identity_matrix(ZZ, 2) + sage: fmt([a, a]) ---- calling ipython formatter ---- '[\n[1 0] [1 0]\n[0 1], [0 1]\n]' """ diff --git a/src/sage/repl/display/jsmol_iframe.py b/src/sage/repl/display/jsmol_iframe.py index ef5ecf1cf95..0f1712aad9f 100644 --- a/src/sage/repl/display/jsmol_iframe.py +++ b/src/sage/repl/display/jsmol_iframe.py @@ -112,7 +112,7 @@ def __init__(self, jmol, path_to_jsmol=None, width='100%', height='100%'): EXAMPLES:: sage: from sage.repl.display.jsmol_iframe import JSMolHtml - sage: JSMolHtml(sphere(), width=500, height=300) # needs sage.plot + sage: JSMolHtml(sphere(), width=500, height=300) JSmol Window 500x300 """ from sage.repl.rich_output.output_graphics3d import OutputSceneJmol diff --git a/src/sage/repl/display/util.py b/src/sage/repl/display/util.py index 860fa2a28fb..7bbead555d4 100644 --- a/src/sage/repl/display/util.py +++ b/src/sage/repl/display/util.py @@ -73,7 +73,7 @@ def try_format(self, the_list): TESTS:: sage: from sage.repl.display.util import format_list - sage: print(format_list.try_format( # needs sage.modules + sage: print(format_list.try_format( ....: [matrix([[1, 2, 3, 4], [5, 6, 7, 8]]) for i in range(7)])) [ [1 2 3 4] [1 2 3 4] [1 2 3 4] [1 2 3 4] [1 2 3 4] [1 2 3 4] diff --git a/src/sage/repl/interface_magic.py b/src/sage/repl/interface_magic.py index 8db763a507e..0459a02068d 100644 --- a/src/sage/repl/interface_magic.py +++ b/src/sage/repl/interface_magic.py @@ -121,9 +121,9 @@ def register_all(cls, shell=None): ... ('maxima', 'line') ('maxima', 'cell') - sage: 'gap' in MockShell.magics # needs sage.libs.gap + sage: 'gap' in MockShell.magics True - sage: 'maxima' in MockShell.magics # needs sage.symbolic + sage: 'maxima' in MockShell.magics True """ if shell is None: @@ -156,7 +156,7 @@ def find(cls, name): EXAMPLES:: sage: from sage.repl.interface_magic import InterfaceMagic - sage: InterfaceMagic.find('gap') # needs sage.libs.gap + sage: InterfaceMagic.find('gap') """ for magic in cls.all_iter(): @@ -180,7 +180,7 @@ def __init__(self, name, interface): EXAMPLES:: sage: from sage.repl.interface_magic import InterfaceMagic - sage: InterfaceMagic.find('gap') # needs sage.libs.gap + sage: InterfaceMagic.find('gap') """ self._name = name @@ -194,7 +194,6 @@ def line_magic_factory(self): EXAMPLES:: - sage: # needs sage.libs.gap sage: from sage.repl.interface_magic import InterfaceMagic sage: line_magic = InterfaceMagic.find('gap').line_magic_factory() sage: output = line_magic('1+1') @@ -207,9 +206,9 @@ def line_magic_factory(self): sage: from sage.repl.interpreter import get_test_shell sage: shell = get_test_shell() - sage: shell.run_cell('%gap 1+1') # needs sage.libs.gap + sage: shell.run_cell('%gap 1+1') 2 - sage: shell.run_cell('%gap?') # needs sage.libs.gap + sage: shell.run_cell('%gap?') Docstring: Interact with gap @@ -236,7 +235,6 @@ def cell_magic_factory(self): EXAMPLES:: - sage: # needs sage.libs.gap sage: from sage.repl.interface_magic import InterfaceMagic sage: cell_magic = InterfaceMagic.find('gap').cell_magic_factory() sage: output = cell_magic('', '1+1;') @@ -252,15 +250,15 @@ def cell_magic_factory(self): sage: from sage.repl.interpreter import get_test_shell sage: shell = get_test_shell() - sage: shell.run_cell('%%gap\nG:=SymmetricGroup(5);\n1+1;Order(G);') # needs sage.libs.gap + sage: shell.run_cell('%%gap\nG:=SymmetricGroup(5);\n1+1;Order(G);') Sym( [ 1 .. 5 ] ) 2 120 - sage: shell.run_cell('%%gap foo\n1+1;\n') # needs sage.libs.gap + sage: shell.run_cell('%%gap foo\n1+1;\n') ...File...... SyntaxError: Interface magics have no options, got "foo" - sage: shell.run_cell('%%gap?') # needs sage.libs.gap + sage: shell.run_cell('%%gap?') Docstring: Interact with gap diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py index 70dd3f3cf90..532c4ab0542 100644 --- a/src/sage/repl/interpreter.py +++ b/src/sage/repl/interpreter.py @@ -529,7 +529,6 @@ def __init__(self, *args, **kwds): TESTS:: - sage: # needs sage.symbolic sage: from sage.repl.interpreter import interface_shell_embed sage: shell = interface_shell_embed(maxima) sage: ift = shell.prefilter_manager.transformers[0] @@ -556,7 +555,6 @@ def preparse_imports_from_sage(self, line): EXAMPLES:: - sage: # needs sage.symbolic sage: from sage.repl.interpreter import interface_shell_embed, InterfaceShellTransformer sage: from sage.interfaces.maxima_lib import maxima sage: shell = interface_shell_embed(maxima) @@ -575,7 +573,6 @@ def preparse_imports_from_sage(self, line): Since :issue:`28439`, this also works with more complicated expressions containing nested parentheses:: - sage: # needs sage.libs.gap sage.symbolic sage: shell = interface_shell_embed(gap) sage: shell.user_ns = locals() sage: ift = InterfaceShellTransformer(shell=shell, config=shell.config, @@ -612,7 +609,6 @@ def transform(self, line, continue_prompt): EXAMPLES:: - sage: # needs sage.symbolic sage: from sage.repl.interpreter import interface_shell_embed, InterfaceShellTransformer sage: shell = interface_shell_embed(maxima) sage: ift = InterfaceShellTransformer(shell=shell, config=shell.config, @@ -624,8 +620,8 @@ def transform(self, line, continue_prompt): 'sage.repl.interpreter.logstr(r"""8""")' sage: ift.temporary_objects set() - sage: shell = interface_shell_embed(gap) # needs sage.libs.gap - sage: ift = InterfaceShellTransformer(shell=shell, config=shell.config, # needs sage.libs.gap + sage: shell = interface_shell_embed(gap) + sage: ift = InterfaceShellTransformer(shell=shell, config=shell.config, ....: prefilter_manager=shell.prefilter_manager) sage: ift.transform('2+2', False) 'sage.repl.interpreter.logstr(r"""4""")' @@ -635,10 +631,10 @@ def transform(self, line, continue_prompt): Check that whitespace is not stripped and that special characters are escaped (:issue:`28439`):: - sage: shell = interface_shell_embed(gap) # needs sage.libs.gap sage.symbolic - sage: ift = InterfaceShellTransformer(shell=shell, config=shell.config, # needs sage.libs.gap sage.symbolic + sage: shell = interface_shell_embed(gap) + sage: ift = InterfaceShellTransformer(shell=shell, config=shell.config, ....: prefilter_manager=shell.prefilter_manager) - sage: ift.transform(r'Print(" -\n\\\\- ");', False) # needs sage.symbolic + sage: ift.transform(r'Print(" -\n\\\\- ");', False) 'sage.repl.interpreter.logstr(r""" -\n\\\\-""")' sage: # optional - macaulay2 @@ -675,8 +671,8 @@ def interface_shell_embed(interface): EXAMPLES:: sage: from sage.repl.interpreter import interface_shell_embed - sage: shell = interface_shell_embed(gap) # needs sage.libs.gap - sage: shell.run_cell('List( [1..10], IsPrime )') # needs sage.libs.gap + sage: shell = interface_shell_embed(gap) + sage: shell.run_cell('List( [1..10], IsPrime )') [ false, true, true, false, true, false, true, false, false, false ] """ diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py index d7ef7b7d0de..67874717728 100644 --- a/src/sage/repl/ipython_extension.py +++ b/src/sage/repl/ipython_extension.py @@ -240,8 +240,8 @@ def display(self, args): That means you do not have to use :func:`ascii_art` to get an ASCII art output:: - sage: shell.run_cell("i = var('i')") # needs sage.symbolic - sage: shell.run_cell('sum(i^2*x^i, i, 0, 10)') # needs sage.symbolic + sage: shell.run_cell("i = var('i')") + sage: shell.run_cell('sum(i^2*x^i, i, 0, 10)') 10 9 8 7 6 5 4 3 2 100*x + 81*x + 64*x + 49*x + 36*x + 25*x + 16*x + 9*x + 4*x + x @@ -249,14 +249,14 @@ def display(self, args): sage: shell.run_cell('%display text plain') sage: shell.run_cell('%display plain') # shortcut for "text plain" - sage: shell.run_cell('sum(i^2*x^i, i, 0, 10)') # needs sage.symbolic + sage: shell.run_cell('sum(i^2*x^i, i, 0, 10)') 100*x^10 + 81*x^9 + 64*x^8 + 49*x^7 + 36*x^6 + 25*x^5 + 16*x^4 + 9*x^3 + 4*x^2 + x Sometime you could have to use a special output width and you could specify it:: sage: shell.run_cell('%display ascii_art') - sage: shell.run_cell('StandardTableaux(4).list()') # needs sage.combinat + sage: shell.run_cell('StandardTableaux(4).list()') [ [ 1 4 1 3 [ 1 3 4 1 2 4 1 2 3 1 3 1 2 2 2 @@ -267,7 +267,7 @@ def display(self, args): 3 3 ] 4 , 4 ] sage: shell.run_cell('%display ascii_art 50') - sage: shell.run_cell('StandardTableaux(4).list()') # needs sage.combinat + sage: shell.run_cell('StandardTableaux(4).list()') [ [ [ 1 3 4 1 2 4 1 2 3 @@ -392,7 +392,6 @@ def cython(self, line, cell): EXAMPLES:: - sage: # needs sage.misc.cython sage: from sage.repl.interpreter import get_test_shell sage: shell = get_test_shell() sage: shell.run_cell( @@ -410,7 +409,6 @@ def cython(self, line, cell): Test unrecognized arguments:: - sage: # needs sage.misc.cython sage: shell.run_cell(''' ....: %%cython --some-unrecognized-argument ....: print(1) @@ -419,7 +417,6 @@ def cython(self, line, cell): Test ``--help`` is disabled:: - sage: # needs sage.misc.cython sage: shell.run_cell(''' ....: %%cython --help ....: print(1) @@ -428,7 +425,6 @@ def cython(self, line, cell): Test ``--view-annotate`` invalid arguments:: - sage: # needs sage.misc.cython sage: shell.run_cell(''' ....: %%cython --view-annotate=xx ....: print(1) @@ -438,7 +434,6 @@ def cython(self, line, cell): Test ``--view-annotate=displayhtml`` (note that in a notebook environment an inline HTML frame will be displayed):: - sage: # needs sage.misc.cython sage: shell.run_cell(''' ....: %%cython --view-annotate=displayhtml ....: print(1) @@ -448,7 +443,7 @@ def cython(self, line, cell): Test ``--view-annotate=webbrowser``:: - sage: # needs sage.misc.cython webbrowser + sage: # needs webbrowser sage: shell.run_cell(''' ....: %%cython --view-annotate ....: print(1) @@ -467,7 +462,6 @@ def cython(self, line, cell): Test invalid quotes:: - sage: # needs sage.misc.cython sage: shell.run_cell(''' ....: %%cython --a=' ....: print(1) diff --git a/src/sage/repl/ipython_kernel/interact.py b/src/sage/repl/ipython_kernel/interact.py index 8b01b6a9a4b..a0097cd48f7 100644 --- a/src/sage/repl/ipython_kernel/interact.py +++ b/src/sage/repl/ipython_kernel/interact.py @@ -160,12 +160,12 @@ def widget_from_single_value(cls, abbrev, *args, **kwds): sage: from sage.repl.ipython_kernel.interact import sage_interactive sage: sage_interactive.widget_from_single_value("sin(x)") ...Text(value='sin(x)') - sage: sage_interactive.widget_from_single_value(sin(x)) # needs sage.symbolic + sage: sage_interactive.widget_from_single_value(sin(x)) ...EvalText(value='sin(x)') - sage: sage_interactive.widget_from_single_value(matrix([[1, 2], [3, 4]])) # needs sage.modules + sage: sage_interactive.widget_from_single_value(matrix([[1, 2], [3, 4]])) ...Grid(value=[[1, 2], [3, 4]], children=(Label(value=''), VBox(children=(EvalText(value='1', layout=Layout(max_width='5em')), EvalText(value='3', layout=Layout(max_width='5em')))), VBox(children=(EvalText(value='2', layout=Layout(max_width='5em')), EvalText(value='4', layout=Layout(max_width='5em')))))) - sage: from sage.plot.colors import Color # needs sage.plot - sage: sage_interactive.widget_from_single_value(Color('cornflowerblue')) # needs sage.plot + sage: from sage.plot.colors import Color + sage: sage_interactive.widget_from_single_value(Color('cornflowerblue')) ...SageColorPicker(value='#6495ed') """ # Support Sage matrices and colors @@ -207,15 +207,15 @@ def widget_from_tuple(cls, abbrev, *args, **kwds): ...IntSlider(value=3, max=10) sage: sage_interactive.widget_from_tuple((2, [('one', 1), ('two', 2), ('three', 3)])) ...Dropdown(index=1, options=(('one', 1), ('two', 2), ('three', 3)), value=2) - sage: sage_interactive.widget_from_tuple( (sqrt(2), pi) ) # needs sage.symbolic + sage: sage_interactive.widget_from_tuple( (sqrt(2), pi) ) ...FloatSlider(value=2.277903107981444, max=3.141592653589793, min=1.4142135623730951) TESTS: Symbolic subrings:: - sage: SCR = SR.subring(no_variables=True) # needs sage.symbolic - sage: sage_interactive.widget_from_tuple( (SCR(sqrt(2)), SCR(pi)) ) # needs sage.symbolic + sage: SCR = SR.subring(no_variables=True) + sage: sage_interactive.widget_from_tuple( (SCR(sqrt(2)), SCR(pi)) ) ...FloatSlider(value=2.277903107981444, max=3.141592653589793, min=1.4142135623730951) """ # Support (description, abbrev) diff --git a/src/sage/repl/ipython_kernel/widgets.py b/src/sage/repl/ipython_kernel/widgets.py index 8a8f75dbb24..de033a26024 100644 --- a/src/sage/repl/ipython_kernel/widgets.py +++ b/src/sage/repl/ipython_kernel/widgets.py @@ -172,7 +172,7 @@ class EvalWidget(TransformWidget): sage: w = EvalToggleButtons(options=["pi", "e"], transform=lambda x: x+x) sage: w EvalToggleButtons(options=('pi', 'e'), value='pi') - sage: w.get_interact_value() # needs sage.symbolic + sage: w.get_interact_value() 2*pi """ def get_value(self): @@ -224,7 +224,7 @@ class TransformFloatSlider(TransformWidget, FloatSlider): sage: w = TransformFloatSlider(min=0, max=100, value=7, transform=lambda x: sqrt(x)) sage: w TransformFloatSlider(value=7.0) - sage: w.get_interact_value() # needs sage.symbolic + sage: w.get_interact_value() 2.6457513110645907 """ pass @@ -311,7 +311,7 @@ class EvalText(EvalWidget, Text): sage: w = EvalText(value='pi', transform=lambda x: x^2) sage: w EvalText(value='pi') - sage: w.get_interact_value() # needs sage.symbolic + sage: w.get_interact_value() pi^2 """ pass @@ -328,7 +328,7 @@ class EvalTextarea(EvalWidget, Textarea): sage: w = EvalTextarea(value='pi', transform=lambda x: x^2) sage: w EvalTextarea(value='pi') - sage: w.get_interact_value() # needs sage.symbolic + sage: w.get_interact_value() pi^2 """ pass @@ -352,7 +352,7 @@ def get_interact_value(self): EXAMPLES:: sage: from sage.repl.ipython_kernel.widgets import SageColorPicker - sage: SageColorPicker().get_interact_value() # needs sage.plot + sage: SageColorPicker().get_interact_value() RGB color (0.0, 0.0, 0.0) """ return Color(self.value) @@ -399,13 +399,13 @@ def __init__(self, nrows, ncols, make_widget, description="", transform=None): EXAMPLES:: sage: from sage.repl.ipython_kernel.widgets import Grid, EvalText - sage: w = Grid(2, 2, lambda i,j: EvalText(str(j+4*i)), # needs sage.modules + sage: w = Grid(2, 2, lambda i,j: EvalText(str(j+4*i)), ....: description="2x2 matrix", transform=matrix); w Grid(value=[[0, 1], [4, 5]], children=(Label(value='2x2 matrix'), VBox(children=(EvalText(value='0'), EvalText(value='4'))), VBox(children=(EvalText(value='1'), EvalText(value='5'))))) - sage: w.get_interact_value() # needs sage.modules + sage: w.get_interact_value() [0 1] [4 5] diff --git a/src/sage/repl/load.py b/src/sage/repl/load.py index 4dc80bfba53..22c23f71170 100644 --- a/src/sage/repl/load.py +++ b/src/sage/repl/load.py @@ -145,7 +145,7 @@ def load(filename, globals, attach=False): sage: with NamedTemporaryFile(mode='w', suffix='.pyx') as file: ....: _ = file.write("print(('hi', 2^3)); z = -2^7") ....: _ = file.seek(0) - ....: sage.repl.load.load(file.name, context) # needs sage.misc.cython + ....: sage.repl.load.load(file.name, context) Compiling ... ('hi', 1) sage: context["z"] diff --git a/src/sage/repl/preparse.py b/src/sage/repl/preparse.py index 75c004e8ad6..c81d348643c 100644 --- a/src/sage/repl/preparse.py +++ b/src/sage/repl/preparse.py @@ -63,7 +63,7 @@ 4 sage: 87.factor() 3 * 29 - sage: 15.10.sqrt() # needs sage.rings.real_mpfr + sage: 15.10.sqrt() 3.88587184554509 sage: preparse('87.sqrt()') 'Integer(87).sqrt()' @@ -81,7 +81,6 @@ Symbolic functional notation:: - sage: # needs sage.symbolic sage: a = 10; f(theta, beta) = theta + beta; b = x^2 + theta sage: f (theta, beta) |--> beta + theta @@ -92,8 +91,8 @@ sage: f(theta,theta) 2*theta - sage: a = 5; f(x,y) = x*y*sqrt(a) # needs sage.symbolic - sage: f # needs sage.symbolic + sage: a = 5; f(x,y) = x*y*sqrt(a) + sage: f (x, y) |--> sqrt(5)*x*y This involves an =-, but should still be turned into a symbolic @@ -101,8 +100,8 @@ sage: preparse('a(x) =- 5') '__tmp__=var("x"); a = symbolic_expression(- Integer(5)).function(x)' - sage: f(x)=-x # needs sage.symbolic - sage: f(10) # needs sage.symbolic + sage: f(x)=-x + sage: f(10) -10 This involves -=, which should not be turned into a symbolic @@ -1027,7 +1026,7 @@ def parse_ellipsis(code, preparse_step=True): '(ellipsis_range(1,2,Ellipsis,n))' sage: parse_ellipsis("for i in (f(x) .. L[10]):") 'for i in (ellipsis_iter(f(x) ,Ellipsis, L[10])):' - sage: [1.0..2.0] # needs sage.rings.real_mpfr + sage: [1.0..2.0] [1.00000000000000, 2.00000000000000] TESTS: @@ -1720,7 +1719,7 @@ def preparse(line, reset=True, do_time=False, ignore_prompts=False, "ZZ = ZZ['u,v']; (x, y,) = ZZ._first_ngens(2)" sage: preparse("ZZ. = QQ[2^(1/3)]") 'ZZ = QQ[Integer(2)**(Integer(1)/Integer(3))]; (x,) = ZZ._first_ngens(1)' - sage: QQ[2^(1/3)] # needs sage.rings.number_field sage.symbolic + sage: QQ[2^(1/3)] Number Field in a with defining polynomial x^3 - 2 with a = 1.259921049894873? sage: preparse("a^b") @@ -1915,7 +1914,7 @@ def preparse_file(contents, globals=None, numeric_literals=True): ....: file.write(file_contents) 137 sage: load(t) - sage: sorted(list(func([11,17]))) # needs sage.modular + sage: sorted(list(func([11,17]))) [(((11,), {}), None), (((17,), {}), None)] """ if not isinstance(contents, str): diff --git a/src/sage/repl/rich_output/backend_base.py b/src/sage/repl/rich_output/backend_base.py index 449cd5fe8e1..f467ebc7f01 100644 --- a/src/sage/repl/rich_output/backend_base.py +++ b/src/sage/repl/rich_output/backend_base.py @@ -448,7 +448,6 @@ def latex_formatter(self, obj, **kwds): sage: out.html.get_str() '\\(\\displaystyle \\frac{1}{2}\\)' - sage: # needs sage.symbolic sage: out = backend.latex_formatter([1/2, x, 3/4, ZZ], concatenate=False) sage: out.html.get_str() '\\(\\displaystyle \\newcommand{\\Bold}[1]{\\mathbf{#1}}\\left[\\frac{1}{2}, x, \\frac{3}{4}, \\Bold{Z}\\right]\\)' diff --git a/src/sage/repl/rich_output/backend_doctest.py b/src/sage/repl/rich_output/backend_doctest.py index 36fe7ccf739..6e54475d98f 100644 --- a/src/sage/repl/rich_output/backend_doctest.py +++ b/src/sage/repl/rich_output/backend_doctest.py @@ -161,14 +161,14 @@ def displayhook(self, plain_text, rich_output): This ends up calling the displayhook:: - sage: plt = plot(sin) # needs sage.plot sage.symbolic - sage: plt # needs sage.plot sage.symbolic + sage: plt = plot(sin) + sage: plt Graphics object consisting of 1 graphics primitive - sage: plt.show() # needs sage.plot sage.symbolic + sage: plt.show() sage: from sage.repl.rich_output import get_display_manager sage: dm = get_display_manager() - sage: dm.displayhook(plt) # indirect doctest # needs sage.plot sage.symbolic + sage: dm.displayhook(plt) # indirect doctest Graphics object consisting of 1 graphics primitive """ self.validate(rich_output) @@ -195,14 +195,14 @@ def display_immediately(self, plain_text, rich_output): displayhook, the plot is still shown. Nothing is shown during doctests:: - sage: plt = plot(sin) # needs sage.plot sage.symbolic - sage: plt # needs sage.plot sage.symbolic + sage: plt = plot(sin) + sage: plt Graphics object consisting of 1 graphics primitive - sage: plt.show() # needs sage.plot sage.symbolic + sage: plt.show() sage: from sage.repl.rich_output import get_display_manager sage: dm = get_display_manager() - sage: dm.display_immediately(plt) # indirect doctest # needs sage.plot sage.symbolic + sage: dm.display_immediately(plt) # indirect doctest """ self.validate(rich_output) types_to_print = [OutputPlainText, OutputAsciiArt, OutputUnicodeArt, OutputHtml] diff --git a/src/sage/repl/rich_output/backend_ipython.py b/src/sage/repl/rich_output/backend_ipython.py index 4241fe8abf8..e200afb85d9 100644 --- a/src/sage/repl/rich_output/backend_ipython.py +++ b/src/sage/repl/rich_output/backend_ipython.py @@ -354,7 +354,7 @@ def launch_jmol(self, output_jmol, plain_text): sage: from sage.repl.rich_output.backend_ipython import BackendIPythonCommandline sage: backend = BackendIPythonCommandline() sage: from sage.repl.rich_output.output_graphics3d import OutputSceneJmol - sage: backend.launch_jmol(OutputSceneJmol.example(), 'Graphics3d object') # needs sage.plot + sage: backend.launch_jmol(OutputSceneJmol.example(), 'Graphics3d object') 'Launched jmol viewer for Graphics3d object' """ from sage.doctest import DOCTEST_MODE @@ -577,7 +577,7 @@ def threejs_offline_scripts(self): sage: from sage.repl.rich_output.backend_ipython import BackendIPythonNotebook sage: backend = BackendIPythonNotebook() - sage: backend.threejs_offline_scripts() # needs sage.plot + sage: backend.threejs_offline_scripts() '...