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

sage.symbolics: Remove code deprecated in #18036, #29738, #32386, #32638, #32665, #34215 #36304

Merged
merged 10 commits into from
Oct 21, 2023
Merged
2 changes: 0 additions & 2 deletions src/doc/en/reference/calculus/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Internal functionality supporting calculus
- :doc:`sage/symbolic/function_factory`
- :doc:`Internals of Callable Symbolic Expressions <sage/symbolic/callable>`
- :doc:`sage/symbolic/expression_conversions`
- :doc:`sage/symbolic/substitution_map`
- :doc:`sage/symbolic/benchmark`
- :doc:`sage/symbolic/random_tests`
- :doc:`sage/symbolic/maxima_wrapper`
Expand Down Expand Up @@ -95,7 +94,6 @@ Internal functionality supporting calculus
sage/calculus/var
sage/symbolic/maxima_wrapper
sage/symbolic/operators
sage/symbolic/substitution_map
sage/symbolic/benchmark
sage/symbolic/random_tests

Expand Down
13 changes: 6 additions & 7 deletions src/sage/combinat/words/alphabet.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
# http://www.gnu.org/licenses/
# ****************************************************************************

from sage.categories.sets_cat import Sets
import collections.abc

from sage.sets.totally_ordered_finite_set import TotallyOrderedFiniteSet
from sage.sets.family import Family

from sage.rings.integer import Integer
from sage.categories.sets_cat import Sets
from sage.rings.infinity import Infinity

from sage.rings.integer import Integer
from sage.sets.family import Family
from sage.sets.non_negative_integers import NonNegativeIntegers
from sage.sets.totally_ordered_finite_set import TotallyOrderedFiniteSet


set_of_letters = {
Expand Down Expand Up @@ -222,7 +221,7 @@ def build_alphabet(data=None, names=None, name=None):
return IntegerRange(Integer(data))
if isinstance(names, str):
return TotallyOrderedFiniteSet([names + '%d' % i for i in range(data)])
if len(names) == data:
if isinstance(names, collections.abc.Sequence) and len(names) == data:
return TotallyOrderedFiniteSet(names)
raise ValueError("invalid value for names")

Expand Down
7 changes: 0 additions & 7 deletions src/sage/symbolic/all.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
from sage.misc.lazy_import import lazy_import

lazy_import("sage.symbolic.constants", "I", deprecation=(18036,
"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]"))
lazy_import("sage.symbolic.constants", "I", as_="i", deprecation=(18036,
"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]"))

from .ring import SR
from .constants import (pi, e, NaN, golden_ratio, log2, euler_gamma, catalan,
khinchin, twinprime, mertens, glaisher)
Expand Down
57 changes: 0 additions & 57 deletions src/sage/symbolic/callable.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,63 +69,6 @@
######################################################################
# Callable functions
######################################################################
def is_CallableSymbolicExpressionRing(x):
"""
Return ``True`` if ``x`` is a callable symbolic expression ring.

INPUT:

- ``x`` - object

OUTPUT: bool

EXAMPLES::

sage: from sage.symbolic.callable import is_CallableSymbolicExpressionRing
sage: is_CallableSymbolicExpressionRing(QQ)
doctest:warning...
DeprecationWarning: is_CallableSymbolicExpressionRing is deprecated;
use isinstance(..., sage.rings.abc.CallableSymbolicExpressionRing instead
See https://github.com/sagemath/sage/issues/32665 for details.
False
sage: var('x,y,z')
(x, y, z)
sage: is_CallableSymbolicExpressionRing(CallableSymbolicExpressionRing((x,y,z)))
True
"""
from sage.misc.superseded import deprecation
deprecation(32665, 'is_CallableSymbolicExpressionRing is deprecated; use isinstance(..., sage.rings.abc.CallableSymbolicExpressionRing instead')
return isinstance(x, CallableSymbolicExpressionRing_class)


def is_CallableSymbolicExpression(x):
r"""
Return ``True`` if ``x`` is a callable symbolic expression.

EXAMPLES::

sage: from sage.symbolic.callable import is_CallableSymbolicExpression
sage: var('a x y z')
(a, x, y, z)
sage: f(x,y) = a + 2*x + 3*y + z
sage: is_CallableSymbolicExpression(f)
doctest:warning...
DeprecationWarning: is_CallableSymbolicExpression is deprecated;
use isinstance(..., Expression) and ....is_callable() instead
See https://github.com/sagemath/sage/issues/34215 for details.
True
sage: is_CallableSymbolicExpression(a+2*x)
False
sage: def foo(n): return n^2
...
sage: is_CallableSymbolicExpression(foo)
False
"""
from sage.misc.superseded import deprecation
deprecation(34215, 'is_CallableSymbolicExpression is deprecated; use isinstance(..., Expression) and ....is_callable() instead')
from sage.structure.element import Expression
return isinstance(x, Expression) and isinstance(x.parent(), CallableSymbolicExpressionRing_class)


class CallableSymbolicExpressionFunctor(ConstructionFunctor):
def __init__(self, arguments):
Expand Down
13 changes: 0 additions & 13 deletions src/sage/symbolic/comparison.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/sage/symbolic/constant.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/sage/symbolic/constants_c.py

This file was deleted.

1 change: 0 additions & 1 deletion src/sage/symbolic/expression.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
cpdef bint is_Expression(x)
cpdef _repr_Expression(x)
cpdef _latex_Expression(x)
cpdef new_Expression(parent, x)
Expand Down
52 changes: 0 additions & 52 deletions src/sage/symbolic/expression.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -409,32 +409,6 @@ include "pynac_impl.pxi"
from sage.symbolic.symbols import symbol_table, register_symbol # used to be defined in pynac_impl


cpdef bint is_Expression(x):
"""
Return True if ``x`` is a symbolic expression.

This method is deprecated. Use :func:`isinstance` with
:class:`sage.structure.element.Expression` instead.

EXAMPLES::

sage: from sage.symbolic.expression import is_Expression
sage: is_Expression(x)
doctest:warning...
DeprecationWarning: is_Expression is deprecated;
use isinstance(..., sage.structure.element.Expression) instead
See https://github.com/sagemath/sage/issues/32638 for details.
True
sage: is_Expression(2)
False
sage: is_Expression(SR(2))
True
"""
from sage.misc.superseded import deprecation
deprecation(32638, 'is_Expression is deprecated; use isinstance(..., sage.structure.element.Expression) instead')
return isinstance(x, Expression)


cpdef bint is_SymbolicEquation(x):
"""
Return True if *x* is a symbolic equation.
Expand Down Expand Up @@ -6346,32 +6320,6 @@ cdef class Expression(Expression_abc):

nops = number_of_operands

def __len__(self):
"""
Return the number of operands of this expression.

This is deprecated; use :meth:`number_of_operands` instead.

EXAMPLES::

sage: var('a,b,c,x,y')
(a, b, c, x, y)
sage: len(a)
doctest:warning...
DeprecationWarning: using len on a symbolic expression is deprecated; use method number_of_operands instead
See https://github.com/sagemath/sage/issues/29738 for details.
0
sage: len((a^2 + b^2 + (x+y)^2))
3
sage: len((a^2))
2
sage: len(a*b^2*c)
3
"""
from sage.misc.superseded import deprecation
deprecation(29738, "using len on a symbolic expression is deprecated; use method number_of_operands instead")
return self.number_of_operands()

def _unpack_operands(self):
"""
Unpack the operands of this expression converting each to a Python
Expand Down
12 changes: 0 additions & 12 deletions src/sage/symbolic/getitem.py

This file was deleted.

18 changes: 0 additions & 18 deletions src/sage/symbolic/pynac_constant.py

This file was deleted.

27 changes: 0 additions & 27 deletions src/sage/symbolic/ring.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1301,33 +1301,6 @@ def the_SymbolicRing():
return SR


def is_SymbolicExpressionRing(R):
"""
Return True if ``R`` is the symbolic expression ring.

This function is deprecated. Instead, either use ``R is SR`` (to
test whether ``R`` is the unique symbolic ring ``SR``); or
``isinstance`` with :class:`~sage.rings.abc.SymbolicRing`
(when also symbolic subrings and callable symbolic rings should
be accepted).

EXAMPLES::

sage: from sage.symbolic.ring import is_SymbolicExpressionRing
sage: is_SymbolicExpressionRing(ZZ)
doctest:warning...
DeprecationWarning: is_SymbolicExpressionRing is deprecated;
use "... is SR" or isinstance(..., sage.rings.abc.SymbolicRing instead
See https://github.com/sagemath/sage/issues/32665 for details.
False
sage: is_SymbolicExpressionRing(SR)
True
"""
from sage.misc.superseded import deprecation
deprecation(32665, 'is_SymbolicExpressionRing is deprecated; use "... is SR" or isinstance(..., sage.rings.abc.SymbolicRing instead')
return R is SR


def var(name, **kwds):
"""
EXAMPLES::
Expand Down
10 changes: 0 additions & 10 deletions src/sage/symbolic/series.py

This file was deleted.

21 changes: 0 additions & 21 deletions src/sage/symbolic/substitution_map.py

This file was deleted.