Opened 8 years ago
Last modified 21 months ago
#10483 needs_work defect
Deprecate the misuse of symbolic variables as polynomial variable
Reported by:  SimonKing  Owned by:  AlexGhitza 

Priority:  major  Milestone:  sage8.0 
Component:  basic arithmetic  Keywords:  deprecation symbolic polynomial variable 
Cc:  Merged in:  
Authors:  Simon King, Ralf Stephan, Jeroen Demeyer  Reviewers:  KarlDieter Crisman, Jeroen Demeyer 
Report Upstream:  N/A  Work issues:  
Branch:  public/104834 (Commits)  Commit:  938beb01e0dd296790dc2748f99f0e5a0ed4ce26 
Dependencies:  #23337, #23338, #23343, #23377, #23638, #23640  Stopgaps: 
Description (last modified by )
Relatively often on sagesupport, users run into a problem since they mix symbolics and polynomials. Typically, they do
sage: z = var('z') sage: P = QQ[z]
and expect that z
is the generator of P
 which is of course
wrong and will soon mean trouble.
I find even worse that one can do
sage: QQ[x,gap,singular] Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
since the variable names are obtained from the string representation of the given objects.
It should be clear that the preferred way of constructing a polynomial (or quotient) ring together with its generators is
sage: R.<x,y,z> = QQ[]
Hence, it is quite amazing that in the documentation one occasionally finds the "wrong" usage
sage: x,y,z = var('x y z') sage: P = QQ[x,y,z]
I suggest to deprecate the possibility of providing the variable names by anything but strings (potentially plus an integer, like PolynomialRing(QQ,'x',5)
).
With my patch, one has
sage: QQ[x,gap,singular] /mnt/local/king/SAGE/sage4.6/local/bin/sageipython:1: DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'x' should be a string, but we obtained <type 'sage.symbolic.expression.Expression'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. #!/usr/bin/env python /mnt/local/king/SAGE/sage4.6/local/bin/sageipython:1: DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'Gap' should be a string, but we obtained <class 'sage.interfaces.gap.Gap'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. #!/usr/bin/env python /mnt/local/king/SAGE/sage4.6/local/bin/sageipython:1: DeprecationWarning: (Since Sage Version 4.6.1) Variable name 'Singular' should be a string, but we obtained <class 'sage.interfaces.singular.Singular'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. #!/usr/bin/env python Multivariate Polynomial Ring in x, Gap, Singular over Rational Field
See also #13187 where the problem of this ticket had the wrong solution (allowing for other types than string).
Attachments (1)
Change History (112)
Changed 8 years ago by
comment:1 Changed 8 years ago by
 Status changed from new to needs_review
comment:2 followup: ↓ 3 Changed 8 years ago by
Just a question  are the changes in symbolics because before the variables might or might not have been strings?
Also, is there an easy way to show what the generator of P
would have been in the "bad" old case? I think that's useful to point out, if one is going to make the remarks in the first place.
comment:3 in reply to: ↑ 2 Changed 8 years ago by
Replying to kcrisman:
Just a question  are the changes in symbolics because before the variables might or might not have been strings?
As much as I know, the changes that I did in symbolics are indeed "replace a variable v
by repr(v)
when it is used to define a polynomial ring.
Also, is there an easy way to show what the generator of
P
would have been in the "bad" old case? I think that's useful to point out, if one is going to make the remarks in the first place.
I am not quite sure what you mean. By "remark", you probably mean
In earlier versions of Sage, the names have not necessarily been strings. Some users provided a symbolic variable instead of a string, and expected that this symbolic variable is the same as the generator of the resulting polynomial ring, which is of course not the case. This common mistake is now deprecated.
So, you suggest to write something like this:
In earlier versions of Sage, the names have not necessarily been strings. Some users provided a symbolic variable instead of a string, and expected that this symbolic variable is the same as the generator of the resulting polynomial ring, which is of course not the case. The following might be surpising for a user expecting the variable `x` to be a polynomial:: sage: P = QQ['x'] # here, some users wrote QQ[x], which is now deprecated sage: x == P(x) x == x sage: type(x == P(x)) <type 'sage.symbolic.expression.Expression'> sage: parent(x+P(x)) == P False
I am not so convinced that the above text is good. Do you have a better suggesion?
comment:4 followup: ↓ 5 Changed 8 years ago by
 Reviewers set to KarlDieter Crisman
I'm just saying that the "of course is not the case" is not at all "of course" to me. Current behavior:
sage: P = QQ[x] sage: P.gen() x sage: P.gen() == x x == x sage: bool(P.gen() == x) True sage: P.gen() is x False
So unless you think to do the last thing, that is pretty confusing  they have identical representation methods. Which is of course why you want to change this, and introduce the deprecation.
So maybe you could say
... resulting polynomial ring. However, this was not the case; the generator of a polynomial ring is always a polynomial type, not a symbolic expression, so although they have the same representation, they are not the same. This explains the following warning: <deprecation warning doctest
Does that make any sense?
comment:5 in reply to: ↑ 4 ; followup: ↓ 6 Changed 8 years ago by
Replying to kcrisman:
So maybe you could say
... resulting polynomial ring. However, this was not the case; the generator of a polynomial ring is always a polynomial type, not a symbolic expression, so although they have the same representation, they are not the same. This explains the following warning: <deprecation warning doctestDoes that make any sense?
Yes, your formulation sounds much better than mine! Could you make a reviewer patch, changing the formulation?
Best regards, Simon
comment:6 in reply to: ↑ 5 Changed 8 years ago by
Replying to SimonKing:
Replying to kcrisman:
So maybe you could say
... resulting polynomial ring. However, this was not the case; the generator of a polynomial ring is always a polynomial type, not a symbolic expression, so although they have the same representation, they are not the same. This explains the following warning: <deprecation warning doctestDoes that make any sense?
Yes, your formulation sounds much better than mine! Could you make a reviewer patch, changing the formulation?
Umm... that might not happen for a little while. I can do it, though. But if I'm going to give it a formal review, I have to make sure I check that all those changes involving making things strings really catch what they are supposed to, and I don't have time to do that right now, and then make the reviewer patch, and I am slow on such things... sorry.
Also, I seem to recall there being some discussion about this on sagedevel. It's enough of a change (particularly since there are doctests which use the old one) that it could inconvenience some heavy users to see the deprecation messages, so if you have a link to that discussion I'd be interested in reading through it.
comment:7 Changed 8 years ago by
For reference, here is the sagedevel discussion. Not that much noise, thankfully.
comment:8 Changed 8 years ago by
 Status changed from needs_review to needs_info
Upon further reflection, I think that one would have to change a lot more of the doctests where x
is used. This is because even though changing things so that they use SR['x']
instead of SR[x]
is good, the same potential for confusion remains. The very first example in the patch provides the opportunity for this:
sage: R = SR['x'] sage: f = R([1/sqrt(2), 1/(4*sqrt(2))]) sage: f 1/8*sqrt(2)*x + 1/2*sqrt(2) sage: type(f) <class 'sage.rings.polynomial.polynomial_element_generic.Polynomial_generic_dense_field'> sage: type(1/8*sqrt(2)*x + 1/2*sqrt(2)) <type 'sage.symbolic.expression.Expression'> sage: type(x) <type 'sage.symbolic.expression.Expression'> sage: type(R.gen()) <class 'sage.rings.polynomial.polynomial_element_generic.Polynomial_generic_dense_field'>
I don't think we want to actually prohibit this  x is so conventional  but the doctests should all definitely be changed so that some variable other than the one default variable actually predefined by Sage is used with polynomial rings! And we might want to put more warnings about this in the polynomial ring generator docs anyway. Not to mention the tutorial :)
So putting 'needs info' until we think about what the best course of action is. But I don't want to just change these doctests, because it hides the real ambiguity, since 'x' is predefined as a variable when Sage initializes  which it should.
comment:9 Changed 8 years ago by
bump
Any new info in the last 5 months?
comment:10 Changed 6 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:11 followup: ↓ 12 Changed 5 years ago by
Pardon my naivete, why not recreate the symbol as ring element (and discard the symbol) when the user, by using it in a polynomial context, expects it to behave as one?
comment:12 in reply to: ↑ 11 Changed 5 years ago by
Replying to rws:
Pardon my naivete, why not recreate the symbol as ring element (and discard the symbol) when the user, by using it in a polynomial context, expects it to behave as one?
The following two invocations cannot be distinguished by the code implementing polynomial ring constructions:
x,y,z=var('x,y,z'); R = Q[x,y,z]
R = Q[ SR('x'), SR('y'), SR('z')]
Hopefully you'll agree that in the second case there is no justification to try and reach into the global scope to rebind python names that happen to print as the corresponding strings 'x','y','z'
.
But thanks for bumping this ticket. Can we merge it?
comment:13 Changed 5 years ago by
Like I said above (3 years ago? wow), it would be best to think about making the default examples for polynomial rings not use x, since that is indeed already defined systemwide, and changing the examples to use the string won't help the confusion. But I have no objection to the change in principle, just the potential for continuing confusion.
comment:14 Changed 5 years ago by
I also agree with the patch in principle, except I would use str()
instead of repr()
.
comment:15 Changed 5 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:16 Changed 5 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:17 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:18 Changed 5 years ago by
I tried to rebase this but had some trouble, possibly because of user error.
comment:19 Changed 4 years ago by
 Branch set to public/10483
comment:20 Changed 4 years ago by
 Commit set to cb6547a459cb437f47f8c0fd11bc1d9804364dd7
 Status changed from needs_info to needs_work
Needed a bit of manual merging. Please review.
New commits:
cb6547a  10483: Deprecate the use of nonstrings as variable names in polynomial (quotient) rings

comment:21 Changed 4 years ago by
 Status changed from needs_work to needs_review
comment:22 followup: ↓ 25 Changed 4 years ago by
 Status changed from needs_review to needs_work
Surely, all those .orig
files are a mistake?
comment:23 Changed 4 years ago by
 Branch changed from public/10483 to public/104831
comment:24 Changed 4 years ago by
 Branch changed from public/104831 to public/104832
comment:25 in reply to: ↑ 22 Changed 4 years ago by
 Commit changed from cb6547a459cb437f47f8c0fd11bc1d9804364dd7 to 7874bd347acdcc1f5b6683c53f6021a623dbb4ac
 Status changed from needs_work to needs_review
comment:26 followup: ↓ 30 Changed 4 years ago by
In various places in the library files, you manually call R[repr(x)]
or R[str(x)]
. Is that really needed? Maybe in some cases it is justified, but you need to convince me.
Then some details:
x, y = 'x', 'y'
is confusing, just use 'x'
and 'y'
instead of x
and y
.
Replace
R = PolynomialRing(GF(2)['x'])
by
R = PolynomialRing(GF(2), 'x')
Change
from sage.misc.misc import deprecation ... if do_something_deprecated(): deprecation(..)
to
... if do_something_deprecated(): from sage.misc.misc import deprecation deprecation(..)
comment:27 Changed 4 years ago by
 Status changed from needs_review to needs_work
comment:28 Changed 4 years ago by
Also replace
R.<x> = ZZ[x]
by
R.<x> = ZZ[]
comment:29 Changed 4 years ago by
 Commit changed from 7874bd347acdcc1f5b6683c53f6021a623dbb4ac to 649f6fb728c51f319a369046490afcda8d367ac7
Branch pushed to git repo; I updated commit sha1. New commits:
649f6fb  10483: various cosmetics addressing reviewer's comments

comment:30 in reply to: ↑ 26 ; followup: ↓ 32 Changed 4 years ago by
 Status changed from needs_work to needs_review
Replying to jdemeyer:
In various places in the library files, you manually call
R[repr(x)]
orR[str(x)]
. Is that really needed? Maybe in some cases it is justified, but you need to convince me.
Can you please give an example?
comment:31 followup: ↓ 33 Changed 4 years ago by
This example:
sage: R.<xx> = QuotientRing(QQ['x'], QQ['x'].ideal(x^2 + 1)); R
is still referring to a wild x
for the ideal generator. The meaning of this code really depends on what x
happens to be bound to before. I don't see another way than to write this code in multiple steps:
sage: P.<x> = QQ[]; R.<xx> = QuotientRing(P, P.ideal(x^2 + 1)); R
In fact, if you put that on one line, it's hardly longer anyway. It might be better style to split it, though.
For jdemeyer's comments: search for "str(" in the git diff view. Your uses looked probable at first glance, but you might want to check the context.
comment:32 in reply to: ↑ 30 ; followup: ↓ 34 Changed 4 years ago by
Replying to rws:
Can you please give an example?
R = ZZ_q[x if isinstance(x,basestring) else str(x)].quotient(quotient, x if isinstance(x,basestring) else str(x))
comment:33 in reply to: ↑ 31 Changed 4 years ago by
 Status changed from needs_review to needs_work
Replying to nbruin:
This example:
sage: R.<xx> = QuotientRing(QQ['x'], QQ['x'].ideal(x^2 + 1)); Ris still referring to a wild
x
for the ideal generator. The meaning of this code really depends on whatx
happens to be bound to before. I don't see another way than to write this code in multiple steps:sage: P.<x> = QQ[]; R.<xx> = QuotientRing(P, P.ideal(x^2 + 1)); RIn fact, if you put that on one line, it's hardly longer anyway. It might be better style to split it, though.
Yes, please split it:
sage: P.<x> = QQ[] sage: R.<xx> = QuotientRing(P, P.ideal(x^2 + 1)) sage: R
comment:34 in reply to: ↑ 32 ; followup: ↓ 35 Changed 4 years ago by
Replying to jdemeyer:
Replying to rws:
Can you please give an example?
R = ZZ_q[x if isinstance(x,basestring) else str(x)].quotient(quotient, x if isinstance(x,basestring) else str(x))
Well, it seems I cannot remove the str
here, but reducing to R = ZZ_q[str(x)].quotient(quotient, str(x))
is possible, as x
is of type Expression
.
comment:35 in reply to: ↑ 34 Changed 4 years ago by
 Dependencies set to #17406
Replying to rws:
Well, it seems I cannot remove the
str
here, but reducing toR = ZZ_q[str(x)].quotient(quotient, str(x))
is possible, asx
is of typeExpression
.
The fact that quotient
should be of type Expression
is a bug in itself. Instead of working around this bug, it should instead be fixed: #17406
comment:36 Changed 4 years ago by
 Dependencies changed from #17406 to #17406, #17407
comment:37 Changed 4 years ago by
 Branch changed from public/104832 to u/jdemeyer/ticket/10483
 Modified changed from 11/27/14 10:10:37 to 11/27/14 10:10:37
comment:38 Changed 4 years ago by
 Commit changed from 649f6fb728c51f319a369046490afcda8d367ac7 to 1d3f1037727f0a457ad2bcb4bd28308fbda28af1
comment:39 Changed 4 years ago by
 Commit changed from 1d3f1037727f0a457ad2bcb4bd28308fbda28af1 to cbc1af1635a9022205c97417a611fb5ffd1ea429
comment:40 Changed 4 years ago by
 Reviewers changed from KarlDieter Crisman to KarlDieter Crisman, Jeroen Demeyer
There are still several doctest failures and some dubious uses of str()
.
comment:41 Changed 4 years ago by
 Commit changed from cbc1af1635a9022205c97417a611fb5ffd1ea429 to 83df2f35083b2824024c2f326d6f579b40bb04e1
comment:42 Changed 4 years ago by
 Branch changed from u/jdemeyer/ticket/10483 to public/104833
comment:43 followup: ↓ 44 Changed 4 years ago by
 Commit changed from 83df2f35083b2824024c2f326d6f579b40bb04e1 to 75e2a04227770247968a88f5fd9172d543710fba
Why do you change from public to private branch?
New commits:
47b6617  Merge branch 'public/17407' of trac.sagemath.org:sage into t/10483/ticket/10483

75e2a04  10483: more fixes

comment:44 in reply to: ↑ 43 ; followup: ↓ 49 Changed 4 years ago by
Replying to rws:
Why do you change from public to private branch?
Because that's what happens by default when using the ./sage dev
scripts.
comment:45 Changed 4 years ago by
 Description modified (diff)
comment:46 Changed 4 years ago by
 Commit changed from 75e2a04227770247968a88f5fd9172d543710fba to ad0c7819ba76675064bfdf9a1491ed95143152ec
comment:47 Changed 4 years ago by
 Commit changed from ad0c7819ba76675064bfdf9a1491ed95143152ec to 0534b9daea596531e8c6506e372dc718f23d0425
comment:48 Changed 4 years ago by
At this point nontrivial fails in the following files remain:
sage t long src/doc/en/constructions/calculus.rst # 1 doctest failed sage t long src/sage/algebras/commutative_dga.py # 7 doctests failed sage t long src/sage/coding/linear_code.py # 1 doctest failed sage t long src/sage/combinat/ncsf_qsym/qsym.py # 1 doctest failed sage t long src/sage/combinat/root_system/root_lattice_realization_algebras.py # 1 doctest failed sage t long src/sage/combinat/subset.py # 1 doctest failed sage t long src/sage/doctest/forker.py # 1 doctest failed sage t long src/sage/functions/piecewise.py # 2 doctests failed sage t long src/sage/libs/singular/groebner_strategy.pyx # 1 doctest failed sage t long src/sage/modular/modform_hecketriangle/abstract_ring.py # 1 doctest failed sage t long src/sage/rings/ideal.py # 1 doctest failed sage t long src/sage/rings/polynomial/multi_polynomial_ideal.py # 1 doctest failed sage t long src/sage/rings/polynomial/multi_polynomial_libsingular.pyx # 5 doctests failed sage t long src/sage/rings/polynomial/multi_polynomial_sequence.py # 2 doctests failed sage t long src/sage/rings/polynomial/plural.pyx # 5 doctests failed sage t long src/sage/rings/polynomial/polynomial_element.pyx # 2 doctests failed sage t long src/sage/rings/polynomial/polynomial_ring_constructor.py # 2 doctests failed sage t long src/sage/rings/quotient_ring.py # 3 doctests failed sage t long src/sage/rings/ring.pyx # 1 doctest failed sage t long src/sage/schemes/affine/affine_morphism.py # 9 doctests failed sage t long src/sage/schemes/affine/affine_point.py # 4 doctests failed sage t long src/sage/schemes/generic/algebraic_scheme.py # 1 doctest failed sage t long src/sage/schemes/product_projective/space.py # 3 doctests failed sage t long src/sage/schemes/projective/projective_morphism.py # 9 doctests failed sage t long src/sage/schemes/projective/projective_point.py # 2 doctests failed sage t long src/sage/structure/misc.pyx # 1 doctest failed sage t long src/sage/structure/parent_gens.pyx # 1 doctest failed sage t long src/sage/symbolic/expression_conversions.py # 1 doctest failed sage t long src/sage/symbolic/relation.py # 3 doctests failed
comment:49 in reply to: ↑ 44 Changed 4 years ago by
Replying to jdemeyer:
Replying to rws:
Why do you change from public to private branch?
Because that's what happens by default when using the
./sage dev
scripts.
With git trac
the default is to push to the branch you downloaded from.
Regarding that TODO list above, I completely underestimated what had amassed since Simon uploaded the patch. I will do work on rings/
next.
comment:50 Changed 4 years ago by
 Commit changed from 0534b9daea596531e8c6506e372dc718f23d0425 to 52b7f639fdc778d1d56615f2f1275fd3e01e0174
Branch pushed to git repo; I updated commit sha1. New commits:
d4f68b7  17407: more fixes

cb95eb5  Merge branch 'public/17407' of trac.sagemath.org:sage into t/10483/public/104833

7a8970d  10483: fix doctest fails in rings/poly/plural: normalize_names received nonstrings

52b7f63  10483: further fixes affecting doctests in rings/

comment:51 Changed 4 years ago by
 Commit changed from 52b7f639fdc778d1d56615f2f1275fd3e01e0174 to 58bc7051c72099f619b25ba91407fe2f2d6e5cbb
Branch pushed to git repo; I updated commit sha1. New commits:
58bc705  10483: various fixes to prevent deprecation warnings in doctests

comment:52 Changed 4 years ago by
 Status changed from needs_work to needs_review
There is still one fail that is unrelated and pops up only in bulk testing. As this is in a Cython file, I have some problems to resolve it. Can you help please?
File "src/sage/structure/misc.pyx", line 81, in sage.structure.misc.AttributeEr rorMessage Failed example: isinstance(ElementError.message, sage.structure.misc.AttributeErrorMessage) Expected: True Got: doctest:1: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 True
comment:53 Changed 4 years ago by
 Status changed from needs_review to needs_work
sage t long src/sage/tests/french_book/mpoly.py ********************************************************************** File "src/sage/tests/french_book/mpoly.py", line 273, in sage.tests.french_book.mpoly Failed example: fig = add((eq(t=k/5)*QQ[x,y]).plot() for k in (15..15)) Expected nothing Got: doctest:867: DeprecationWarning: Variable name 'x' should be a string, but we obtained <type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. See http://trac.sagemath.org/10483 for details. doctest:867: DeprecationWarning: Variable name 'y' should be a string, but we obtained <type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. See http://trac.sagemath.org/10483 for details. ********************************************************************** 1 item had failures: 1 of 148 in sage.tests.french_book.mpoly [147 tests, 1 failure, 6.33 s] sage t long src/sage/tests/french_book/polynomes.py ********************************************************************** File "src/sage/tests/french_book/polynomes.py", line 51, in sage.tests.french_book.polynomes Failed example: x = polygen(QQ); y = polygen(QQ[x], 'y') Expected nothing Got: doctest:867: DeprecationWarning: Variable name 'x' should be a string, but we obtained <type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. See http://trac.sagemath.org/10483 for details. ********************************************************************** 1 item had failures: 1 of 108 in sage.tests.french_book.polynomes [107 tests, 1 failure, 1.13 s] sage t long src/sage/structure/misc.pyx ********************************************************************** File "src/sage/structure/misc.pyx", line 81, in sage.structure.misc.AttributeErrorMessage Failed example: isinstance(ElementError.message, sage.structure.misc.AttributeErrorMessage) Expected: True Got: doctest:1: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6 True ********************************************************************** 1 item had failures: 1 of 17 in sage.structure.misc.AttributeErrorMessage [52 tests, 1 failure, 1.67 s] sage t long src/sage/modules/free_module_element.pyx ********************************************************************** File "src/sage/modules/free_module_element.pyx", line 2479, in sage.modules.free_module_element.FreeModuleElement.pairwise_product Failed example: parent(vector(ZZ[x],[1,2,3,4]).pairwise_product(vector(QQ,[1,2,3,4]))) Expected: Ambient free module of rank 4 over the principal ideal domain Univariate Polynomial Ring in x over Rational Field Got: doctest:867: DeprecationWarning: Variable name 'x' should be a string, but we obtained <type 'sage.symbolic.expression.Expression'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. See http://trac.sagemath.org/10483 for details. Ambient free module of rank 4 over the principal ideal domain Univariate Polynomial Ring in x over Rational Field ********************************************************************** File "src/sage/modules/free_module_element.pyx", line 2486, in sage.modules.free_module_element.FreeModuleElement.pairwise_product Failed example: parent(vector(ZZ[x][y],[1,2,3,4]).pairwise_product(vector(QQ,[1,2,3,4]))) Expected: Ambient free module of rank 4 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field Got: doctest:867: DeprecationWarning: Variable name 'y' should be a string, but we obtained <type 'sage.symbolic.expression.Expression'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. See http://trac.sagemath.org/10483 for details. Ambient free module of rank 4 over the integral domain Univariate Polynomial Ring in y over Univariate Polynomial Ring in x over Rational Field ********************************************************************** 1 item had failures: 2 of 32 in sage.modules.free_module_element.FreeModuleElement.pairwise_product [873 tests, 2 failures, 4.50 s] sage t long src/sage/misc/latex.py ********************************************************************** File "src/sage/misc/latex.py", line 1901, in sage.misc.latex.MathJax.__call__ Failed example: str(MathJax().eval(ZZ[x], mode='display')) == str(MathJax()(ZZ[x])) Expected: True Got: doctest:867: DeprecationWarning: Variable name 'x' should be a string, but we obtained <type 'sage.symbolic.expression.Expression'>. In an interactive session, you should use a definition of the form 'R.<x,y,z>=QQ[]'. See http://trac.sagemath.org/10483 for details. True **********************************************************************
comment:54 Changed 4 years ago by
comment:55 Changed 4 years ago by
Note that my repeated comments about the adding of str()
have not yet been addressed.
Ideally, this patch would only deal with the deprecation of ZZ[x]
and not with adding str()
in so many places. In the one case I looked at, the fact that str()
was needed was clearly a bug, and that's now #17406. For the other places where you are adding str()
, you should also check whether the adding of str()
is hiding a bug.
comment:56 followup: ↓ 57 Changed 4 years ago by
To be clear: I'm not against adding str()
, I am against adding of str()
without justification.
comment:57 in reply to: ↑ 56 ; followup: ↓ 58 Changed 4 years ago by
Replying to jdemeyer:
To be clear: I'm not against adding
str()
, I am against adding ofstr()
without justification.
OK, you are right. For example, the case in coding/linear_code.py(3004)
where the preconditions to weight_enumerator()
state name2
 string or symbolic variable
. Do we change the precondition to string
instead of converting everything?
comment:58 in reply to: ↑ 57 Changed 4 years ago by
Replying to rws:
Do we change the precondition to
string
instead of converting everything?
Yes, that's indeed the right thing to do. It's much more in the spirit of this ticket.
comment:59 Changed 4 years ago by
 Commit changed from 58bc7051c72099f619b25ba91407fe2f2d6e5cbb to c0103274a38a2b37c187eb223bcecb76df615283
Branch pushed to git repo; I updated commit sha1. New commits:
c010327  10483: doctest fixes; reimplementations to reduce ring var usage

comment:60 Changed 4 years ago by
What's with all the spacing changes in src/sage/rings/polynomial/plural.pyx
? Please don't do that. It's fine to do a few corrections nearby edits that you're making anyway, but changing a whole file for no reason isn't right.
comment:61 Changed 4 years ago by
And like I said on #17407, I would keep the doctests for the french_book
and just add the deprecation message.
comment:62 Changed 4 years ago by
 Commit changed from c0103274a38a2b37c187eb223bcecb76df615283 to 0d43d61df56f2e841f31ec985ba44361c951b573
Branch pushed to git repo; I updated commit sha1. New commits:
0d43d61  10483: oops, roll back unintended changes

comment:63 Changed 2 years ago by
 Commit changed from 0d43d61df56f2e841f31ec985ba44361c951b573 to 756cd6501269432e6308f7f7693a9f4d7461da6b
Branch pushed to git repo; I updated commit sha1. New commits:
756cd65  Merge branch 'develop' into t/10483/public/104833

comment:64 Changed 2 years ago by
 Milestone changed from sage6.4 to sage7.6
 Status changed from needs_work to needs_review
comment:65 Changed 2 years ago by
 Commit changed from 756cd6501269432e6308f7f7693a9f4d7461da6b to 31755f6d4838ee642965add2c48ed6f6fef51839
Branch pushed to git repo; I updated commit sha1. New commits:
31755f6  Merge branch 'develop' into t/10483/public/104833

comment:66 Changed 2 years ago by
 Status changed from needs_review to needs_work
Patchbot is not happy.
comment:67 Changed 2 years ago by
Also, there are some unintended files added. In order to clean up this mess, please squash and rebase.
comment:68 Changed 2 years ago by
 Branch changed from public/104833 to public/104834
comment:69 Changed 2 years ago by
 Commit changed from 31755f6d4838ee642965add2c48ed6f6fef51839 to 76f27e3477a06b448ff9ca03dae3b705e368a094
 Milestone changed from sage7.6 to sage8.0
 Status changed from needs_work to needs_review
New commits:
76f27e3  10483: Deprecate the misuse of symbolic variables as polynomial variable

comment:70 Changed 2 years ago by
 Commit changed from 76f27e3477a06b448ff9ca03dae3b705e368a094 to 946f9435e592c79150729c3de28e523cc8a29d7b
Branch pushed to git repo; I updated commit sha1. New commits:
946f943  10483: fix doctests

comment:71 Changed 23 months ago by
 Commit changed from 946f9435e592c79150729c3de28e523cc8a29d7b to 190391227d6129c50d82a10bf438f371c9c2c4e9
New commits:
1903912  Merge tag '8.0.beta12' into t/10483/public/104834

comment:74 Changed 23 months ago by
The very first file in the diff already has this problem:
diff git a/src/sage/categories/rings.py b/src/sage/categories/rings.py index 72c253a..27625b8 100644  a/src/sage/categories/rings.py +++ b/src/sage/categories/rings.py # 2. Otherwise, try to return a polynomial ring from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing  return PolynomialRing(self, elts) + return PolynomialRing(self, list(str(elt) for elt in elts))
comment:75 Changed 23 months ago by
 Commit changed from 190391227d6129c50d82a10bf438f371c9c2c4e9 to 3930917e0aad8cd3f62af6035eb0932311c1820d
Branch pushed to git repo; I updated commit sha1. New commits:
3930917  10483: fixes

comment:76 Changed 23 months ago by
My that was long ago. This commit is part of upcoming fixes, which leaves cfinite_sequence.py (much work, separate ticket if you insist on removing str()
), rings/polynomial/flatten.py where I have no idea how to fix, and symbolic/expression.pyx (tomorrow).
comment:77 Changed 23 months ago by
In src/sage/coding/linear_code.py
, I don't see why you have an explicit check. I would remove that and just let PolynomialRing()
raise the exception.
comment:78 Changed 23 months ago by
Note that basestring
does not exist in Python 3: use six.string_types
instead. In Cython code, basestring
is fine.
comment:79 followups: ↓ 80 ↓ 89 Changed 23 months ago by
The function PolynomialRing()
is really messy. It does too much checking which really should be delegated to normalize_names()
. I feel like it would be better to fix this first in a separate ticket. I'm willing to do this, but then this ticket would need to be rebased on that. I also think that the deprecation warning from this ticket should really be in normalize_names()
then. Thoughts?
comment:80 in reply to: ↑ 79 Changed 23 months ago by
Replying to jdemeyer:
I feel like it would be better to fix this first in a separate ticket. I'm willing to do this, but then this ticket would need to be rebased on that.
NP. Please go ahead.
comment:81 Changed 23 months ago by
 Commit changed from 3930917e0aad8cd3f62af6035eb0932311c1820d to a6374c814f3244f167c4e2bfb174f100007b7e3a
Branch pushed to git repo; I updated commit sha1. New commits:
a6374c8  10483: fixes

comment:82 Changed 23 months ago by
I wouldn't want to change anything in symbolic, after some thought.
comment:83 Changed 23 months ago by
OK, please stop working on this ticket for now. I will make some changes and split one or two tickets from this one.
comment:84 Changed 23 months ago by
 Commit changed from a6374c814f3244f167c4e2bfb174f100007b7e3a to 466e315e5496025ec65a2eb17201edc60f7c5de3
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
466e315  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:85 Changed 23 months ago by
 Commit changed from 466e315e5496025ec65a2eb17201edc60f7c5de3 to 4574f6633888af3f18e1b913553742ee6d16a21f
comment:86 Changed 23 months ago by
 Commit changed from 4574f6633888af3f18e1b913553742ee6d16a21f to 495642cf7b5401610ada90311c01f7e07bee8129
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
495642c  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:87 Changed 23 months ago by
First step: I moved some noncontroversial changes to a new ticket #23337. Those changes can be applied independently.
comment:88 Changed 23 months ago by
I'm still working on this, but I already have some comments:
src/sage/matrix/matrix2.pyx
:cyclic_subspace
is explicitly documented to support variables as argument.
src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
:smooth_critical_ideal
is explicitly documented to support variables as argument.
comment:89 in reply to: ↑ 79 ; followups: ↓ 90 ↓ 91 Changed 23 months ago by
Replying to jdemeyer:
The function
PolynomialRing()
is really messy. It does too much checking which really should be delegated tonormalize_names()
. I feel like it would be better to fix this first in a separate ticket. I'm willing to do this, but then this ticket would need to be rebased on that. I also think that the deprecation warning from this ticket should really be innormalize_names()
then. Thoughts?
From a somewhat quick look, it doesn't seem like it is doing so much what normalize_names()
is doing. Yes, some of it is there, but it also needs to know of what the input is before proceeding. So I don't see as good of a utility for normalize_names()
. However, I am willing to review any such ticket.
comment:90 in reply to: ↑ 89 Changed 23 months ago by
Replying to tscrim:
From a somewhat quick look, it doesn't seem like it is doing so much what
normalize_names()
is doing. Yes, some of it is there, but it also needs to know of what the input is before proceeding. So I don't see as good of a utility fornormalize_names()
. However, I am willing to review any such ticket.
It's not just normalize_names()
. It needs to be cleaned up in many ways. I opened #23338 and I'm working on that right now.
comment:91 in reply to: ↑ 89 Changed 23 months ago by
 Dependencies set to #23337, #23338
After working on #23338 a bit, it seems that the PolynomialRing()
constructor itself would not need to be changed in this ticket. I am using normalize_names()
to deal with parsing the variable names. So this ticket would need to change normalize_names()
instead of PolynomialRing()
.
comment:92 Changed 23 months ago by
 Commit changed from 495642cf7b5401610ada90311c01f7e07bee8129 to b9d365c77db5a504dd245bce2c7d2405aace0de8
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
b9d365c  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:93 Changed 23 months ago by
 Dependencies changed from #23337, #23338 to #23337, #23338, #23343
comment:94 Changed 23 months ago by
 Commit changed from b9d365c77db5a504dd245bce2c7d2405aace0de8 to 218e1521afa9e0174e7b4624c0830fe86e586c6f
comment:95 Changed 23 months ago by
 Dependencies changed from #23337, #23338, #23343 to #23337, #23338, #23343, #23377
comment:96 Changed 23 months ago by
 Commit changed from 218e1521afa9e0174e7b4624c0830fe86e586c6f to 41dcf096de137347253a517e7caabcdc7bdc5e61
comment:97 Changed 23 months ago by
 Dependencies changed from #23337, #23338, #23343, #23377 to #23337, #23338, #23343, #23377, #23378
comment:98 Changed 21 months ago by
 Commit changed from 41dcf096de137347253a517e7caabcdc7bdc5e61 to 000b9d13e56b5b6e3ca4895ca9c59a3a0a5faaa6
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
8108128  Clean up MPolynomialRing_generic.completion

92bafe2  Merge tag '8.1.beta2' into t/23377/clean_up_mpolynomialring_generic_completion

514ffff  Put deprecation in normalize_names() for nonstring variable names

000b9d1  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:99 Changed 21 months ago by
Rebased on top of #23377. This still needs work though, there are various failing doctests.
comment:100 Changed 21 months ago by
 Dependencies changed from #23337, #23338, #23343, #23377, #23378 to #23337, #23338, #23343, #23377
comment:101 Changed 21 months ago by
All doctest failures in src/sage/rings
:
sage t src/sage/rings/qqbar.py ********************************************************************** File "src/sage/rings/qqbar.py", line 3827, in sage.rings.qqbar.AlgebraicNumber_base.radical_expression Failed example: a = QQ[x](x^7  x  1).roots(AA, False)[0] Expected nothing Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.qqbar.AlgebraicNumber_base.radical_expression[3]>", line 1, in <module> a = QQ[x](x**Integer(7)  x  Integer(1)).roots(AA, False)[Integer(0)] File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/categories/rings.py", line 1075, in __getitem__ return PolynomialRing(self, elts) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/polynomial/polynomial_ring_constructor.py", line 583, in PolynomialRing names = normalize_names(n, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.symbolic.expression.Expression'> See http://trac.sagemath.org/10483 for details. ********************************************************************** 1 item had failures: 1 of 19 in sage.rings.qqbar.AlgebraicNumber_base.radical_expression [1395 tests, 1 failure, 10.66 s] sage t src/sage/rings/cfinite_sequence.py ********************************************************************** File "src/sage/rings/cfinite_sequence.py", line 17, in sage.rings.cfinite_sequence Failed example: fibo = CFiniteSequence(x/(1xx^2)) # the Fibonacci sequence Expected nothing Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.cfinite_sequence[0]>", line 1, in <module> fibo = CFiniteSequence(x/(Integer(1)xx**Integer(2))) # the Fibonacci sequence File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 329, in __classcall_private__ parent = CFiniteSequences(QQ, variables) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 170, in CFiniteSequences return CFiniteSequences_generic(polynomial_ring, category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/structure/unique_representation.py", line 1021, in __classcall__ instance = typecall(cls, *args, **options) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 933, in __init__ CommutativeRing.__init__(self,base_ring, self._polynomial_ring.gens(), category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'> See http://trac.sagemath.org/10483 for details. ********************************************************************** File "src/sage/rings/cfinite_sequence.py", line 35, in sage.rings.cfinite_sequence Failed example: CFiniteSequence(y/(1yy^2)) Expected: Cfinite sequence, generated by y/(y^2  y + 1) Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.cfinite_sequence[10]>", line 1, in <module> CFiniteSequence(y/(Integer(1)yy**Integer(2))) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 329, in __classcall_private__ parent = CFiniteSequences(QQ, variables) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 170, in CFiniteSequences return CFiniteSequences_generic(polynomial_ring, category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/structure/unique_representation.py", line 1021, in __classcall__ instance = typecall(cls, *args, **options) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 933, in __init__ CommutativeRing.__init__(self,base_ring, self._polynomial_ring.gens(), category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name y should be a string, not <type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'> See http://trac.sagemath.org/10483 for details. Cfinite sequence, generated by y/(y^2  y + 1) ********************************************************************** File "src/sage/rings/cfinite_sequence.py", line 212, in sage.rings.cfinite_sequence.CFiniteSequence Failed example: CFiniteSequence(1/(1X)) Expected: Cfinite sequence, generated by 1/(X + 1) Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.cfinite_sequence.CFiniteSequence[8]>", line 1, in <module> CFiniteSequence(Integer(1)/(Integer(1)X)) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 329, in __classcall_private__ parent = CFiniteSequences(QQ, variables) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 170, in CFiniteSequences return CFiniteSequences_generic(polynomial_ring, category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/structure/unique_representation.py", line 1021, in __classcall__ instance = typecall(cls, *args, **options) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 933, in __init__ CommutativeRing.__init__(self,base_ring, self._polynomial_ring.gens(), category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name X should be a string, not <type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'> See http://trac.sagemath.org/10483 for details. Cfinite sequence, generated by 1/(X + 1) ********************************************************************** File "src/sage/rings/cfinite_sequence.py", line 919, in sage.rings.cfinite_sequence.CFiniteSequences_generic.__init__ Failed example: C.<x> = CFiniteSequences(ZZ); C Expected: The ring of CFinite sequences in x over Integer Ring Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.cfinite_sequence.CFiniteSequences_generic.__init__[2]>", line 1, in <module> C = CFiniteSequences(ZZ, names=('x',)); (x,) = C._first_ngens(1); C File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 170, in CFiniteSequences return CFiniteSequences_generic(polynomial_ring, category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/structure/unique_representation.py", line 1021, in __classcall__ instance = typecall(cls, *args, **options) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/cfinite_sequence.py", line 933, in __init__ CommutativeRing.__init__(self,base_ring, self._polynomial_ring.gens(), category) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.rings.polynomial.polynomial_integer_dense_flint.Polynomial_integer_dense_flint'> See http://trac.sagemath.org/10483 for details. The ring of CFinite sequences in x over Integer Ring ********************************************************************** File "src/sage/rings/cfinite_sequence.py", line 1104, in sage.rings.cfinite_sequence.CFiniteSequences_generic._coerce_map_from_ Failed example: C.has_coerce_map_from(QQ[x]) Expected: True Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.cfinite_sequence.CFiniteSequences_generic._coerce_map_from_[3]>", line 1, in <module> C.has_coerce_map_from(QQ[x]) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/categories/rings.py", line 1075, in __getitem__ return PolynomialRing(self, elts) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/polynomial/polynomial_ring_constructor.py", line 583, in PolynomialRing names = normalize_names(n, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.rings.polynomial.polynomial_rational_flint.Polynomial_rational_flint'> See http://trac.sagemath.org/10483 for details. True ********************************************************************** 4 items had failures: 2 of 21 in sage.rings.cfinite_sequence 1 of 24 in sage.rings.cfinite_sequence.CFiniteSequence 1 of 6 in sage.rings.cfinite_sequence.CFiniteSequences_generic.__init__ 1 of 6 in sage.rings.cfinite_sequence.CFiniteSequences_generic._coerce_map_from_ [257 tests, 5 failures, 2.66 s] sage t src/sage/rings/polynomial/polynomial_ring.py ********************************************************************** File "src/sage/rings/polynomial/polynomial_ring.py", line 397, in sage.rings.polynomial.polynomial_ring.PolynomialRing_general.? Failed example: QQbar[x](x^6+x^5+x^4x^3+x^2x+2/5) Expected: x^6 + x^5 + x^4  x^3 + x^2  x + 2/5 Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.polynomial.polynomial_ring.PolynomialRing_general.?[33]>", line 1, in <module> QQbar[x](x**Integer(6)+x**Integer(5)+x**Integer(4)x**Integer(3)+x**Integer(2)x+Integer(2)/Integer(5)) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/categories/rings.py", line 1075, in __getitem__ return PolynomialRing(self, elts) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/polynomial/polynomial_ring_constructor.py", line 583, in PolynomialRing names = normalize_names(n, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.symbolic.expression.Expression'> See http://trac.sagemath.org/10483 for details. x^6 + x^5 + x^4  x^3 + x^2  x + 2/5 ********************************************************************** 1 item had failures: 1 of 35 in sage.rings.polynomial.polynomial_ring.PolynomialRing_general.? [416 tests, 1 failure, 1.94 s] sage t src/sage/rings/multi_power_series_ring_element.py ********************************************************************** File "src/sage/rings/multi_power_series_ring_element.py", line 1041, in sage.rings.multi_power_series_ring_element.MPowerSeries._l_action_ Failed example: g = f._l_action_(1/2); g Expected: 1/2 + 1/2*s + 1/2*t + 1/2*s*t + O(s, t)^3 Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.multi_power_series_ring_element.MPowerSeries._l_action_[2]>", line 1, in <module> g = f._l_action_(Integer(1)/Integer(2)); g File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/multi_power_series_ring_element.py", line 1062, in _l_action_ new_parent = PowerSeriesRing(f.base_ring().base_ring(), num_gens = f.base_ring().ngens(), names = f.base_ring().gens()) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/power_series_ring.py", line 338, in PowerSeriesRing order=order, default_prec=default_prec, sparse=sparse) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/power_series_ring.py", line 418, in _multi_variate names = normalize_names(num_gens, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name s should be a string, not <type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'> See http://trac.sagemath.org/10483 for details. doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.multi_power_series_ring_element.MPowerSeries._l_action_[2]>", line 1, in <module> g = f._l_action_(Integer(1)/Integer(2)); g File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/multi_power_series_ring_element.py", line 1062, in _l_action_ new_parent = PowerSeriesRing(f.base_ring().base_ring(), num_gens = f.base_ring().ngens(), names = f.base_ring().gens()) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/power_series_ring.py", line 338, in PowerSeriesRing order=order, default_prec=default_prec, sparse=sparse) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/power_series_ring.py", line 418, in _multi_variate names = normalize_names(num_gens, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name t should be a string, not <type 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'> See http://trac.sagemath.org/10483 for details. 1/2 + 1/2*s + 1/2*t + 1/2*s*t + O(s, t)^3 ********************************************************************** 1 item had failures: 1 of 10 in sage.rings.multi_power_series_ring_element.MPowerSeries._l_action_ [456 tests, 1 failure, 1.26 s] sage t src/sage/rings/polynomial/polynomial_ring_constructor.py ********************************************************************** File "src/sage/rings/polynomial/polynomial_ring_constructor.py", line 400, in sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing Failed example: PolynomialRing(ZZ, [x, singular]) Expected: Multivariate Polynomial Ring in x, Singular over Integer Ring Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing[62]>", line 1, in <module> PolynomialRing(ZZ, [x, singular]) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/polynomial/polynomial_ring_constructor.py", line 583, in PolynomialRing names = normalize_names(n, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.symbolic.expression.Expression'> See http://trac.sagemath.org/10483 for details. doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing[62]>", line 1, in <module> PolynomialRing(ZZ, [x, singular]) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/polynomial/polynomial_ring_constructor.py", line 583, in PolynomialRing names = normalize_names(n, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name Singular should be a string, not <class 'sage.interfaces.singular.Singular'> See http://trac.sagemath.org/10483 for details. Multivariate Polynomial Ring in x, Singular over Integer Ring ********************************************************************** File "src/sage/rings/polynomial/polynomial_ring_constructor.py", line 405, in sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing Failed example: B = PolynomialRing(ZZ, name=t) Expected nothing Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing[65]>", line 1, in <module> B = PolynomialRing(ZZ, name=t) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/polynomial/polynomial_ring_constructor.py", line 583, in PolynomialRing names = normalize_names(n, names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name t should be a string, not <type 'sage.symbolic.expression.Expression'> See http://trac.sagemath.org/10483 for details. ********************************************************************** 1 item had failures: 2 of 93 in sage.rings.polynomial.polynomial_ring_constructor.PolynomialRing [116 tests, 2 failures, 0.54 s] sage t src/sage/rings/multi_power_series_ring.py ********************************************************************** File "src/sage/rings/multi_power_series_ring.py", line 730, in sage.rings.multi_power_series_ring.MPowerSeriesRing_generic._coerce_map_from_ Failed example: M._coerce_map_from_(PowerSeriesRing(ZZ,x)) Expected: True Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.multi_power_series_ring.MPowerSeriesRing_generic._coerce_map_from_[12]>", line 1, in <module> M._coerce_map_from_(PowerSeriesRing(ZZ,x)) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/power_series_ring.py", line 374, in PowerSeriesRing name = normalize_names(1, name) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.symbolic.expression.Expression'> See http://trac.sagemath.org/10483 for details. True ********************************************************************** 1 item had failures: 1 of 25 in sage.rings.multi_power_series_ring.MPowerSeriesRing_generic._coerce_map_from_ [225 tests, 1 failure, 0.89 s] sage t src/sage/rings/quotient_ring.py ********************************************************************** File "src/sage/rings/quotient_ring.py", line 283, in sage.rings.quotient_ring.QuotientRing Failed example: Q = P.quotient(P*[a*b],[x,singular]) Expected: doctest:...: DeprecationWarning: Variable name 'x' should be a string, but we obtained <type 'sage.symbolic.expression.Expression'>. In an interactive session, you should use a definition of the form 'Q.<x,y,z>=R.quo(I)'. See http://trac.sagemath.org/10483 for details. ... Got: doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.quotient_ring.QuotientRing[43]>", line 1, in <module> Q = P.quotient(P*[a*b],[x,singular]) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/quotient_ring.py", line 307, in QuotientRing names = normalize_names(R.ngens(), names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name x should be a string, not <type 'sage.symbolic.expression.Expression'> See http://trac.sagemath.org/10483 for details. doctest:warning File "/usr/local/src/sageconfig/src/bin/sageruntests", line 98, in <module> err = DC.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 1150, in run self.run_doctests() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/control.py", line 874, in run_doctests self.dispatcher.dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1774, in dispatch self.parallel_dispatch() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1664, in parallel_dispatch w.start() # This might take some time File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1940, in start super(DocTestWorker, self).start() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 130, in start self._popen = Popen(self) File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/forking.py", line 126, in __init__ code = process_obj._bootstrap() File "/usr/local/src/sageconfig/local/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 1913, in run task(self.options, self.outtmpfile, msgpipe, self.result_queue) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 2215, in __call__ result = runner.run(test) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 660, in run return self._run(test, compileflags, out) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 515, in _run self.compile_and_execute(example, compiler, test.globs) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/doctest/forker.py", line 885, in compile_and_execute exec(compiled, globs) File "<doctest sage.rings.quotient_ring.QuotientRing[43]>", line 1, in <module> Q = P.quotient(P*[a*b],[x,singular]) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/rings/quotient_ring.py", line 307, in QuotientRing names = normalize_names(R.ngens(), names) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 101, in deprecation warning(trac_number, message, DeprecationWarning, stacklevel) File "/usr/local/src/sageconfig/local/lib/python2.7/sitepackages/sage/misc/superseded.py", line 142, in warning warn(message, warning_class, stacklevel) : DeprecationWarning: variable name Singular should be a string, not <class 'sage.interfaces.singular.Singular'> See http://trac.sagemath.org/10483 for details. ********************************************************************** 1 item had failures: 1 of 45 in sage.rings.quotient_ring.QuotientRing [284 tests, 1 failure, 0.87 s]  sage t src/sage/rings/qqbar.py # 1 doctest failed sage t src/sage/rings/cfinite_sequence.py # 5 doctests failed sage t src/sage/rings/polynomial/polynomial_ring.py # 1 doctest failed sage t src/sage/rings/multi_power_series_ring_element.py # 1 doctest failed sage t src/sage/rings/polynomial/polynomial_ring_constructor.py # 2 doctests failed sage t src/sage/rings/multi_power_series_ring.py # 1 doctest failed sage t src/sage/rings/quotient_ring.py # 1 doctest failed 
comment:102 Changed 21 months ago by
As discussed in some other ticket (I don't remember which), I want to require that names are of type str
, as opposed to six.string_types
which would include unicode
in Python 2. This is mainly to keep the code simpler and because I see no advantage to allowing both str
and unicode
on Python 2.
comment:103 Changed 21 months ago by
 Dependencies changed from #23337, #23338, #23343, #23377 to #23337, #23338, #23343, #23377, #23638
comment:104 Changed 21 months ago by
 Commit changed from 000b9d13e56b5b6e3ca4895ca9c59a3a0a5faaa6 to 43193750841c4caf509c9825afc72c398b6ef7b1
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
635b5f9  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

45b6e82  Minor fixes

bb7d9a8  Put deprecation in normalize_names() for nonstring variable names

4319375  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:105 Changed 21 months ago by
 Commit changed from 43193750841c4caf509c9825afc72c398b6ef7b1 to a0e35696c1c6e82575035e573ff726f9e81c3df8
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
139abc8  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

40f62c0  Minor fixes

51ba1df  Put deprecation in normalize_names() for nonstring variable names

a0e3569  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:106 Changed 21 months ago by
 Description modified (diff)
comment:107 Changed 21 months ago by
 Commit changed from a0e35696c1c6e82575035e573ff726f9e81c3df8 to 24e21d8ebe3e0d781f7775a17b9007faddac870e
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
24e21d8  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:108 Changed 21 months ago by
Since the deprecation has now moved to normalize_names
, I removed the added doctests in linear_code.py
and quotient_ring.py
which test the deprecation.
comment:109 Changed 21 months ago by
 Commit changed from 24e21d8ebe3e0d781f7775a17b9007faddac870e to 938beb01e0dd296790dc2748f99f0e5a0ed4ce26
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
938beb0  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:110 Changed 21 months ago by
 Dependencies changed from #23337, #23338, #23343, #23377, #23638 to #23337, #23338, #23343, #23377, #23638, #23640
New commits:
938beb0  Trac #10483: deprecate the misuse of symbolic variables as polynomial variable

comment:111 Changed 21 months ago by
I'm going to leave this ticket be for now. So, if other people want to fix things, please go ahead.
Now the patch is attached. By the way: It also adds some doctests...