@@ -3093,12 +3093,21 @@ def _normal_basis_libsingular(self, degree, weights=None):
3093
3093
sage: I = R.ideal(x^2-2*x*z+5, x*y^2+y*z+1, 3*y^2-8*x*z)
3094
3094
sage: I._normal_basis_libsingular(5)
3095
3095
[]
3096
+
3097
+ Check what happens with weights but no degree (:trac:`34789`)::
3098
+
3099
+ sage: TO = TermOrder('wdegrevlex', (2,))
3100
+ sage: R = PolynomialRing(QQ, 1, ['k'], order=TO)
3101
+ sage: k = R.gen()
3102
+ sage: I = R.ideal([k**2])
3103
+ sage: I.normal_basis()
3104
+ [k, 1]
3096
3105
"""
3097
3106
from sage .rings .polynomial .multi_polynomial_ideal_libsingular import kbase_libsingular
3098
3107
from sage .rings .polynomial .multi_polynomial_sequence import PolynomialSequence
3099
3108
gb = self ._groebner_basis_libsingular ()
3100
3109
J = self .ring ().ideal (gb )
3101
- if weights is None :
3110
+ if weights is None or degree is None :
3102
3111
res = kbase_libsingular (J , degree )
3103
3112
else :
3104
3113
from sage .libs .singular .function_factory import ff
@@ -3180,21 +3189,8 @@ def normal_basis(self, degree=None, algorithm='libsingular',
3180
3189
sage: S.<x,y,z> = PolynomialRing(GF(2), order=T)
3181
3190
sage: S.ideal(x^6 + y^3 + z^2).normal_basis(6, algorithm='singular')
3182
3191
[x^4*y, x^2*y^2, y^3, x^3*z, x*y*z, z^2]
3183
-
3184
- Check the deprecation::
3185
-
3186
- sage: R.<x,y> = PolynomialRing(QQ)
3187
- sage: _ = R.ideal(x^2+y^2, x*y+2*y).normal_basis('singular')
3188
- doctest:...: DeprecationWarning: "algorithm" should be used as keyword argument
3189
- See https://trac.sagemath.org/29543 for details.
3190
3192
"""
3191
3193
from sage .rings .polynomial .multi_polynomial_sequence import PolynomialSequence
3192
- if isinstance (degree , str ):
3193
- from sage .misc .superseded import deprecation
3194
- deprecation (29543 ,
3195
- '"algorithm" should be used as keyword argument' )
3196
- algorithm = degree
3197
- degree = None
3198
3194
3199
3195
weights = tuple (x .degree () for x in self .ring ().gens ())
3200
3196
if all (w == 1 for w in weights ):
0 commit comments