Skip to content

Commit

Permalink
sagemathgh-36307: sage.rings: Remove code deprecated in sagemath#23204
Browse files Browse the repository at this point in the history
, sagemath#24483, sagemath#24371, sagemath#24511, sagemath#25848, sagemath#26105, sagemath#28481, sagemath#29010, sagemath#29412, sagemath#30332, sagemath#30372, sagemath#31345, sagemath#32375, sagemath#32606, sagemath#32610, sagemath#32612, sagemath#32641, sagemath#32660, sagemath#32750, sagemath#32869, sagemath#33602

    
<!-- ^^^^^
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#36307
Reported by: Matthias Köppe
Reviewer(s):
  • Loading branch information
Release Manager committed Sep 22, 2023
2 parents fb84666 + 5cecd1c commit 9ea5127
Show file tree
Hide file tree
Showing 25 changed files with 51 additions and 789 deletions.
27 changes: 0 additions & 27 deletions src/sage/rings/all.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
"""
Rings
Tests for deprecations of imports in global namespace from :trac:`33602`::
sage: PowerSeries
doctest:warning...:
DeprecationWarning:
Importing PowerSeries from here is deprecated;
please use "from sage.rings.power_series_ring_element import PowerSeries" instead.
See https://github.com/sagemath/sage/issues/33602 for details.
...
sage: PuiseuxSeries
doctest:warning...:
DeprecationWarning:
Importing PuiseuxSeries from here is deprecated;
please use "from sage.rings.puiseux_series_ring_element import PuiseuxSeries" instead.
See https://github.com/sagemath/sage/issues/33602 for details.
...
sage: LaurentSeries
doctest:warning...:
DeprecationWarning:
Importing LaurentSeries from here is deprecated;
please use "from sage.rings.laurent_series_ring_element import LaurentSeries" instead.
See https://github.com/sagemath/sage/issues/33602 for details.
...
"""
# ****************************************************************************
# Copyright (C) 2005 William Stein <wstein@gmail.com>
Expand Down Expand Up @@ -139,11 +115,9 @@

# Power series rings
from .power_series_ring import PowerSeriesRing
lazy_import('sage.rings.power_series_ring_element', 'PowerSeries', deprecation=33602)

# Laurent series ring in one variable
from .laurent_series_ring import LaurentSeriesRing
lazy_import('sage.rings.laurent_series_ring_element', 'LaurentSeries', deprecation=33602)

# Lazy Laurent series ring
lazy_import('sage.rings.lazy_series_ring', ['LazyLaurentSeriesRing', 'LazyPowerSeriesRing',
Expand All @@ -154,7 +128,6 @@

# Puiseux series ring
from .puiseux_series_ring import PuiseuxSeriesRing
lazy_import('sage.rings.puiseux_series_ring_element', 'PuiseuxSeries', deprecation=33602)

# Pseudo-ring of PARI objects.
from .pari_ring import PariRing, Pari
Expand Down
12 changes: 1 addition & 11 deletions src/sage/rings/complex_arb.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ from sage.structure.unique_representation import UniqueRepresentation
from sage.arith.long cimport is_small_python_int

from sage.misc.lazy_string import lazy_string
from sage.misc.superseded import deprecated_function_alias
from sage.rings.complex_interval_field import ComplexIntervalField, ComplexIntervalField_class
from sage.rings.integer_ring import ZZ


cdef void ComplexIntervalFieldElement_to_acb(
acb_t target,
ComplexIntervalFieldElement source):
Expand Down Expand Up @@ -4229,8 +4229,6 @@ cdef class ComplexBall(RingElement):
if _do_sig(prec(self)): sig_off()
return result

ei = deprecated_function_alias(32869, Ei)

def Si(self):
"""
Return the sine integral with argument ``self``.
Expand All @@ -4255,8 +4253,6 @@ cdef class ComplexBall(RingElement):

sin_integral = Si # as for the symbolic function

si = deprecated_function_alias(32869, Si)

def Ci(self):
"""
Return the cosine integral with argument ``self``.
Expand All @@ -4281,8 +4277,6 @@ cdef class ComplexBall(RingElement):

cos_integral = Ci # as for the symbolic function

ci = deprecated_function_alias(32869, Ci)

def Shi(self):
"""
Return the hyperbolic sine integral with argument ``self``.
Expand All @@ -4307,8 +4301,6 @@ cdef class ComplexBall(RingElement):

sinh_integral = Shi

shi = deprecated_function_alias(32869, Shi)

def Chi(self):
"""
Return the hyperbolic cosine integral with argument ``self``.
Expand All @@ -4333,8 +4325,6 @@ cdef class ComplexBall(RingElement):

cosh_integral = Chi

chi = deprecated_function_alias(32869, Chi)

def li(self, bint offset=False):
"""
Return the logarithmic integral with argument ``self``.
Expand Down
24 changes: 0 additions & 24 deletions src/sage/rings/complex_double.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -116,30 +116,6 @@ cimport gmpy2
gmpy2.import_gmpy2()


def is_ComplexDoubleField(x):
"""
Return ``True`` if ``x`` is the complex double field.
This function is deprecated. Use :func:`isinstance` with
:class:`~sage.rings.abc.ComplexDoubleField` instead.
EXAMPLES::
sage: from sage.rings.complex_double import is_ComplexDoubleField
sage: is_ComplexDoubleField(CDF)
doctest:warning...
DeprecationWarning: is_ComplexDoubleField is deprecated;
use isinstance(..., sage.rings.abc.ComplexDoubleField) instead
See https://github.com/sagemath/sage/issues/32610 for details.
True
sage: is_ComplexDoubleField(ComplexField(53))
False
"""
from sage.misc.superseded import deprecation
deprecation(32610, 'is_ComplexDoubleField is deprecated; use isinstance(..., sage.rings.abc.ComplexDoubleField) instead')
return isinstance(x, ComplexDoubleField_class)


cdef class ComplexDoubleField_class(sage.rings.abc.ComplexDoubleField):
"""
An approximation to the field of complex numbers using double
Expand Down
17 changes: 0 additions & 17 deletions src/sage/rings/complex_field.py

This file was deleted.

21 changes: 0 additions & 21 deletions src/sage/rings/complex_interval_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,6 @@
from sage.misc.cachefunc import cached_method


def is_ComplexIntervalField(x):
"""
Check if ``x`` is a :class:`ComplexIntervalField`.
EXAMPLES::
sage: from sage.rings.complex_interval_field import is_ComplexIntervalField as is_CIF
sage: is_CIF(CIF)
doctest:warning...
DeprecationWarning: is_ComplexIntervalField is deprecated;
use isinstance(..., sage.rings.abc.ComplexIntervalField) instead
See https://github.com/sagemath/sage/issues/32612 for details.
True
sage: is_CIF(CC)
False
"""
from sage.misc.superseded import deprecation
deprecation(32612, 'is_ComplexIntervalField is deprecated; use isinstance(..., sage.rings.abc.ComplexIntervalField) instead')
return isinstance(x, ComplexIntervalField_class)


cache = {}
def ComplexIntervalField(prec=53, names=None):
"""
Expand Down
4 changes: 0 additions & 4 deletions src/sage/rings/complex_mpc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ from .real_mpfr import mpfr_prec_min, mpfr_prec_max
from sage.structure.richcmp cimport rich_to_bool, richcmp
from sage.categories.fields import Fields

from sage.misc.superseded import deprecated_function_alias

cimport gmpy2
gmpy2.import_gmpy2()

Expand Down Expand Up @@ -1949,8 +1947,6 @@ cdef class MPComplexNumber(sage.structure.element.FieldElement):
"""
return ~(self.tan())

cotan = deprecated_function_alias(29412, cot)

################################
# Other functions
################################
Expand Down
30 changes: 0 additions & 30 deletions src/sage/rings/complex_mpfr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ from sage.libs.gsl.complex cimport *
from sage.libs.mpmath.utils cimport mpfr_to_mpfval
from sage.rings.integer_ring import ZZ

from sage.misc.superseded import deprecated_function_alias

cimport gmpy2
gmpy2.import_gmpy2()

Expand Down Expand Up @@ -157,32 +155,6 @@ def is_ComplexNumber(x):
return isinstance(x, ComplexNumber)


def is_ComplexField(x):
"""
Check if ``x`` is a :class:`complex field <ComplexField_class>`.
This function is deprecated. Use :func:`isinstance` with
:class:`~sage.rings.abc.ComplexField` instead.
EXAMPLES::
sage: from sage.rings.complex_mpfr import is_ComplexField as is_CF
sage: is_CF(ComplexField())
doctest:warning...
DeprecationWarning: is_ComplexField is deprecated;
use isinstance(..., sage.rings.abc.ComplexField) instead
See https://github.com/sagemath/sage/issues/32610 for details.
True
sage: is_CF(ComplexField(12))
True
sage: is_CF(CC)
True
"""
from sage.misc.superseded import deprecation
deprecation(32610, 'is_ComplexField is deprecated; use isinstance(..., sage.rings.abc.ComplexField) instead')
return isinstance(x, ComplexField_class)


cache = {}
def ComplexField(prec=53, names=None):
"""
Expand Down Expand Up @@ -2267,8 +2239,6 @@ cdef class ComplexNumber(sage.structure.element.FieldElement):
"""
return ~(self.tan())

cotan = deprecated_function_alias(29412, cot)

def cos(self):
"""
Return the cosine of ``self``.
Expand Down
14 changes: 0 additions & 14 deletions src/sage/rings/complex_number.pyx

This file was deleted.

11 changes: 1 addition & 10 deletions src/sage/rings/finite_rings/finite_field_base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ cdef class FiniteField(Field):
else:
return PolynomialRing(GF(self.characteristic()), variable_name)

def free_module(self, base=None, basis=None, map=None, subfield=None):
def free_module(self, base=None, basis=None, map=True):
"""
Return the vector space over the subfield isomorphic to this
finite field as a vector space, along with the isomorphisms.
Expand Down Expand Up @@ -1253,15 +1253,6 @@ cdef class FiniteField(Field):
sage: all(to_V(h(c) * e) == c * to_V(e) for e in E for c in F)
True
"""
if subfield is not None:
if base is not None:
raise ValueError
deprecation(28481, "The subfield keyword argument has been renamed to base")
base = subfield
if map is None:
deprecation(28481, "The default value for map will be changing to True. To keep the current behavior, explicitly pass map=False.")
map = False

if base is None and self.__vector_space is not None and not map:
# A very common case: return as early as possible.
return self.__vector_space
Expand Down
7 changes: 1 addition & 6 deletions src/sage/rings/finite_rings/integer_mod.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ cdef class IntegerMod_abstract(FiniteRingElement):
else:
return sib(self.parent())(v)

def log(self, b=None, logarithm_exists=None):
def log(self, b=None):
r"""
Compute the discrete logarithm of this element to base `b`,
that is,
Expand Down Expand Up @@ -759,11 +759,6 @@ cdef class IntegerMod_abstract(FiniteRingElement):
- Lorenz Panny (2021): speedups for composite moduli
"""

if logarithm_exists is not None:
from sage.misc.superseded import deprecation
deprecation(32375, 'The "logarithm_exists" argument to .log() is no longer necessary and will be removed at some point.')

if not self.is_unit():
raise ValueError(f"logarithm of {self} is not defined since it is not a unit modulo {self.modulus()}")

Expand Down
32 changes: 0 additions & 32 deletions src/sage/rings/finite_rings/integer_mod_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,38 +246,6 @@ def create_object(self, version, order, **kwds):
Zmod = Integers = IntegerModRing = IntegerModFactory("IntegerModRing")


def is_IntegerModRing(x):
"""
Return ``True`` if ``x`` is an integer modulo ring.
This function is deprecated. Use :func:`isinstance` with
:class:`sage.rings.abc.IntegerModRing` instead.
EXAMPLES::
sage: from sage.rings.finite_rings.integer_mod_ring import is_IntegerModRing
sage: R = IntegerModRing(17)
sage: is_IntegerModRing(R)
doctest:warning...
DeprecationWarning: the function is_IntegerModRing is deprecated.
Use isinstance(..., sage.rings.abc.IntegerModRing) instead.
See https://github.com/sagemath/sage/issues/32606 for details.
True
sage: is_IntegerModRing(GF(13))
True
sage: is_IntegerModRing(GF(4, 'a')) # needs sage.rings.finite_rings
False
sage: is_IntegerModRing(10)
False
sage: is_IntegerModRing(ZZ)
False
"""
from sage.misc.superseded import deprecation
deprecation(32606, "the function is_IntegerModRing is deprecated. "
"Use isinstance(..., sage.rings.abc.IntegerModRing) instead.")
return isinstance(x, IntegerModRing_generic)


from sage.categories.commutative_rings import CommutativeRings
from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets
from sage.categories.category import JoinCategory
Expand Down
Loading

0 comments on commit 9ea5127

Please sign in to comment.