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

5 doctests failing related to external program octave #33093

Closed
seblabbe opened this issue Dec 29, 2021 · 10 comments
Closed

5 doctests failing related to external program octave #33093

seblabbe opened this issue Dec 29, 2021 · 10 comments

Comments

@seblabbe
Copy link
Contributor

On Ubuntu 20.04 with 9.5.beta9 and GNU Octave, version 5.2.0, the command

sage -t --optional=sage,octave src/doc/en/constructions/linear_algebra.rst src/doc/en/developer/coding_in_other.rst src/sage/interfaces/octave.py

gives

Doctesting 3 files.
sage -t --random-seed=53840594329377719172370096027971271567 src/doc/en/constructions/linear_algebra.rst
**********************************************************************
File "src/doc/en/constructions/linear_algebra.rst", line 454, in doc.en.constructions.linear_algebra
Failed example:
    octave.solve_linear_system(A,b)    # optional - octave
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest doc.en.constructions.linear_algebra[4]>", line 1, in <module>
        octave.solve_linear_system(A,b)    # optional - octave
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/interfaces/octave.py", line 518, in solve_linear_system
        return eval(sol)
      File "<string>", line 1
        [-0.333333, 0.666667, 0,
                               ^
    SyntaxError: unexpected EOF while parsing
**********************************************************************
1 item had failures:
   1 of 115 in doc.en.constructions.linear_algebra
    [93 tests, 1 failure, 1.57 s]
sage -t --random-seed=53840594329377719172370096027971271567 src/doc/en/developer/coding_in_other.rst
**********************************************************************
File "src/doc/en/developer/coding_in_other.rst", line 721, in doc.en.developer.coding_in_other.solve_linear_system
Failed example:
    octave.solve_linear_system(A,b)    # optional - octave
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest doc.en.developer.coding_in_other.solve_linear_system[4]>", line 1, in <module>
        octave.solve_linear_system(A,b)    # optional - octave
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/interfaces/octave.py", line 518, in solve_linear_system
        return eval(sol)
      File "<string>", line 1
        [-0.333333, 0.666667, 0,
                               ^
    SyntaxError: unexpected EOF while parsing
**********************************************************************
1 item had failures:
   1 of   6 in doc.en.developer.coding_in_other.solve_linear_system
    [41 tests, 1 failure, 0.57 s]
sage -t --random-seed=53840594329377719172370096027971271567 src/sage/interfaces/octave.py
**********************************************************************
File "src/sage/interfaces/octave.py", line 158, in sage.interfaces.octave.Octave
Failed example:
    octave.eval("a = [ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]")    # optional - octave
Expected:
    'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n\n'
Got:
    'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n'
**********************************************************************
File "src/sage/interfaces/octave.py", line 160, in sage.interfaces.octave.Octave
Failed example:
    octave.eval("b = [ 1; 3; 13]")                         # optional - octave
Expected:
    'b =\n\n 1\n 3\n 13\n\n'
Got:
    'b =\n\n 1\n 3\n 13\n'
**********************************************************************
File "src/sage/interfaces/octave.py", line 495, in sage.interfaces.octave.Octave.solve_linear_system
Failed example:
    octave.solve_linear_system(A,b)    # optional - octave (and output is slightly random in low order bits)
Exception raised:
    Traceback (most recent call last):
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.interfaces.octave.Octave.solve_linear_system[4]>", line 1, in <module>
        octave.solve_linear_system(A,b)    # optional - octave (and output is slightly random in low order bits)
      File "/home/slabbe/GitBox/sage/local/lib/python3.8/site-packages/sage/interfaces/octave.py", line 518, in solve_linear_system
        return eval(sol)
      File "<string>", line 1
        [-0.333333, 0.666667, 0,
                               ^
    SyntaxError: unexpected EOF while parsing
**********************************************************************
2 items had failures:
   2 of   8 in sage.interfaces.octave.Octave
   1 of   6 in sage.interfaces.octave.Octave.solve_linear_system
    [132 tests, 3 failures, 1.06 s]
----------------------------------------------------------------------
sage -t --random-seed=53840594329377719172370096027971271567 src/doc/en/constructions/linear_algebra.rst  # 1 doctest failed
sage -t --random-seed=53840594329377719172370096027971271567 src/doc/en/developer/coding_in_other.rst  # 1 doctest failed
sage -t --random-seed=53840594329377719172370096027971271567 src/sage/interfaces/octave.py  # 3 doctests failed
----------------------------------------------------------------------

This is with:

$ octave --version
GNU Octave, version 5.2.0
Copyright (C) 2020 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at https://www.octave.org.

Please contribute if you find this software useful.
For more information, visit https://www.octave.org/get-involved.html

Read https://www.octave.org/bugs.html to learn how to submit bug reports.

A previous ticket about doctest failures with octave is #30636.

Component: packages: optional

Author: John Palmieri

Branch/Commit: cf9b1e6

Reviewer: Frédéric Chapoton

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

@fchapoton
Copy link
Contributor

comment:1

bump to 9.6

@fchapoton fchapoton modified the milestones: sage-9.5, sage-9.6 Jan 29, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@jhpalmieri
Copy link
Member

comment:3

Another octave issue: when octave is present on my OS X machine, if I run make ptestlong, then a file octave-workspace is created in SAGE_ROOT. I don't think this should happen. This could be fixed here or on a separate ticket.

@jhpalmieri
Copy link
Member

Branch: u/jhpalmieri/octave-fixes

@jhpalmieri
Copy link
Member

Author: John Palmieri

@jhpalmieri
Copy link
Member

Commit: cf9b1e6

@jhpalmieri
Copy link
Member

comment:5

Here is proposed fix.


New commits:

cf9b1e6trac 33093: fixes for octave interface

@fchapoton
Copy link
Contributor

comment:6

looks good. If this works for you, you can set to positive.

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@jhpalmieri
Copy link
Member

comment:7

Thank you. If anyone cares, they might make octave_workspace an argument to the __init__, but I think it is fine for it to be temporary.

@vbraun
Copy link
Member

vbraun commented Sep 20, 2022

Changed branch from u/jhpalmieri/octave-fixes to cf9b1e6

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

5 participants