-
-
Notifications
You must be signed in to change notification settings - Fork 491
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #32893: Features for palp, polytopes_db, polytopes_db_4d
`palp` is a standard package, but with modularization that does not mean that everyone has it. In particular, '''sagemath-polyhedra''' (#32432) will not ship it. We add a feature test along the lines of the palp `spkg-configure.m4` script and mark many doctests in `sage.geometry` as `# optional - palp`. To help construct doctest examples without having to rely on `palp`, we endow several classes with `_sage_input_` methods. As a cosmetic change, nef-partitions now use a unicode symbol. {{{ - Nef-partition {0, 1, 3} U {2, 4, 5} + Nef-partition {0, 1, 3} ⊔ {2, 4, 5} }}} We also add feature tests for `polytopes_db`, `polytopes_db_4d`. URL: https://trac.sagemath.org/32893 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Dima Pasechnik
- Loading branch information
Showing
17 changed files
with
663 additions
and
495 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
r""" | ||
Feature for testing the presence of ``palp`` | ||
""" | ||
# **************************************************************************** | ||
# Copyright (C) 2022 Matthias Koeppe | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
|
||
from . import Executable | ||
from .join_feature import JoinFeature | ||
|
||
|
||
class PalpExecutable(Executable): | ||
r""" | ||
A :class:`~sage.features.Feature` describing the presence of a PALP executable. | ||
INPUT: | ||
- ``palpprog`` -- string, one of "poly", "class", "nef", "cws". | ||
- ``suff`` -- string or ``None``. | ||
""" | ||
def __init__(self, palpprog, suff=None): | ||
r""" | ||
TESTS:: | ||
sage: from sage.features.palp import PalpExecutable | ||
sage: isinstance(PalpExecutable("poly", 5), PalpExecutable) | ||
True | ||
""" | ||
if suff: | ||
Executable.__init__(self, f"palp_{palpprog}_{suff}d", | ||
executable=f"{palpprog}-{suff}d.x", | ||
spkg="palp") | ||
else: | ||
Executable.__init__(self, f"palp_{palpprog}", | ||
executable=f"{palpprog}.x", | ||
spkg="palp") | ||
|
||
class Palp(JoinFeature): | ||
r""" | ||
A :class:`~sage.features.Feature` describing the presence of ``PALP``. | ||
""" | ||
def __init__(self): | ||
r""" | ||
TESTS:: | ||
sage: from sage.features.palp import Palp | ||
sage: isinstance(Palp(), Palp) | ||
True | ||
""" | ||
JoinFeature.__init__(self, "palp", | ||
[PalpExecutable(palpprog, suff) | ||
for palpprog in ("poly", "class", "nef", "cws") | ||
for suff in (None, 4, 5, 6, 11)], | ||
description="PALP") | ||
|
||
def all_features(): | ||
return [Palp()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.