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

Commit

Permalink
src/sage/features/databases.py (DatabaseReflexivePolytopes): New
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe authored and dimpase committed Mar 7, 2022
1 parent bfabd53 commit 0ac4959
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 30 additions & 2 deletions src/sage/features/databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from . import StaticFile, PythonModule
from sage.env import (
CONWAY_POLYNOMIALS_DATA_DIR,
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR)
CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR,
POLYTOPE_DATA_DIR)


class DatabaseConwayPolynomials(StaticFile):
Expand Down Expand Up @@ -127,8 +128,35 @@ def __init__(self):
PythonModule.__init__(self, 'database_knotinfo', spkg='database_knotinfo')


class DatabaseReflexivePolytopes(StaticFile):
r"""
A :class:`~sage.features.Feature` which describes the presence of the PALP database
of reflexive lattice polytopes.
EXAMPLES::
sage: from sage.features.databases import DatabaseReflexivePolytopes
sage: bool(DatabaseReflexivePolytopes().is_present()) # optional - polytopes_db
True
sage: bool(DatabaseReflexivePolytopes('polytopes_db_4d', 'Hodge4d').is_present()) # optional - polytopes_db_4d
True
"""
def __init__(self, name='polytopes_db', dirname='Full3D'):
"""
TESTS::
sage: from sage.features.databases import DatabaseReflexivePolytopes
sage: isinstance(DatabaseReflexivePolytopes(), DatabaseReflexivePolytopes)
True
"""
StaticFile.__init__(self, name, dirname,
search_path=[POLYTOPE_DATA_DIR])


def all_features():
return [DatabaseConwayPolynomials(),
DatabaseCremona(), DatabaseCremona('cremona_mini'),
DatabaseJones(),
DatabaseKnotInfo()]
DatabaseKnotInfo(),
DatabaseReflexivePolytopes(),
DatabaseReflexivePolytopes('polytopes_db_4d', 'Hodge4d')]
2 changes: 1 addition & 1 deletion src/sage/geometry/polyhedron/palp_database.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage.doctest: optional - palp
# sage.doctest: optional - polytopes_db palp
"""
Access the PALP database(s) of reflexive lattice polytopes
Expand Down

0 comments on commit 0ac4959

Please sign in to comment.