3
3
"""
4
4
import importlib
5
5
6
- from . import Feature , FeatureTestResult , PythonModule
6
+ from . import Executable , Feature , FeatureTestResult , PythonModule
7
7
8
8
9
9
class InterfaceFeature (Feature ):
@@ -26,7 +26,7 @@ class InterfaceFeature(Feature):
26
26
"Interface also_broken_interface cannot be imported: module 'sage.interfaces.interface' has no attribute 'also_broken_interface'"
27
27
"""
28
28
@staticmethod
29
- def __classcall__ (cls , name , module , description = None ):
29
+ def __classcall__ (cls , name , module , description = None , ** kwds ):
30
30
"""
31
31
TESTS::
32
32
@@ -38,9 +38,9 @@ def __classcall__(cls, name, module, description=None):
38
38
"""
39
39
if isinstance (module , str ):
40
40
module = PythonModule (module )
41
- return Feature .__classcall__ (cls , name , module , description )
41
+ return Feature .__classcall__ (cls , name , module , description , ** kwds )
42
42
43
- def __init__ (self , name , module , description ):
43
+ def __init__ (self , name , module , description , ** kwds ):
44
44
"""
45
45
TESTS::
46
46
@@ -49,7 +49,7 @@ def __init__(self, name, module, description):
49
49
sage: isinstance(f, InterfaceFeature)
50
50
True
51
51
"""
52
- super ().__init__ (name , description = description )
52
+ super ().__init__ (name , description = description , ** kwds )
53
53
self .module = module
54
54
55
55
def _is_present (self ):
@@ -79,6 +79,38 @@ def _is_present(self):
79
79
reason = f"Interface { interface } is not functional: { exception } " )
80
80
81
81
82
+ class FriCASExecutable (Executable ):
83
+ r"""
84
+ A :class:`~sage.features.Feature` describing whether :class:`sage.interfaces.fricas.FriCAS`
85
+ is present and functional.
86
+
87
+ EXAMPLES::
88
+
89
+ sage: from sage.features.interfaces import FriCASExecutable
90
+ sage: FriCASExecutable().is_present() # random
91
+ FeatureTestResult('fricas_exe', False)
92
+ """
93
+ @staticmethod
94
+ def __classcall__ (cls ):
95
+ return Executable .__classcall__ (cls , 'fricas_exe' , 'fricas' , spkg = 'fricas' )
96
+
97
+
98
+ class FriCAS (InterfaceFeature ):
99
+ r"""
100
+ A :class:`~sage.features.Feature` describing whether :class:`sage.interfaces.fricas.FriCAS`
101
+ is present and functional.
102
+
103
+ EXAMPLES::
104
+
105
+ sage: from sage.features.interfaces import FriCAS
106
+ sage: FriCAS().is_present() # random
107
+ FeatureTestResult('fricas', False)
108
+ """
109
+ @staticmethod
110
+ def __classcall__ (cls ):
111
+ return InterfaceFeature .__classcall__ (cls , 'fricas' , 'sage.interfaces.fricas' , spkg = 'fricas' )
112
+
113
+
82
114
# The following are provided by external software only (no SPKG)
83
115
84
116
class Magma (InterfaceFeature ):
@@ -208,15 +240,17 @@ def all_features():
208
240
209
241
sage: from sage.features.interfaces import all_features
210
242
sage: list(all_features())
211
- [Feature('magma'),
243
+ [Feature('fricas'),
244
+ Feature('magma'),
212
245
Feature('matlab'),
213
246
Feature('mathematica'),
214
247
Feature('maple'),
215
248
Feature('macaulay2'),
216
249
Feature('octave'),
217
250
Feature('scilab')]
218
251
"""
219
- return [Magma (),
252
+ return [FriCAS (),
253
+ Magma (),
220
254
Matlab (),
221
255
Mathematica (),
222
256
Maple (),
0 commit comments