Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 8fd5628

Browse files
committed
29543: add deprecation and reformat docstring
1 parent 223802c commit 8fd5628

File tree

1 file changed

+30
-12
lines changed

1 file changed

+30
-12
lines changed

src/sage/rings/polynomial/multi_polynomial_ideal.py

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2897,8 +2897,12 @@ def _normal_basis_libsingular(self, degree):
28972897
28982898
INPUT:
28992899
2900-
- ``degree`` -- integer; if not ``None``, return only the monomials of
2901-
the given degree
2900+
- ``degree`` -- ``None`` or integer
2901+
2902+
OUTPUT:
2903+
2904+
If ``degree`` is an integer, only the monomials of the given degree in
2905+
the normal basis.
29022906
29032907
EXAMPLES::
29042908
@@ -2932,21 +2936,22 @@ def _normal_basis_libsingular(self, degree):
29322936
def normal_basis(self, degree=None, algorithm='libsingular',
29332937
singular=singular_default):
29342938
"""
2935-
Return a vector space basis (consisting of monomials) of the
2936-
quotient ring of this ideal.
2939+
Return a vector space basis of the quotient ring of this ideal.
29372940
29382941
INPUT:
29392942
2940-
- ``degree`` -- integer (default: ``None``); if not ``None``, return
2941-
only the monomials of the given degree
2943+
- ``degree`` -- integer (default: ``None``)
29422944
2943-
- ``algorithm`` -- string (default: ``"libsingular"``); if different
2944-
from the default, this will use the ``kbase()`` command from
2945-
Singular instead of libsingular
2945+
- ``algorithm`` -- string (default: ``"libsingular"``); if not the
2946+
default, this will use the ``kbase()`` command from Singular
29462947
2947-
- ``singular`` -- instance of Singular interface (default: the default
2948-
instance); the singular interpreter to use when ``algorithm`` is not
2949-
``"libsingular"``
2948+
- ``singular`` -- the singular interpreter to use when ``algorithm`` is
2949+
not ``"libsingular"`` (default: the default instance)
2950+
2951+
OUTPUT:
2952+
2953+
Monomials in the basis. If ``degree`` is given, only the monomials of
2954+
the given degree are returned.
29502955
29512956
EXAMPLES::
29522957
@@ -2980,8 +2985,21 @@ def normal_basis(self, degree=None, algorithm='libsingular',
29802985
sage: J = R.ideal(x^2+y^2+z^2-4, x^2+2*y^2-5)
29812986
sage: [J.normal_basis(d) for d in (0..3)]
29822987
[[1], [z, y, x], [z^2, y*z, x*z, x*y], [z^3, y*z^2, x*z^2, x*y*z]]
2988+
2989+
Check the deprecation::
2990+
2991+
sage: R.<x,y> = PolynomialRing(QQ)
2992+
sage: _ = R.ideal(x^2+y^2, x*y+2*y).normal_basis('singular')
2993+
doctest:...: DeprecationWarning: "algorithm" should be used as keyword argument
2994+
See https://trac.sagemath.org/29543 for details.
29832995
"""
29842996
from sage.rings.polynomial.multi_polynomial_sequence import PolynomialSequence
2997+
if isinstance(degree, str):
2998+
from sage.misc.superseded import deprecation
2999+
deprecation(29543,
3000+
'"algorithm" should be used as keyword argument')
3001+
algorithm = degree
3002+
degree = None
29853003

29863004
if algorithm == 'libsingular':
29873005
return self._normal_basis_libsingular(degree)

0 commit comments

Comments
 (0)