Features for palp, polytopes_db, polytopes_db_4d
Closed this issue · 30 comments
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.
CC: @kliem @novoselt @seblabbe @dimpase
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: d97479d
Reviewer: Dima Pasechnik
Issue created by migration from https://trac.sagemath.org/ticket/32893
Description changed:
---
+++
@@ -1,2 +1,3 @@
`palp` is a standard package, but with modularization that does not mean that everyone has it.
+We should add a feature test along the lines of the palp `spkg-configure.m4` scriptBranch: u/mkoeppe/feature_for_palp
Author: Matthias Koeppe
Description changed:
---
+++
@@ -1,3 +1,4 @@
-`palp` is a standard package, but with modularization that does not mean that everyone has it.
+`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 should add a feature test along the lines of the palp `spkg-configure.m4` script
+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`.
+I find such markings ridiculous... If a module is useless without PALP, it would make much more sense to me to mark the module once as optional and not on every single line of examples.
My random guess is that modules for toric varieties will mostly stop working as well and again it would make much more sense to mark those modules as dependent on PALP and not each line.
Thanks for the feedback. I wouldn't go so far as to call the module useless. The explicit interaction of the polytope with a lattice in this class is valuable design and code that is not tied to the choice of PALP as a backend.
There is a lot of duplication / proliferation of incompatible variants among sage.geometry.lattice_polytope, sage.geometry.polyhedron.ppl_lattice_polytope, sage.geometry.polyhedron that is calling for refactoring. To mark which lines of lattice_polytope actually depend on palp (about 1/3 of the sage: lines in this file) was a first step to inform possible such refactoring steps.
Many of the # optional markings in tests for NefPartition could be avoided by constructing the example explicitly instead of using
sage: o = lattice_polytope.cross_polytope(3)
sage: np = o.nef_partitions()[0]; np # optional - palp
repeatedly. Would this be agreeable?
Since I am not doing any work anymore, it is up to the people who do to agree on ;-)
Branch pushed to git repo; I updated commit sha1. New commits:
74fdacf | LatticePolytopeClass, NefPartition, PointCollection, ToricLattice_ambient: Add `_sage_input_` methods |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
9d726ce | LatticePolytopeClass, NefPartition, PointCollection, ToricLattice_ambient: Add `_sage_input_` methods |
Branch pushed to git repo; I updated commit sha1. New commits:
1c78501 | src/sage/geometry/lattice_polytope.py: In NefPartition doctests, construct examples without using palp |
Replying to @mkoeppe:
To mark which lines of
lattice_polytopeactually depend onpalp(about 1/3 of thesage:lines in this file)
down to less than 1/4 of the lines now
Branch pushed to git repo; I updated commit sha1. New commits:
1025d65 | src/sage/geometry/lattice_polytope.py, src/sage/schemes/toric/fano_variety.py: Use unicode disjoint union symbol |
Description changed:
---
+++
@@ -2,3 +2,12 @@
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}
+```
+Branch pushed to git repo; I updated commit sha1. New commits:
55e812c | src/sage/geometry/lattice_polytope.py: Fix typo |
Branch pushed to git repo; I updated commit sha1. New commits:
d97479d | src/sage/features/databases.py (DatabaseReflexivePolytopes): New |
Description changed:
---
+++
@@ -11,3 +11,5 @@
+ Nef-partition {0, 1, 3} ⊔ {2, 4, 5}
```
+We also add feature tests for `polytopes_db`, `polytopes_db_4d`.
+Doctest failures are unrelated, needs review
Reviewer: Dima Pasechnik
lgtm
Thank you!
Changed branch from u/mkoeppe/feature_for_palp to d97479d