Skip to content

Commit

Permalink
Polyhedron.face_generator: Remove keyword 'dual' deprecated in sagema…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed May 8, 2024
1 parent 0d0a615 commit 2d5126c
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions src/sage/geometry/polyhedron/base3.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def _test_combinatorial_polyhedron(self, tester=None, **options):
prefix=tester._prefix+" ")
tester.info(tester._prefix + " ", newline=False)

def face_generator(self, face_dimension=None, algorithm=None, **kwds):
def face_generator(self, face_dimension=None, algorithm=None):
r"""
Return an iterator over the faces of given dimension.
Expand Down Expand Up @@ -590,22 +590,6 @@ def face_generator(self, face_dimension=None, algorithm=None, **kwds):
sage: f.ambient_Hrepresentation()
(An equation (1, 1, 1) x - 6 == 0,)
The ``dual`` keyword is deprecated::
sage: P = polytopes.hypercube(4)
sage: list(P.face_generator(dual=False))[:4]
doctest:...: DeprecationWarning: the keyword dual is deprecated; use algorithm instead
See https://github.com/sagemath/sage/issues/33646 for details.
[A 4-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 16 vertices,
A -1-dimensional face of a Polyhedron in ZZ^4,
A 3-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 8 vertices,
A 3-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 8 vertices]
sage: list(P.face_generator(True))[:4]
[A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices,
A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices]
Check that we catch incorrect algorithms::
sage: list(P.face_generator(2, algorithm='integrate'))[:4]
Expand All @@ -618,19 +602,9 @@ def face_generator(self, face_dimension=None, algorithm=None, **kwds):
dual = False
elif algorithm == 'dual':
dual = True
elif algorithm in (False, True):
from sage.misc.superseded import deprecation
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
dual = algorithm
elif algorithm is not None:
raise ValueError("algorithm must be 'primal', 'dual' or None")

if kwds:
from sage.misc.superseded import deprecation
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
if 'dual' in kwds and dual is None:
dual = kwds['dual']

from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator import FaceIterator_geom
return FaceIterator_geom(self, output_dimension=face_dimension, dual=dual)

Expand Down

0 comments on commit 2d5126c

Please sign in to comment.