Detecting external software¶
This module makes up a list of external software that Sage interfaces. Availability of each software is tested only when necessary. This is mainly used for the doctests which require certain external software installed on the system.
Even though the functions in this module should also work when an external software is not present, most doctests in this module are only tested if testing of external software is explicitly enabled in order to avoid invoking external software otherwise. See trac ticket #28819 for details.
AUTHORS:
Kwankyu Lee (2016-03-09) – initial version, based on code by Robert Bradshaw and Nathann Cohen
-
class
sage.doctest.external.
AvailableSoftware
¶ Bases:
object
This class keeps the set of available software whose availability is detected lazily from the list of external software.
EXAMPLES:
sage: from sage.doctest.external import external_software, available_software sage: external_software ['cplex', 'ffmpeg', 'graphviz', 'gurobi', 'imagemagick', 'internet', 'latex', 'macaulay2', 'magma', 'maple', 'mathematica', 'matlab', 'octave', 'pandoc', 'rubiks', 'scilab'] sage: 'internet' in available_software # random, optional - internet True sage: available_software.issuperset(set(['internet','latex'])) # random, optional - internet latex True
-
issuperset
(other)¶ Return
True
ifother
is a subset ofself
.EXAMPLES:
sage: from sage.doctest.external import available_software sage: available_software.issuperset(set(['internet','latex','magma'])) # random, optional - internet latex magma True
-
seen
()¶ Return the list of detected external software.
EXAMPLES:
sage: from sage.doctest.external import available_software sage: available_software.seen() # random ['internet', 'latex', 'magma']
-
-
sage.doctest.external.
has_cplex
()¶ Test if CPLEX is available.
EXAMPLES:
sage: from sage.doctest.external import has_cplex sage: has_cplex() # random, optional - CPLEX True
-
sage.doctest.external.
has_ffmpeg
()¶ Test if ffmpeg is available.
EXAMPLES:
sage: from sage.doctest.external import has_ffmpeg sage: has_ffmpeg() # optional -- ffmpeg FeatureTestResult('FFmpeg', True)
-
sage.doctest.external.
has_graphviz
()¶ Test if graphviz (dot, twopi, neato) are available.
EXAMPLES:
sage: from sage.doctest.external import has_graphviz sage: has_graphviz() # optional -- graphviz FeatureTestResult('Graphviz', True)
-
sage.doctest.external.
has_gurobi
()¶ Test if Gurobi is available.
EXAMPLES:
sage: from sage.doctest.external import has_gurobi sage: has_gurobi() # random, optional - Gurobi True
-
sage.doctest.external.
has_imagemagick
()¶ Test if ImageMagick (command convert) is available.
EXAMPLES:
sage: from sage.doctest.external import has_imagemagick sage: has_imagemagick() # optional -- imagemagick FeatureTestResult('convert', True)
-
sage.doctest.external.
has_internet
()¶ Test if Internet is available.
Failure of connecting to the site “http://www.sagemath.org” within a second is regarded as internet being not available.
EXAMPLES:
sage: from sage.doctest.external import has_internet sage: has_internet() # random, optional -- internet True
-
sage.doctest.external.
has_latex
()¶ Test if Latex is available.
EXAMPLES:
sage: from sage.doctest.external import has_latex sage: has_latex() # random, optional - latex True
-
sage.doctest.external.
has_macaulay2
()¶ Test if Macaulay2 is available.
EXAMPLES:
sage: from sage.doctest.external import has_macaulay2 sage: has_macaulay2() # random, optional - macaulay2 True
-
sage.doctest.external.
has_magma
()¶ Test if Magma is available.
EXAMPLES:
sage: from sage.doctest.external import has_magma sage: has_magma() # random, optional - magma True
-
sage.doctest.external.
has_maple
()¶ Test if Maple is available.
EXAMPLES:
sage: from sage.doctest.external import has_maple sage: has_maple() # random, optional - maple True
-
sage.doctest.external.
has_mathematica
()¶ Test if Mathematica is available.
EXAMPLES:
sage: from sage.doctest.external import has_mathematica sage: has_mathematica() # random, optional - mathematica True
-
sage.doctest.external.
has_matlab
()¶ Test if Matlab is available.
EXAMPLES:
sage: from sage.doctest.external import has_matlab sage: has_matlab() # random, optional - matlab True
-
sage.doctest.external.
has_octave
()¶ Test if Octave is available.
EXAMPLES:
sage: from sage.doctest.external import has_octave sage: has_octave() # random, optional - octave True
-
sage.doctest.external.
has_pandoc
()¶ Test if pandoc is available.
EXAMPLES:
sage: from sage.doctest.external import has_pandoc sage: has_pandoc() # optional -- pandoc FeatureTestResult('Pandoc', True)
-
sage.doctest.external.
has_rubiks
()¶ Test if the rubiks package (
cu2
,cubex
,dikcube
,mcube
,optimal
, andsize222
) is available.EXAMPLES:
sage: from sage.doctest.external import has_rubiks sage: has_rubiks() # optional -- rubiks FeatureTestResult('Rubiks', True)
-
sage.doctest.external.
has_scilab
()¶ Test if Scilab is available.
EXAMPLES:
sage: from sage.doctest.external import has_scilab sage: has_scilab() # random, optional - scilab True