Closed jdemeyer closed 6 years ago
Trivial thing, but can we break this output line since it is so long:
ValueError: domain (Full MatrixSpace of 2 by 2 dense matrices over Univariate Polynomial Ring in x over Integer Ring)
and codomain (Univariate Polynomial Ring in t over Univariate Polynomial Ring in x over Integer Ring)
must have the same functorial construction over their base rings
Otherwise LGTM and you can set a positive review on my behalf.
Replying to @tscrim:
Trivial thing, but can we break this output line since it is so long
Shouldn't the output in doctests match the actual output from the terminal? If the actual output is one long line, shouldn't the doctest reflect that?
If you insist, I will change it though.
Replying to @jdemeyer:
Replying to @tscrim:
Trivial thing, but can we break this output line since it is so long
Shouldn't the output in doctests match the actual output from the terminal? If the actual output is one long line, shouldn't the doctest reflect that?
If you insist, I will change it though.
My usually 90 char wide terminal splits it (essentially randomly) and we have the guideline of 80 char/line in documentation. So with that in mind, I was suggesting the most logical places to split that and keep the lines short. If you would rather leave it as one really (really) long line, then I won't insist, but it makes it much more manageable for me and is in the spirit of the rest of Sage's doc. (I would also not oppose a strict 80 char/line cuts as well.)
Replying to @tscrim:
and we have the guideline of 80 char/line in documentation.
In my mind, there is a difference between the different parts of the documentation:
textual documentation: word wrap as usual
code in EXAMPLES: follow PEP 8, which means trying to limit the line lengths
output in EXAMPLES: I think it is best to keep the exact formatting of the output and not randomly wrap lines.
The problem is it is so ugly on my screen that I cannot read it at once with my default settings. IMO, there is no benefit in keeping it "exactly" (where I would say that is not completely accurate with how terminals can wrap) in the doc without some breaks (in this case, I think they are logical). Although this is effectively bikeshedding, and I don't care enough to die on this hill.
sage -t --long --warn-long 65.5 src/sage/rings/morphism.pyx
**********************************************************************
File "src/sage/rings/morphism.pyx", line 361, in sage.rings.morphism
Failed example:
phi3 = RingHomomorphism_from_base(H, R.hom([x])); phi3
Expected:
Ring endomorphism of Univariate Quotient Polynomial Ring in a over Finite Field of size 2 with modulus x^2 + x + 1
Defn: Induced from base ring by
Ring endomorphism of Univariate Polynomial Ring in x over Finite Field of size 2 (using NTL)
Defn: x |--> x
Got:
Ring endomorphism of Univariate Quotient Polynomial Ring in a over Finite Field of size 2 with modulus x^2 + x + 1
Defn: Induced from base ring by
Ring endomorphism of Univariate Polynomial Ring in x over Finite Field of size 2 (using GF2X)
Defn: x |--> x
**********************************************************************
Jeroen, will you update the output here, or should I do it?
I forgot about this ticket. If you can update it, please do.
Updated.
New commits:
ad3118f | Merge branch 'u/jdemeyer/allow__generic__polynomialring_implementation' of git://trac.sagemath.org/sage into u/tscrim/generic_polynomialring_implementation-24264 |
Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:
0efda1b | Fixing doctest output in morphism.pyx. |
Commit, then push. :p
Changed branch from u/tscrim/generic_polynomialring_implementation-24264 to 0efda1b
It is possible to specify a specific backend like
PolynomialRing(QQ, 'x', implementation="singular")
but the opposite (asking for a generic Sage implementation) is not. Fix this by allowingimplementation="generic"
.This requires various fixes involving the
implementation
keyword being ignored or breaking caching. In particular, we fix this caching bug:We also introduce a new implementation "GF2X" for the GF2X package. This used be called "NTL" which we still allow as alias.
CC: @embray @tscrim
Component: basic arithmetic
Author: Jeroen Demeyer
Branch/Commit:
0efda1b
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/24264