Skip to content

Commit 52011ee

Browse files
author
Release Manager
committed
sagemathgh-36304: `sage.symbolics`: Remove code deprecated in sagemath#18036, sagemath#29738, sagemath#32386, sagemath#32638, sagemath#32665, sagemath#34215 <!-- ^^^^^ 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 sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- 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 sagemath#12345". --> <!-- 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 - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36304 Reported by: Matthias Köppe Reviewer(s): David Coudert
2 parents d4f239a + bc242a2 commit 52011ee

File tree

14 files changed

+6
-247
lines changed

14 files changed

+6
-247
lines changed

src/doc/en/reference/calculus/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Internal functionality supporting calculus
5353
- :doc:`sage/symbolic/function_factory`
5454
- :doc:`Internals of Callable Symbolic Expressions <sage/symbolic/callable>`
5555
- :doc:`sage/symbolic/expression_conversions`
56-
- :doc:`sage/symbolic/substitution_map`
5756
- :doc:`sage/symbolic/benchmark`
5857
- :doc:`sage/symbolic/random_tests`
5958
- :doc:`sage/symbolic/maxima_wrapper`
@@ -95,7 +94,6 @@ Internal functionality supporting calculus
9594
sage/calculus/var
9695
sage/symbolic/maxima_wrapper
9796
sage/symbolic/operators
98-
sage/symbolic/substitution_map
9997
sage/symbolic/benchmark
10098
sage/symbolic/random_tests
10199

src/sage/combinat/words/alphabet.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@
3232
# http://www.gnu.org/licenses/
3333
# ****************************************************************************
3434

35-
from sage.categories.sets_cat import Sets
35+
import collections.abc
3636

37-
from sage.sets.totally_ordered_finite_set import TotallyOrderedFiniteSet
38-
from sage.sets.family import Family
39-
40-
from sage.rings.integer import Integer
37+
from sage.categories.sets_cat import Sets
4138
from sage.rings.infinity import Infinity
42-
39+
from sage.rings.integer import Integer
40+
from sage.sets.family import Family
4341
from sage.sets.non_negative_integers import NonNegativeIntegers
42+
from sage.sets.totally_ordered_finite_set import TotallyOrderedFiniteSet
4443

4544

4645
set_of_letters = {
@@ -222,7 +221,7 @@ def build_alphabet(data=None, names=None, name=None):
222221
return IntegerRange(Integer(data))
223222
if isinstance(names, str):
224223
return TotallyOrderedFiniteSet([names + '%d' % i for i in range(data)])
225-
if len(names) == data:
224+
if isinstance(names, collections.abc.Sequence) and len(names) == data:
226225
return TotallyOrderedFiniteSet(names)
227226
raise ValueError("invalid value for names")
228227

src/sage/symbolic/all.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
from sage.misc.lazy_import import lazy_import
2-
3-
lazy_import("sage.symbolic.constants", "I", deprecation=(18036,
4-
"import I from sage.symbolic.constants for the imaginary unit viewed as an element of SR, or from sage.rings.imaginary_unit for the element of ZZ[i]"))
5-
lazy_import("sage.symbolic.constants", "I", as_="i", deprecation=(18036,
6-
"import I from sage.symbolic.constants for the imaginary unit viewed as an element of SR, or from sage.rings.imaginary_unit for the element of ZZ[i]"))
7-
81
from .ring import SR
92
from .constants import (pi, e, NaN, golden_ratio, log2, euler_gamma, catalan,
103
khinchin, twinprime, mertens, glaisher)

src/sage/symbolic/callable.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -69,63 +69,6 @@
6969
######################################################################
7070
# Callable functions
7171
######################################################################
72-
def is_CallableSymbolicExpressionRing(x):
73-
"""
74-
Return ``True`` if ``x`` is a callable symbolic expression ring.
75-
76-
INPUT:
77-
78-
- ``x`` - object
79-
80-
OUTPUT: bool
81-
82-
EXAMPLES::
83-
84-
sage: from sage.symbolic.callable import is_CallableSymbolicExpressionRing
85-
sage: is_CallableSymbolicExpressionRing(QQ)
86-
doctest:warning...
87-
DeprecationWarning: is_CallableSymbolicExpressionRing is deprecated;
88-
use isinstance(..., sage.rings.abc.CallableSymbolicExpressionRing instead
89-
See https://github.com/sagemath/sage/issues/32665 for details.
90-
False
91-
sage: var('x,y,z')
92-
(x, y, z)
93-
sage: is_CallableSymbolicExpressionRing(CallableSymbolicExpressionRing((x,y,z)))
94-
True
95-
"""
96-
from sage.misc.superseded import deprecation
97-
deprecation(32665, 'is_CallableSymbolicExpressionRing is deprecated; use isinstance(..., sage.rings.abc.CallableSymbolicExpressionRing instead')
98-
return isinstance(x, CallableSymbolicExpressionRing_class)
99-
100-
101-
def is_CallableSymbolicExpression(x):
102-
r"""
103-
Return ``True`` if ``x`` is a callable symbolic expression.
104-
105-
EXAMPLES::
106-
107-
sage: from sage.symbolic.callable import is_CallableSymbolicExpression
108-
sage: var('a x y z')
109-
(a, x, y, z)
110-
sage: f(x,y) = a + 2*x + 3*y + z
111-
sage: is_CallableSymbolicExpression(f)
112-
doctest:warning...
113-
DeprecationWarning: is_CallableSymbolicExpression is deprecated;
114-
use isinstance(..., Expression) and ....is_callable() instead
115-
See https://github.com/sagemath/sage/issues/34215 for details.
116-
True
117-
sage: is_CallableSymbolicExpression(a+2*x)
118-
False
119-
sage: def foo(n): return n^2
120-
...
121-
sage: is_CallableSymbolicExpression(foo)
122-
False
123-
"""
124-
from sage.misc.superseded import deprecation
125-
deprecation(34215, 'is_CallableSymbolicExpression is deprecated; use isinstance(..., Expression) and ....is_callable() instead')
126-
from sage.structure.element import Expression
127-
return isinstance(x, Expression) and isinstance(x.parent(), CallableSymbolicExpressionRing_class)
128-
12972

13073
class CallableSymbolicExpressionFunctor(ConstructionFunctor):
13174
def __init__(self, arguments):

src/sage/symbolic/comparison.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/sage/symbolic/constant.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/sage/symbolic/constants_c.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/sage/symbolic/expression.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
cpdef bint is_Expression(x)
21
cpdef _repr_Expression(x)
32
cpdef _latex_Expression(x)
43
cpdef new_Expression(parent, x)

src/sage/symbolic/expression.pyx

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -409,32 +409,6 @@ include "pynac_impl.pxi"
409409
from sage.symbolic.symbols import symbol_table, register_symbol # used to be defined in pynac_impl
410410

411411

412-
cpdef bint is_Expression(x):
413-
"""
414-
Return True if ``x`` is a symbolic expression.
415-
416-
This method is deprecated. Use :func:`isinstance` with
417-
:class:`sage.structure.element.Expression` instead.
418-
419-
EXAMPLES::
420-
421-
sage: from sage.symbolic.expression import is_Expression
422-
sage: is_Expression(x)
423-
doctest:warning...
424-
DeprecationWarning: is_Expression is deprecated;
425-
use isinstance(..., sage.structure.element.Expression) instead
426-
See https://github.com/sagemath/sage/issues/32638 for details.
427-
True
428-
sage: is_Expression(2)
429-
False
430-
sage: is_Expression(SR(2))
431-
True
432-
"""
433-
from sage.misc.superseded import deprecation
434-
deprecation(32638, 'is_Expression is deprecated; use isinstance(..., sage.structure.element.Expression) instead')
435-
return isinstance(x, Expression)
436-
437-
438412
cpdef bint is_SymbolicEquation(x):
439413
"""
440414
Return True if *x* is a symbolic equation.
@@ -6346,32 +6320,6 @@ cdef class Expression(Expression_abc):
63466320

63476321
nops = number_of_operands
63486322

6349-
def __len__(self):
6350-
"""
6351-
Return the number of operands of this expression.
6352-
6353-
This is deprecated; use :meth:`number_of_operands` instead.
6354-
6355-
EXAMPLES::
6356-
6357-
sage: var('a,b,c,x,y')
6358-
(a, b, c, x, y)
6359-
sage: len(a)
6360-
doctest:warning...
6361-
DeprecationWarning: using len on a symbolic expression is deprecated; use method number_of_operands instead
6362-
See https://github.com/sagemath/sage/issues/29738 for details.
6363-
0
6364-
sage: len((a^2 + b^2 + (x+y)^2))
6365-
3
6366-
sage: len((a^2))
6367-
2
6368-
sage: len(a*b^2*c)
6369-
3
6370-
"""
6371-
from sage.misc.superseded import deprecation
6372-
deprecation(29738, "using len on a symbolic expression is deprecated; use method number_of_operands instead")
6373-
return self.number_of_operands()
6374-
63756323
def _unpack_operands(self):
63766324
"""
63776325
Unpack the operands of this expression converting each to a Python

src/sage/symbolic/getitem.py

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)