Skip to content

Commit

Permalink
Trac #34607: 2 doctests failures with external software octave
Browse files Browse the repository at this point in the history
With 9.8.beta0, the command
{{{
sage -t --optional=sage,external src/sage/interfaces/octave.py
}}}

gives
{{{
Using --optional=external,sage
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,
cplex,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,data
base_cubic_hecke,database_jones_numfield,database_knotinfo,dvipng,ffmpeg
,gfan,graphviz,gurobi,imagemagick,internet,jupymake,kenzo,latex,latex_pa
ckage_tkz_graph,latte_int,lrslib,lualatex,macaulay2,magma,maple,mathemat
ica,matlab,mcqd,meataxe,msolve,nauty,octave,palp,pandoc,pdf2svg,pdflatex
,pdftocairo,phitigra,plantri,polytopes_db,polytopes_db_4d,pynormaliz,pyt
hon_igraph,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sag
e.groups,sage.misc.cython,sage.plot,sage.rings.number_field,sage.rings.p
adics,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,
sagemath_doc_html,scilab,sphinx,tdlib,xelatex
Doctesting 1 file.
sage -t --random-seed=300683574861759875953529709931492404030
src/sage/interfaces/octave.py
**********************************************************************
File "src/sage/interfaces/octave.py", line 159, 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'
Got:
    'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n\n'
**********************************************************************
File "src/sage/interfaces/octave.py", line 161, 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'
Got:
    'b =\n\n 1\n 3\n 13\n\n'
**********************************************************************
1 item had failures:
   2 of   8 in sage.interfaces.octave.Octave
    [132 tests, 2 failures, 0.77 s]
----------------------------------------------------------------------
sage -t --random-seed=300683574861759875953529709931492404030
src/sage/interfaces/octave.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 0.9 seconds
    cpu time: 0.3 seconds
    cumulative wall time: 0.8 seconds
Features detected for doctesting: octave
}}}

The octave on the machine is:
{{{
$ octave --version
octave: X11 DISPLAY environment variable not set
octave: disabling GUI features
GNU Octave, version 4.2.2
Copyright (C) 2018 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
http://www.octave.org.

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

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

A recent ticket also fixing octave doctests failures is #33093

URL: https://trac.sagemath.org/34607
Reported by: slabbe
Ticket author(s): Sébastien Labbé
Reviewer(s): John Palmieri
  • Loading branch information
Release Manager committed Oct 11, 2022
2 parents 792d877 + d46a7fc commit f1d4c32
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/sage/interfaces/octave.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,17 @@ class Octave(Expect):
EXAMPLES::
sage: octave.eval("a = [ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]") # optional - octave
'a =\n\n 1 1 2\n 3 5 8\n 13 21 33\n'
sage: octave.eval("b = [ 1; 3; 13]") # optional - octave
'b =\n\n 1\n 3\n 13\n'
sage: octave.eval(r"c=a \ b") # solves linear equation: a*c = b # optional - octave; random output
'c =\n\n 1\n 7.21645e-16\n -7.21645e-16\n'
sage: octave.eval("c") # optional - octave; random output
'c =\n\n 1\n 7.21645e-16\n -7.21645e-16\n'
sage: octave.eval("a = [ 1, 1, 2; 3, 5, 8; 13, 21, 33 ]").strip() # optional - octave
'a =\n\n 1 1 2\n 3 5 8\n 13 21 33'
sage: octave.eval("b = [ 1; 3; 13]").strip() # optional - octave
'b =\n\n 1\n 3\n 13'
The following solves the linear equation: a*c = b::
sage: octave.eval(r"c=a \ b").strip() # optional - octave # abs tol 0.01
'c =\n\n 1\n -0\n 0'
sage: octave.eval("c").strip() # optional - octave # abs tol 0.01
'c =\n\n 1\n -0\n 0'
TESTS:
Expand Down

0 comments on commit f1d4c32

Please sign in to comment.