Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit f63a7d0

Browse files
author
Matthias Koeppe
committed
src/sage/features/: Move features depending on optional packages to separate files
1 parent 654d09c commit f63a7d0

File tree

5 files changed

+44
-43
lines changed

5 files changed

+44
-43
lines changed

src/sage/features/bliss.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Checks for bliss
44
"""
55
from . import CythonFeature, PythonModule
6+
from .join_feature import JoinFeature
67

78

89
TEST_CODE = """
@@ -45,10 +46,10 @@ def __init__(self):
4546
url="http://www.tcs.hut.fi/Software/bliss/")
4647

4748

48-
class Bliss(PythonModule):
49+
class Bliss(JoinFeature):
4950
r"""
5051
A :class:`Feature` which describes whether the :mod:`sage.graphs.bliss`
51-
module has been enabled for this build of Sage and is functional.
52+
module is available in this installation of Sage.
5253
5354
EXAMPLES::
5455
@@ -61,7 +62,10 @@ def __init__(self):
6162
6263
sage: from sage.features.bliss import Bliss
6364
sage: Bliss()
64-
Feature('sage.graphs.bliss')
65+
Feature('bliss')
6566
"""
66-
PythonModule.__init__(self, "sage.graphs.bliss", spkg="bliss",
67-
url="http://www.tcs.hut.fi/Software/bliss/")
67+
# Currently part of sagemath_standard, conditionally built.
68+
# Will be changed to spkg='sagemath_bliss' later
69+
JoinFeature.__init__(self, "bliss",
70+
[PythonModule("sage.graphs.bliss", spkg="bliss",
71+
url="http://www.tcs.hut.fi/Software/bliss/")])

src/sage/features/mcqd.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from . import PythonModule
2+
from .join_feature import JoinFeature
3+
4+
5+
class Mcqd(JoinFeature):
6+
7+
def __init__(self):
8+
# Currently part of sagemath_standard, conditionally built.
9+
# Will be changed to spkg='sagemath_mcqd' later
10+
JoinFeature.__init__(self, 'mcqd',
11+
[PythonModule('sage.graphs.mcqd', spkg='mcqd')])

src/sage/features/meataxe.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from . import PythonModule
2+
from .join_feature import JoinFeature
3+
4+
5+
class Meataxe(JoinFeature):
6+
7+
def __init__(self):
8+
# Currently part of sagemath_standard, conditionally built.
9+
# Will be changed to spkg='sagemath_meataxe' later
10+
JoinFeature.__init__(self, 'meataxe',
11+
[PythonModule('sage.matrix.matrix_gfpn_dense', spkg='meataxe')])

src/sage/features/sagemath.py

+2-38
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,6 @@ def __init__(self):
2222
[PythonModule('sage.graphs.graph')])
2323

2424

25-
class sage__graphs__bliss(PythonModule):
26-
27-
def __init__(self):
28-
# Currently part of sagemath_standard, conditionally built.
29-
# Will be changed to spkg='sagemath_bliss' later
30-
PythonModule.__init__(self, 'sage.graphs.bliss', spkg='bliss')
31-
32-
33-
class sage__graphs__graph_decompositions__tdlib(PythonModule):
34-
35-
def __init__(self):
36-
# Currently part of sagemath_standard, conditionally built.
37-
# Will be changed to spkg='sagemath_tdlib' later
38-
PythonModule.__init__(self, 'sage.graphs.graph_decompositions.tdlib', spkg='tdlib')
39-
40-
41-
class sage__graphs__mcqd(PythonModule):
42-
43-
def __init__(self):
44-
# Currently part of sagemath_standard, conditionally built.
45-
# Will be changed to spkg='sagemath_mcqd' later
46-
PythonModule.__init__(self, 'sage.graphs.mcqd', spkg='mcqd')
47-
48-
49-
class sage__matrix__matrix_gfpn_dense(PythonModule):
50-
51-
def __init__(self):
52-
# Currently part of sagemath_standard, conditionally built.
53-
# Will be changed to spkg='sagemath_meataxe' later
54-
PythonModule.__init__(self, 'sage.matrix.matrix_gfpn_dense', spkg='meataxe')
55-
56-
5725
class sage__plot(JoinFeature):
5826

5927
def __init__(self):
@@ -84,7 +52,7 @@ def __init__(self):
8452

8553
def sage_features():
8654
"""
87-
Return tags for conditionalizing doctests.
55+
Return features corresponding to parts of the Sage library.
8856
8957
These tags are named after Python packages/modules (e.g., :mod:`~sage.symbolic`),
9058
not distribution packages (``sagemath-symbolics``).
@@ -102,16 +70,12 @@ def sage_features():
10270
sage: from sage.features.sagemath import sage_features
10371
sage: list(sage_features()) # random
10472
[Feature('sage.graphs'),
105-
Feature('sage.graphs.bliss'),
10673
Feature('sage.plot'),
74+
Feature('sage.rings.number_field'),
10775
Feature('sage.rings.real_double')]
10876
"""
10977
for feature in [sage__combinat(),
11078
sage__graphs(),
111-
sage__graphs__bliss(),
112-
sage__graphs__graph_decompositions__tdlib(),
113-
sage__graphs__mcqd(),
114-
sage__matrix__matrix_gfpn_dense(),
11579
sage__plot(),
11680
sage__rings__number_field(),
11781
sage__rings__real_double(),

src/sage/features/tdlib.py

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from . import PythonModule
2+
from .join_feature import JoinFeature
3+
4+
5+
class Tdlib(JoinFeature):
6+
7+
def __init__(self):
8+
# Currently part of sagemath_standard, conditionally built.
9+
# Will be changed to spkg='sagemath_tdlib' later
10+
JoinFeature.__init__(self, 'tdlib',
11+
[PythonModule('sage.graphs.graph_decompositions.tdlib', spkg='tdlib')])

0 commit comments

Comments
 (0)