Skip to content
Merged
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
31 changes: 1 addition & 30 deletions src/sage/rings/infinity.py
Original file line number Diff line number Diff line change
Expand Up @@ -970,35 +970,6 @@ def _richcmp_(self, other, op) -> bool:
less_than_infinity = UnsignedInfinityRing.less_than_infinity()


def is_Infinite(x) -> bool:
"""
This is a type check for infinity elements.

EXAMPLES::

sage: sage.rings.infinity.is_Infinite(oo)
doctest:warning...
DeprecationWarning: The function is_Infinite is deprecated;
use 'isinstance(..., InfinityElement)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
sage: sage.rings.infinity.is_Infinite(-oo)
True
sage: sage.rings.infinity.is_Infinite(unsigned_infinity)
True
sage: sage.rings.infinity.is_Infinite(3)
False
sage: sage.rings.infinity.is_Infinite(RR(infinity))
False
sage: sage.rings.infinity.is_Infinite(ZZ)
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_Infinite is deprecated; use 'isinstance(..., InfinityElement)' instead.")

return isinstance(x, InfinityElement)


class SignError(ArithmeticError):
"""
Sign error exception.
Expand All @@ -1007,7 +978,7 @@ class SignError(ArithmeticError):


class InfinityRing_class(Singleton, CommutativeRing):
def __init__(self):
def __init__(self) -> None:
"""
Initialize ``self``.

Expand Down
22 changes: 0 additions & 22 deletions src/sage/schemes/affine/affine_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,28 +38,6 @@
_Fields = Fields()


def is_AffineSpace(x) -> bool:
r"""
Return ``True`` if ``x`` is an affine space.

EXAMPLES::

sage: from sage.schemes.affine.affine_space import is_AffineSpace
sage: is_AffineSpace(AffineSpace(5, names='x'))
doctest:warning...
DeprecationWarning: The function is_AffineSpace is deprecated; use 'isinstance(..., AffineSpace_generic)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
sage: is_AffineSpace(AffineSpace(5, GF(9, 'alpha'), names='x')) # needs sage.rings.finite_rings
True
sage: is_AffineSpace(Spec(ZZ))
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_AffineSpace is deprecated; use 'isinstance(..., AffineSpace_generic)' instead.")
return isinstance(x, AffineSpace_generic)


def AffineSpace(n, R=None, names=None, ambient_projective_space=None,
default_embedding_index=None):
r"""
Expand Down
48 changes: 0 additions & 48 deletions src/sage/schemes/berkovich/berkovich_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,54 +48,6 @@
lazy_import('sage.rings.number_field.number_field_ideal', 'NumberFieldFractionalIdeal')


def is_Berkovich(space) -> bool:
"""
Check if ``space`` is a Berkovich space.

OUTPUT:

- ``True`` if ``space`` is a Berkovich space.
- ``False`` otherwise.

EXAMPLES::

sage: B = Berkovich_Cp_Projective(3)
sage: from sage.schemes.berkovich.berkovich_space import is_Berkovich
sage: is_Berkovich(B)
doctest:warning...
DeprecationWarning: The function is_Berkovich is deprecated; use 'isinstance(..., Berkovich)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_Berkovich is deprecated; use 'isinstance(..., Berkovich)' instead.")
return isinstance(space, Berkovich)


def is_Berkovich_Cp(space) -> bool:
"""
Check if ``space`` is a Berkovich space over ``Cp``.

OUTPUT:

- ``True`` if ``space`` is a Berkovich space over ``Cp``.
- ``False`` otherwise.

EXAMPLES::

sage: B = Berkovich_Cp_Projective(3)
sage: from sage.schemes.berkovich.berkovich_space import is_Berkovich_Cp
sage: is_Berkovich_Cp(B)
doctest:warning...
DeprecationWarning: The function is_Berkovich_Cp is deprecated; use 'isinstance(..., Berkovich_Cp)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_Berkovich_Cp is deprecated; use 'isinstance(..., Berkovich_Cp)' instead.")
return isinstance(space, Berkovich_Cp)


class Berkovich(UniqueRepresentation, Parent):
"""
The parent class for any Berkovich space
Expand Down
21 changes: 0 additions & 21 deletions src/sage/schemes/elliptic_curves/ell_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,6 @@
exp = math.exp


def is_EllipticCurve(x):
r"""
Utility function to test if ``x`` is an instance of an Elliptic Curve class.

EXAMPLES::

sage: from sage.schemes.elliptic_curves.ell_generic import is_EllipticCurve
sage: E = EllipticCurve([1,2,3/4,7,19])
sage: is_EllipticCurve(E)
doctest:warning...
DeprecationWarning: The function is_EllipticCurve is deprecated; use 'isinstance(..., EllipticCurve_generic)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
sage: is_EllipticCurve(0)
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_EllipticCurve is deprecated; use 'isinstance(..., EllipticCurve_generic)' instead.")
return isinstance(x, EllipticCurve_generic)


class EllipticCurve_generic(WithEqualityById, plane_curve.ProjectivePlaneCurve):
r"""
Elliptic curve over a generic base ring.
Expand Down
65 changes: 1 addition & 64 deletions src/sage/schemes/generic/algebraic_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,69 +135,6 @@
from . import scheme


def is_AlgebraicScheme(x):
"""
Test whether ``x`` is an algebraic scheme.

INPUT:

- ``x`` -- anything

OUTPUT:

boolean; whether ``x`` is an algebraic scheme, that is, a
subscheme of an ambient space over a ring defined by polynomial
equations.

EXAMPLES::

sage: A2 = AffineSpace(2, QQ, 'x, y')
sage: A2.coordinate_ring().inject_variables()
Defining x, y
sage: V = A2.subscheme([x^2 + y^2]); V
Closed subscheme of Affine Space of dimension 2 over Rational Field defined by:
x^2 + y^2
sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme
sage: is_AlgebraicScheme(V)
doctest:warning...
DeprecationWarning: The function is_AlgebraicScheme is deprecated; use 'isinstance(..., AlgebraicScheme)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True

Affine space is itself not an algebraic scheme, though the closed
subscheme defined by no equations is::

sage: from sage.schemes.generic.algebraic_scheme import is_AlgebraicScheme
sage: is_AlgebraicScheme(AffineSpace(10, QQ))
False
sage: V = AffineSpace(10, QQ).subscheme([]); V
Closed subscheme of Affine Space of dimension 10 over Rational Field defined by:
(no polynomials)
sage: is_AlgebraicScheme(V)
True

We create a more complicated closed subscheme::

sage: A,x = AffineSpace(10, QQ).objgens()
sage: X = A.subscheme([sum(x)]); X
Closed subscheme of Affine Space of dimension 10 over Rational Field defined by:
x0 + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
sage: is_AlgebraicScheme(X)
True

::

sage: is_AlgebraicScheme(QQ)
False
sage: S = Spec(QQ)
sage: is_AlgebraicScheme(S)
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_AlgebraicScheme is deprecated; use 'isinstance(..., AlgebraicScheme)' instead.")
return isinstance(x, AlgebraicScheme)


# ****************************************************************************
# A quick overview over the class hierarchy:
#
Expand All @@ -219,7 +156,7 @@ class AlgebraicScheme(scheme.Scheme):
defined by equations in affine, projective, or toric ambient
spaces.
"""
def __init__(self, A, category=None):
def __init__(self, A, category=None) -> None:
"""
TESTS::

Expand Down
25 changes: 1 addition & 24 deletions src/sage/schemes/generic/ambient_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# http://www.gnu.org/licenses/
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.rings.integer import Integer
Expand All @@ -17,29 +17,6 @@
from sage.schemes.generic.scheme import Scheme


def is_AmbientSpace(x):
"""
Return ``True`` if `x` is an ambient space.

EXAMPLES::

sage: from sage.schemes.generic.ambient_space import is_AmbientSpace
sage: is_AmbientSpace(ProjectiveSpace(3, ZZ))
doctest:warning...
DeprecationWarning: The function is_AmbientSpace is deprecated; use 'isinstance(..., AmbientSpace)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
sage: is_AmbientSpace(AffineSpace(2, QQ))
True
sage: P.<x, y, z> = ProjectiveSpace(2, ZZ)
sage: is_AmbientSpace(P.subscheme([x + y + z]))
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_AmbientSpace is deprecated; use 'isinstance(..., AmbientSpace)' instead.")
return isinstance(x, AmbientSpace)


class AmbientSpace(Scheme):
"""
Base class for ambient spaces over a ring.
Expand Down
29 changes: 1 addition & 28 deletions src/sage/schemes/generic/divisor_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,6 @@ def DivisorGroup(scheme, base_ring=None):
return DG


def is_DivisorGroup(x):
r"""
Return whether ``x`` is a :class:`DivisorGroup_generic`.

INPUT:

- ``x`` -- anything

OUTPUT: boolean

EXAMPLES::

sage: from sage.schemes.generic.divisor_group import is_DivisorGroup, DivisorGroup
sage: Div = DivisorGroup(Spec(ZZ), base_ring=QQ)
sage: is_DivisorGroup(Div)
doctest:warning...
DeprecationWarning: The function is_DivisorGroup is deprecated; use 'isinstance(..., DivisorGroup_generic)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
True
sage: is_DivisorGroup('not a divisor')
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_DivisorGroup is deprecated; use 'isinstance(..., DivisorGroup_generic)' instead.")
return isinstance(x, DivisorGroup_generic)


class DivisorGroup_generic(FormalSums):
r"""
The divisor group on a variety.
Expand All @@ -104,7 +77,7 @@ def __classcall__(cls, scheme, base_ring=ZZ):
# Must not call super().__classcall__()!
return UniqueRepresentation.__classcall__(cls, scheme, base_ring)

def __init__(self, scheme, base_ring):
def __init__(self, scheme, base_ring) -> None:
r"""
Construct a :class:`DivisorGroup_generic`.

Expand Down
25 changes: 0 additions & 25 deletions src/sage/schemes/generic/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,6 @@
lazy_import('sage.schemes.projective.projective_space', 'ProjectiveSpace_ring', as_='ProjectiveSpace')


def is_SchemeHomset(H):
r"""
Test whether ``H`` is a scheme Hom-set.

EXAMPLES::

sage: f = Spec(QQ).identity_morphism(); f
Scheme endomorphism of Spectrum of Rational Field
Defn: Identity map
sage: from sage.schemes.generic.homset import is_SchemeHomset
sage: is_SchemeHomset(f)
doctest:warning...
DeprecationWarning: The function is_SchemeHomset is deprecated; use 'isinstance(..., SchemeHomset_generic)' instead.
See https://github.com/sagemath/sage/issues/38022 for details.
False
sage: is_SchemeHomset(f.parent())
True
sage: is_SchemeHomset('a string')
False
"""
from sage.misc.superseded import deprecation
deprecation(38022, "The function is_SchemeHomset is deprecated; use 'isinstance(..., SchemeHomset_generic)' instead.")
return isinstance(H, SchemeHomset_generic)


# *******************************************************************
# Factory for Hom sets of schemes
# *******************************************************************
Expand Down
Loading
Loading