Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doctesting mangles long lines #26924

Closed
dimpase opened this issue Dec 20, 2018 · 2 comments
Closed

doctesting mangles long lines #26924

dimpase opened this issue Dec 20, 2018 · 2 comments

Comments

@dimpase
Copy link
Member

dimpase commented Dec 20, 2018

while working on #26856, we observed

File "src/sage/algebras/quantum_groups/quantum_group_gap.py", line 757, in sage.algebras.quantum_groups.quantum_group_gap.QuantumGroup.coproduct
Failed example:
    [Q.coproduct(f, 2) for f in Q.F_simple()]  # optional - gap_packages
Expected:
    [1*(1<x>1<x>F[a1]) + -q^2 + q^-2*(1<x>F[a1]<x>[ K1 ; 1 ])
      + 1*(1<x>F[a1]<x>K1) + q^4-2 + q^-4*(F[a1]<x>[ K1 ; 1 ]<x>[ K1 ; 1 ])
      + -q^2 + q^-2*(F[a1]<x>[ K1 ; 1 ]<x>K1) + -q^2
      + q^-2*(F[a1]<x>K1<x>[ K1 ; 1 ]) + 1*(F[a1]<x>K1<x>K1),
     1*(1<x>1<x>F[a2]) + -q + q^-1*(1<x>F[a2]<x>[ K2 ; 1 ])
      + 1*(1<x>F[a2]<x>K2) + q^2-2 + q^-2*(F[a2]<x>[ K2 ; 1 ]<x>[ K2 ; 1 ])
      + -q + q^-1*(F[a2]<x>[ K2 ; 1 ]<x>K2) + -q
      + q^-1*(F[a2]<x>K2<x>[ K2 ; 1 ]) + 1*(F[a2]<x>K2<x>K2)]
Got:
    [1*(1<x>1<x>F[a1]) + -q^2 + q^-2*(1<x>F[a1]<x>[ K1 ; 1 ]) + 1*(1<x>F[a1]<x>K1) + q^4-2 + q^-4*(F
     1<x>[ K1 ; 1 ]<x>[ K1 ; 1 ]) + -q^2 + q^-2*(F[a1]<x>[ K1 ; 1 ]<x>K1) + -q^2 + q^-2*(F
     1<x>K1<x>[ K1 ; 1 ]) + 1*(F[a1]<x>K1<x>K1),
     1*(1<x>1<x>F[a2]) + -q + q^-1*(1<x>F[a2]<x>[ K2 ; 1 ]) + 1*(1<x>F[a2]<x>K2) + q^2-2 + q^-2*(F
     4<x>[ K2 ; 1 ]<x>[ K2 ; 1 ]) + -q + q^-1*(F[a2]<x>[ K2 ; 1 ]<x>K2) + -q + q^-1*(F[a2]<x>K
     2<x>[ K2 ; 1 ]) + 1*(F[a2]<x>K2<x>K2)]

so some patters such as F[a1] get mangled.

See comment 40 on #26856 on how it looks if the output is LaTeXified, one sees \n getting in.

Component: interfaces

Issue created by migration from https://trac.sagemath.org/ticket/26924

@dimpase dimpase added this to the sage-8.6 milestone Dec 20, 2018
@embray
Copy link
Contributor

embray commented Dec 20, 2018

comment:1

I have my doubts about this, but it's not inconceivable. Like you said, it's such a noisy line I wonder if there are some false positives, e.g. from some of the doctest fixups for Python 2/3 compatibility, or something along those lines. I'll look into it.

@embray
Copy link
Contributor

embray commented Dec 28, 2018

comment:2

This was fixed in #26856, specifically by d0b769d6. The problem was not in the doctest framework per se, but rather with how print representations of GAP objects were being captured, with GAP's automatic line breaking in effect.

We haven't fixed the problem 100%, because GAP may still insert unwanted line breaks in extreme cases where a line of output is > 4096 bytes. A better solution would be to have a flag (I think --norepl should do this) to disable GAP's automatic line breaking entirely. But that's a fix needed upstream.

@embray embray removed this from the sage-8.6 milestone Dec 28, 2018
@embray embray closed this as completed Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants