Enumeration of all defined features#
- sage.features.all.all_features()[source]#
Return an iterable of all features.
EXAMPLES:
sage: from sage.features.all import all_features sage: sorted(all_features(), key=lambda f: f.name) # random [...Feature('sage.combinat')...]
>>> from sage.all import * >>> from sage.features.all import all_features >>> sorted(all_features(), key=lambda f: f.name) # random [...Feature('sage.combinat')...]
- sage.features.all.module_feature(module_name)[source]#
Find a top-level
Feature
that provides the Python module of the givenmodule_name
.Only features known to
all_features()
are considered.INPUT:
module_name
– string
OUTPUT: a
Feature
orNone
.EXAMPLES:
sage: from sage.features.all import module_feature sage: module_feature('sage.combinat.tableau') # needs sage.combinat Feature('sage.combinat') sage: module_feature('sage.combinat.posets.poset') # needs sage.graphs Feature('sage.graphs') sage: module_feature('sage.schemes.toric.variety') # needs sage.geometry.polyhedron Feature('sage.geometry.polyhedron') sage: module_feature('scipy') # needs scipy Feature('scipy') sage: print(module_feature('sage.structure.element')) None sage: print(module_feature('sage.does_not_exist')) None
>>> from sage.all import * >>> from sage.features.all import module_feature >>> module_feature('sage.combinat.tableau') # needs sage.combinat Feature('sage.combinat') >>> module_feature('sage.combinat.posets.poset') # needs sage.graphs Feature('sage.graphs') >>> module_feature('sage.schemes.toric.variety') # needs sage.geometry.polyhedron Feature('sage.geometry.polyhedron') >>> module_feature('scipy') # needs scipy Feature('scipy') >>> print(module_feature('sage.structure.element')) None >>> print(module_feature('sage.does_not_exist')) None
- sage.features.all.name_feature(name, toplevel=None)[source]#
Find a top-level
Feature
that provides the top-levelname
.Only features known to
all_features()
are considered.INPUT:
name
– stringtoplevel
– a module or other namespace
OUTPUT: a
Feature
orNone
.EXAMPLES:
sage: from sage.features.all import name_feature sage: name_feature('QuadraticField') # needs sage.rings.number_field Feature('sage.rings.number_field') sage: name_feature('line') # needs sage.plot Feature('sage.plot') sage: print(name_feature('ZZ')) None sage: print(name_feature('does_not_exist')) None
>>> from sage.all import * >>> from sage.features.all import name_feature >>> name_feature('QuadraticField') # needs sage.rings.number_field Feature('sage.rings.number_field') >>> name_feature('line') # needs sage.plot Feature('sage.plot') >>> print(name_feature('ZZ')) None >>> print(name_feature('does_not_exist')) None