Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/sage/groups/perm_gps/permgroup_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -202,28 +202,6 @@ def make_permgroup_element_v2(G, x, domain):
return G.element_class(x, G, check=False)


def is_PermutationGroupElement(x):
r"""
Return ``True`` if ``x`` is a :class:`PermutationGroupElement`.

EXAMPLES::

sage: p = PermutationGroupElement([(1,2),(3,4,5)])
sage: from sage.groups.perm_gps.permgroup_element import is_PermutationGroupElement
sage: is_PermutationGroupElement(p)
doctest:warning...
DeprecationWarning: The function is_PermutationGroupElement is deprecated;
use 'isinstance(..., PermutationGroupElement)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38184,
"The function is_PermutationGroupElement is deprecated; "
"use 'isinstance(..., PermutationGroupElement)' instead.")
return isinstance(x, PermutationGroupElement)


cdef class PermutationGroupElement(MultiplicativeGroupElement):
r"""
An element of a permutation group.
Expand Down
20 changes: 0 additions & 20 deletions src/sage/modules/free_module_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -135,26 +135,6 @@ __one__ = smallInteger(1)
__two__ = smallInteger(2)


def is_FreeModuleElement(x):
"""
EXAMPLES::

sage: sage.modules.free_module_element.is_FreeModuleElement(0)
doctest:warning...
DeprecationWarning: The function is_FreeModuleElement is deprecated;
use 'isinstance(..., FreeModuleElement)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
False
sage: sage.modules.free_module_element.is_FreeModuleElement(vector([1,2,3]))
True
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38184,
"The function is_FreeModuleElement is deprecated; "
"use 'isinstance(..., FreeModuleElement)' instead.")
return isinstance(x, FreeModuleElement)


def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
r"""
Return a vector or free module element with specified entries.
Expand Down
20 changes: 0 additions & 20 deletions src/sage/monoids/free_abelian_monoid_element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,6 @@ from sage.rings.integer cimport Integer, _Integer_from_mpz
from sage.libs.gmp.mpz cimport *


def is_FreeAbelianMonoidElement(x):
r"""
Queries whether ``x`` is an object of type ``FreeAbelianMonoidElement``.

INPUT:

- ``x`` -- an object

OUTPUT:

- ``True`` if ``x`` is an object of type ``FreeAbelianMonoidElement``;
``False`` otherwise.
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38184,
"The function is_FreeAbelianMonoidElement is deprecated; "
"use 'isinstance(..., FreeAbelianMonoidElement)' instead.")
return isinstance(x, FreeAbelianMonoidElement)


cdef class FreeAbelianMonoidElement(MonoidElement):
cdef int _init(self, Py_ssize_t n, Parent parent) except -1:
"""
Expand Down
2 changes: 0 additions & 2 deletions src/sage/numerical/linear_functions.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from sage.structure.parent cimport Parent, Parent_richcmp_element_without_coercion
from sage.structure.element cimport ModuleElement, RingElement, Element

cpdef is_LinearFunction(x)

cdef class LinearFunctionOrConstraint(ModuleElement):
pass

Expand Down
68 changes: 0 additions & 68 deletions src/sage/numerical/linear_functions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -109,74 +109,6 @@ from sage.structure.element cimport ModuleElement, Element
from sage.misc.cachefunc import cached_function
from sage.misc.superseded import deprecated_function_alias

#*****************************************************************************
#
# Utility functions to test that something is a linear function / constraint
#
#*****************************************************************************

cpdef is_LinearFunction(x):
"""
Test whether ``x`` is a linear function.

INPUT:

- ``x`` -- anything

OUTPUT: boolean

EXAMPLES::

sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable()
sage: from sage.numerical.linear_functions import is_LinearFunction
sage: is_LinearFunction(x[0] - 2*x[2])
doctest:warning...
DeprecationWarning: The function is_LinearFunction is deprecated;
use 'isinstance(..., LinearFunction)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True
sage: is_LinearFunction('a string')
False
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38184,
"The function is_LinearFunction is deprecated; "
"use 'isinstance(..., LinearFunction)' instead.")
return isinstance(x, LinearFunction)


def is_LinearConstraint(x):
"""
Test whether ``x`` is a linear constraint.

INPUT:

- ``x`` -- anything

OUTPUT: boolean

EXAMPLES::

sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable()
sage: ieq = (x[0] <= x[1])
sage: from sage.numerical.linear_functions import is_LinearConstraint
sage: is_LinearConstraint(ieq)
doctest:warning...
DeprecationWarning: The function is_LinearConstraint is deprecated;
use 'isinstance(..., LinearConstraint)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True
sage: is_LinearConstraint('a string')
False
"""
from sage.misc.superseded import deprecation_cython
deprecation_cython(38184,
"The function is_LinearConstraint is deprecated; "
"use 'isinstance(..., LinearConstraint)' instead.")
return isinstance(x, LinearConstraint)


# ****************************************************************************
#
Expand Down
43 changes: 2 additions & 41 deletions src/sage/numerical/linear_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,50 +102,11 @@
from sage.numerical.linear_functions import LinearFunction, LinearFunctionsParent_class
from sage.numerical.linear_tensor_element import LinearTensor


#*****************************************************************************
#
# Utility functions to test that something is a linear function / constraint
#
#*****************************************************************************

def is_LinearTensor(x):
"""
Test whether ``x`` is a tensor product of linear functions with a
free module.

INPUT:

- ``x`` -- anything

OUTPUT: boolean

EXAMPLES::

sage: p = MixedIntegerLinearProgram()
sage: x = p.new_variable(nonnegative=False)
sage: from sage.numerical.linear_tensor import is_LinearTensor
sage: is_LinearTensor(x[0] - 2*x[2])
doctest:warning...
DeprecationWarning: The function is_LinearTensor is deprecated;
use 'isinstance(..., LinearTensor)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
False
sage: is_LinearTensor('a string')
False
"""
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_LinearTensor is deprecated; "
"use 'isinstance(..., LinearTensor)' instead.")
return isinstance(x, LinearTensor)


#*****************************************************************************
# ***************************************************************************
#
# Factory functions for the parents to ensure uniqueness
#
#*****************************************************************************
# ***************************************************************************

@cached_function
def LinearTensorParent(free_module_parent, linear_functions_parent):
Expand Down
41 changes: 2 additions & 39 deletions src/sage/numerical/linear_tensor_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,48 +33,11 @@
from sage.misc.cachefunc import cached_function


#*****************************************************************************
#
# Utility functions to test that something is a linear function / constraint
#
#*****************************************************************************

def is_LinearTensorConstraint(x):
"""
Test whether ``x`` is a constraint on module-valued linear functions.

INPUT:

- ``x`` -- anything

OUTPUT: boolean

EXAMPLES::

sage: mip.<x> = MixedIntegerLinearProgram()
sage: vector_ieq = (x[0] * vector([1,2]) <= x[1] * vector([2,3]))
sage: from sage.numerical.linear_tensor_constraints import is_LinearTensorConstraint
sage: is_LinearTensorConstraint(vector_ieq)
doctest:warning...
DeprecationWarning: The function is_LinearTensorConstraint is deprecated;
use 'isinstance(..., LinearTensorConstraint)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True
sage: is_LinearTensorConstraint('a string')
False
"""
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_LinearTensorConstraint is deprecated; "
"use 'isinstance(..., LinearTensorConstraint)' instead.")
return isinstance(x, LinearTensorConstraint)


#*****************************************************************************
# ***************************************************************************
#
# Factory functions for the parents to ensure uniqueness
#
#*****************************************************************************
# ***************************************************************************

@cached_function
def LinearTensorConstraintsParent(linear_functions_parent):
Expand Down
23 changes: 0 additions & 23 deletions src/sage/plot/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,29 +53,6 @@
do_verify = True


def is_Graphics(x):
"""
Return ``True`` if `x` is a Graphics object.

EXAMPLES::

sage: from sage.plot.graphics import is_Graphics
sage: is_Graphics(1)
doctest:warning...
DeprecationWarning: The function is_Graphics is deprecated;
use 'isinstance(..., Graphics)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
False
sage: is_Graphics(disk((0.0, 0.0), 1, (0, pi/2))) # needs sage.symbolic
True
"""
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_Graphics is deprecated; "
"use 'isinstance(..., Graphics)' instead.")
return isinstance(x, Graphics)


def _parse_figsize(figsize):
r"""
Helper function to get a figure size in matplotlib format.
Expand Down
37 changes: 0 additions & 37 deletions src/sage/probability/random_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,43 +23,6 @@
from sage.sets.set import Set
from pprint import pformat

################################################################################
################################################################################


def is_ProbabilitySpace(S):
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_ProbabilitySpace is deprecated; "
"use 'isinstance(..., ProbabilitySpace_generic)' instead.")
return isinstance(S, ProbabilitySpace_generic)


def is_DiscreteProbabilitySpace(S):
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_DiscreteProbabilitySpace is deprecated; "
"use 'isinstance(..., DiscreteProbabilitySpace)' instead.")
return isinstance(S, DiscreteProbabilitySpace)


def is_RandomVariable(X):
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_RandomVariable is deprecated; "
"use 'isinstance(..., RandomVariable_generic)' instead.")
return isinstance(X, RandomVariable_generic)


def is_DiscreteRandomVariable(X):
from sage.misc.superseded import deprecation
deprecation(38184,
"The function is_DiscreteRandomVariable is deprecated; "
"use 'isinstance(..., DiscreteRandomVariable)' instead.")
return isinstance(X, DiscreteRandomVariable)

################################################################################
################################################################################

# We could inherit from a functions class here but use Parent

Expand Down
Loading