Join features#
- class sage.features.join_feature.JoinFeature(*args, **kwds)#
Bases:
Feature
Join of several
Feature
instances.This creates a new feature as the union of the given features. Typically these are executables of an SPKG. For an example, see
Rubiks
.Furthermore, this can be the union of a single feature. This is used to map the given feature to a more convenient name to be used in
optional
tags of doctests. Thus you can equip a feature such as aPythonModule
with a tag name that differs from the systematic tag name. As an example for this use case, seeMeataxe
.EXAMPLES:
sage: from sage.features import Executable sage: from sage.features.join_feature import JoinFeature sage: F = JoinFeature("shell-boolean", ....: (Executable('shell-true', 'true'), ....: Executable('shell-false', 'false'))) sage: F.is_present() FeatureTestResult('shell-boolean', True) sage: F = JoinFeature("asdfghjkl", ....: (Executable('shell-true', 'true'), ....: Executable('xxyyyy', 'xxyyyy-does-not-exist'))) sage: F.is_present() FeatureTestResult('xxyyyy', False)
- hide()#
Hide this feature and all its joined features.
EXAMPLES:
sage: from sage.features.sagemath import sage__groups sage: f = sage__groups() sage: f.hide() sage: f._features[0].is_present() FeatureTestResult('sage.groups.perm_gps.permgroup', False) sage: f.require() Traceback (most recent call last): ... FeatureNotPresentError: sage.groups is not available. Feature `sage.groups` is hidden. Use method `unhide` to make it available again.
- is_functional()#
Test whether the join feature is functional.
This method is deprecated. Use
Feature.is_present()
instead.EXAMPLES:
sage: from sage.features.latte import Latte sage: Latte().is_functional() # optional - latte_int doctest:warning... DeprecationWarning: method JoinFeature.is_functional; use is_present instead See https://github.com/sagemath/sage/issues/33114 for details. FeatureTestResult('latte_int', True)
- unhide()#
Revert what
hide()
does.EXAMPLES:
sage: from sage.features.sagemath import sage__groups sage: f = sage__groups() sage: f.hide() sage: f.is_present() FeatureTestResult('sage.groups', False) sage: f._features[0].is_present() FeatureTestResult('sage.groups.perm_gps.permgroup', False) sage: f.unhide() sage: f.is_present() # optional sage.groups FeatureTestResult('sage.groups', True) sage: f._features[0].is_present() # optional sage.groups FeatureTestResult('sage.groups.perm_gps.permgroup', True)