14
14
15
15
import importlib
16
16
17
- from . import Feature , FeatureTestResult , PythonModule
17
+ from . import Executable , Feature , FeatureTestResult , PythonModule
18
18
19
19
20
20
class InterfaceFeature (Feature ):
@@ -37,7 +37,7 @@ class InterfaceFeature(Feature):
37
37
"Interface also_broken_interface cannot be imported: module 'sage.interfaces.interface' has no attribute 'also_broken_interface'"
38
38
"""
39
39
@staticmethod
40
- def __classcall__ (cls , name , module , description = None ):
40
+ def __classcall__ (cls , name , module , description = None , ** kwds ):
41
41
"""
42
42
TESTS::
43
43
@@ -49,9 +49,9 @@ def __classcall__(cls, name, module, description=None):
49
49
"""
50
50
if isinstance (module , str ):
51
51
module = PythonModule (module )
52
- return Feature .__classcall__ (cls , name , module , description )
52
+ return Feature .__classcall__ (cls , name , module , description , ** kwds )
53
53
54
- def __init__ (self , name , module , description ):
54
+ def __init__ (self , name , module , description , ** kwds ):
55
55
"""
56
56
TESTS::
57
57
@@ -60,7 +60,7 @@ def __init__(self, name, module, description):
60
60
sage: isinstance(f, InterfaceFeature)
61
61
True
62
62
"""
63
- super ().__init__ (name , description = description )
63
+ super ().__init__ (name , description = description , ** kwds )
64
64
self .module = module
65
65
66
66
def _is_present (self ):
@@ -90,6 +90,38 @@ def _is_present(self):
90
90
reason = f"Interface { interface } is not functional: { exception } " )
91
91
92
92
93
+ class FriCASExecutable (Executable ):
94
+ r"""
95
+ A :class:`~sage.features.Feature` describing whether :class:`sage.interfaces.fricas.FriCAS`
96
+ is present and functional.
97
+
98
+ EXAMPLES::
99
+
100
+ sage: from sage.features.interfaces import FriCASExecutable
101
+ sage: FriCASExecutable().is_present() # random
102
+ FeatureTestResult('fricas_exe', False)
103
+ """
104
+ @staticmethod
105
+ def __classcall__ (cls ):
106
+ return Executable .__classcall__ (cls , 'fricas_exe' , 'fricas' , spkg = 'fricas' )
107
+
108
+
109
+ class FriCAS (InterfaceFeature ):
110
+ r"""
111
+ A :class:`~sage.features.Feature` describing whether :class:`sage.interfaces.fricas.FriCAS`
112
+ is present and functional.
113
+
114
+ EXAMPLES::
115
+
116
+ sage: from sage.features.interfaces import FriCAS
117
+ sage: FriCAS().is_present() # random
118
+ FeatureTestResult('fricas', False)
119
+ """
120
+ @staticmethod
121
+ def __classcall__ (cls ):
122
+ return InterfaceFeature .__classcall__ (cls , 'fricas' , 'sage.interfaces.fricas' , spkg = 'fricas' )
123
+
124
+
93
125
# The following are provided by external software only (no SPKG)
94
126
95
127
class Magma (InterfaceFeature ):
@@ -219,15 +251,17 @@ def all_features():
219
251
220
252
sage: from sage.features.interfaces import all_features
221
253
sage: list(all_features())
222
- [Feature('magma'),
254
+ [Feature('fricas'),
255
+ Feature('magma'),
223
256
Feature('matlab'),
224
257
Feature('mathematica'),
225
258
Feature('maple'),
226
259
Feature('macaulay2'),
227
260
Feature('octave'),
228
261
Feature('scilab')]
229
262
"""
230
- return [Magma (),
263
+ return [FriCAS (),
264
+ Magma (),
231
265
Matlab (),
232
266
Mathematica (),
233
267
Maple (),
0 commit comments