Opened 11 months ago

Closed 3 months ago

#33093 closed defect (fixed)

5 doctests failing related to external program octave

Reported by: Sébastien Labbé Owned by:
Priority: major Milestone: sage-9.8
Component: packages: optional Keywords:
Cc: Merged in:
Authors: John Palmieri Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: cf9b1e6 (Commits, GitHub, GitLab) Commit: cf9b1e69faa1db451c19e47ae8160f641575f395
Dependencies: Stopgaps:

Status badges

Description

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.

Change History (9)

comment:1 Changed 10 months ago by Frédéric Chapoton

Milestone: sage-9.5sage-9.6

bump to 9.6

comment:2 Changed 7 months ago by Matthias Köppe

Milestone: sage-9.6sage-9.7

comment:3 Changed 3 months ago by John Palmieri

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.

Last edited 3 months ago by John Palmieri (previous) (diff)

comment:4 Changed 3 months ago by John Palmieri

Branch: u/jhpalmieri/octave-fixes

comment:5 Changed 3 months ago by John Palmieri

Authors: John Palmieri
Commit: cf9b1e69faa1db451c19e47ae8160f641575f395
Status: newneeds_review

Here is proposed fix.


New commits:

cf9b1e6trac 33093: fixes for octave interface

comment:6 Changed 3 months ago by Frédéric Chapoton

Reviewers: Frédéric Chapoton

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

comment:7 Changed 3 months ago by John Palmieri

Status: needs_reviewpositive_review

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.

comment:8 Changed 3 months ago by Matthias Köppe

Milestone: sage-9.7sage-9.8

comment:9 Changed 3 months ago by Volker Braun

Branch: u/jhpalmieri/octave-fixescf9b1e69faa1db451c19e47ae8160f641575f395
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.