src/sage/structure/sequence.py: skip fewer cases when pbori is missing#41539
src/sage/structure/sequence.py: skip fewer cases when pbori is missing#41539vbraun merged 1 commit intosagemath:developfrom
Conversation
|
Can be reproduced/tested by passing |
|
Documentation preview for this PR (built with commit 7615d58; changes) is ready! 🎉 |
63c0156 to
d381c76
Compare
When the (optional) sage.rings.polynomial.pbori.pbori fails to import,
one of the cases in the Sequence() constructor is skipped, leading to
certain polynomial sequences being returned as generic sequences
instead of polynomial ones. In one egregious case, this causes a
multivariate polynomial sequence with 324 elements to be printed to
the screen rather than the short description that is intended:
File "...multi_polynomial_libsingular.pyx", line 4790...
Failed example:
f.lift(I)
Expected:
Polynomial Sequence with 324 Polynomials in 2 Variables
Got:
[0,
0,
0,
0,
0, ...
We fix this by handling the (failure of the) pbori import separately,
keeping the rest of the special case for polynomial sequences.
d381c76 to
7615d58
Compare
|
@kiwifb can I borrow you for a second as the de-facto brial person? This diff is confusing, but all it does is move something important out of the |
|
Yes, it seems keeping the try block minimal and not throwing the stuff you would need anyway looks much cleaner. But the other bits are interesting. You get rid of the else alternative and you alias the method you can't import to a generic one. |
This was a trick to keep the existing conditional working without having to add cases. By setting The name |
sagemathgh-41539: src/sage/structure/sequence.py: skip fewer cases when pbori is missing When the (optional) `sage.rings.polynomial.pbori.pbori` fails to import, one of the cases in the `Sequence()` constructor is skipped, leading to certain polynomial sequences being returned as generic sequences instead of polynomial ones. In one egregious case, this causes a multivariate polynomial sequence with 324 elements to be printed to the screen rather than the short description that is intended: ``` File "...multi_polynomial_libsingular.pyx", line 4790... Failed example: f.lift(I) Expected: Polynomial Sequence with 324 Polynomials in 2 Variables Got: [0, 0, 0, 0, 0, ... ``` We fix this by handling the (failure of the) pbori import separately, keeping the rest of the special case for polynomial sequences. URL: sagemath#41539 Reported by: Michael Orlitzky Reviewer(s): François Bissey
sagemathgh-41539: src/sage/structure/sequence.py: skip fewer cases when pbori is missing When the (optional) `sage.rings.polynomial.pbori.pbori` fails to import, one of the cases in the `Sequence()` constructor is skipped, leading to certain polynomial sequences being returned as generic sequences instead of polynomial ones. In one egregious case, this causes a multivariate polynomial sequence with 324 elements to be printed to the screen rather than the short description that is intended: ``` File "...multi_polynomial_libsingular.pyx", line 4790... Failed example: f.lift(I) Expected: Polynomial Sequence with 324 Polynomials in 2 Variables Got: [0, 0, 0, 0, 0, ... ``` We fix this by handling the (failure of the) pbori import separately, keeping the rest of the special case for polynomial sequences. URL: sagemath#41539 Reported by: Michael Orlitzky Reviewer(s): François Bissey
sagemathgh-41539: src/sage/structure/sequence.py: skip fewer cases when pbori is missing When the (optional) `sage.rings.polynomial.pbori.pbori` fails to import, one of the cases in the `Sequence()` constructor is skipped, leading to certain polynomial sequences being returned as generic sequences instead of polynomial ones. In one egregious case, this causes a multivariate polynomial sequence with 324 elements to be printed to the screen rather than the short description that is intended: ``` File "...multi_polynomial_libsingular.pyx", line 4790... Failed example: f.lift(I) Expected: Polynomial Sequence with 324 Polynomials in 2 Variables Got: [0, 0, 0, 0, 0, ... ``` We fix this by handling the (failure of the) pbori import separately, keeping the rest of the special case for polynomial sequences. URL: sagemath#41539 Reported by: Michael Orlitzky Reviewer(s): François Bissey
sagemathgh-41539: src/sage/structure/sequence.py: skip fewer cases when pbori is missing When the (optional) `sage.rings.polynomial.pbori.pbori` fails to import, one of the cases in the `Sequence()` constructor is skipped, leading to certain polynomial sequences being returned as generic sequences instead of polynomial ones. In one egregious case, this causes a multivariate polynomial sequence with 324 elements to be printed to the screen rather than the short description that is intended: ``` File "...multi_polynomial_libsingular.pyx", line 4790... Failed example: f.lift(I) Expected: Polynomial Sequence with 324 Polynomials in 2 Variables Got: [0, 0, 0, 0, 0, ... ``` We fix this by handling the (failure of the) pbori import separately, keeping the rest of the special case for polynomial sequences. URL: sagemath#41539 Reported by: Michael Orlitzky Reviewer(s): François Bissey
When the (optional)
sage.rings.polynomial.pbori.pborifails to import, one of the cases in theSequence()constructor is skipped, leading to certain polynomial sequences being returned as generic sequences instead of polynomial ones. In one egregious case, this causes a multivariate polynomial sequence with 324 elements to be printed to the screen rather than the short description that is intended:We fix this by handling the (failure of the) pbori import separately, keeping the rest of the special case for polynomial sequences.