Skip to content

Commit 0f6d572

Browse files
committed
2 parents 25878a0 + d97479d commit 0f6d572

File tree

6 files changed

+256
-133
lines changed

6 files changed

+256
-133
lines changed

src/sage/features/databases.py

+30-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from . import StaticFile, PythonModule
88
from sage.env import (
99
CONWAY_POLYNOMIALS_DATA_DIR,
10-
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR)
10+
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR,
11+
POLYTOPE_DATA_DIR)
1112

1213

1314
class DatabaseConwayPolynomials(StaticFile):
@@ -127,8 +128,35 @@ def __init__(self):
127128
PythonModule.__init__(self, 'database_knotinfo', spkg='database_knotinfo')
128129

129130

131+
class DatabaseReflexivePolytopes(StaticFile):
132+
r"""
133+
A :class:`~sage.features.Feature` which describes the presence of the PALP database
134+
of reflexive lattice polytopes.
135+
136+
EXAMPLES::
137+
138+
sage: from sage.features.databases import DatabaseReflexivePolytopes
139+
sage: bool(DatabaseReflexivePolytopes().is_present()) # optional - polytopes_db
140+
True
141+
sage: bool(DatabaseReflexivePolytopes('polytopes_db_4d', 'Hodge4d').is_present()) # optional - polytopes_db_4d
142+
True
143+
"""
144+
def __init__(self, name='polytopes_db', dirname='Full3D'):
145+
"""
146+
TESTS::
147+
148+
sage: from sage.features.databases import DatabaseReflexivePolytopes
149+
sage: isinstance(DatabaseReflexivePolytopes(), DatabaseReflexivePolytopes)
150+
True
151+
"""
152+
StaticFile.__init__(self, name, dirname,
153+
search_path=[POLYTOPE_DATA_DIR])
154+
155+
130156
def all_features():
131157
return [DatabaseConwayPolynomials(),
132158
DatabaseCremona(), DatabaseCremona('cremona_mini'),
133159
DatabaseJones(),
134-
DatabaseKnotInfo()]
160+
DatabaseKnotInfo(),
161+
DatabaseReflexivePolytopes(),
162+
DatabaseReflexivePolytopes('polytopes_db_4d', 'Hodge4d')]

0 commit comments

Comments
 (0)