Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.geometry.polyhedron: Remove deprecated code #37869

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/sage/geometry/polyhedron/backend_cdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
from .base import Polyhedron_base
from .base_QQ import Polyhedron_QQ

from sage.misc.lazy_import import lazy_import
lazy_import('sage.geometry.polyhedron.backend_cdd_rdf', 'Polyhedron_RDF_cdd', deprecation=32592)


class Polyhedron_cdd(Polyhedron_base):
r"""
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ cdef class CombinatorialPolyhedron(SageObject):
cdef tuple Vrep(self)
cdef tuple facet_names(self)
cdef tuple equations(self)
cdef tuple equalities(self)
cdef unsigned int n_Vrepresentation(self) noexcept
cdef unsigned int n_Hrepresentation(self) noexcept
cdef bint is_bounded(self) noexcept
Expand Down
46 changes: 3 additions & 43 deletions src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ cdef class CombinatorialPolyhedron(SageObject):
adjacency_matrix.set_immutable()
return adjacency_matrix

def ridges(self, add_equations=False, names=True, add_equalities=False, algorithm=None):
def ridges(self, add_equations=False, names=True, algorithm=None):
r"""
Return the ridges.

Expand Down Expand Up @@ -1453,21 +1453,7 @@ cdef class CombinatorialPolyhedron(SageObject):
sage: C = CombinatorialPolyhedron(polytopes.simplex())
sage: C.ridges(names=False, add_equations=True)
((2, 3), (1, 3), (0, 3), (1, 2), (0, 2), (0, 1))

The keyword ``add_equalities`` is deprecated::

sage: C = CombinatorialPolyhedron(polytopes.simplex())
sage: r = C.ridges(add_equations=True)
sage: r1 = C.ridges(add_equalities=True)
doctest:...: DeprecationWarning: the keyword ``add_equalities`` is deprecated; use ``add_equations``
See https://github.com/sagemath/sage/issues/31834 for details.
sage: r == r1
True
"""
if add_equalities:
from sage.misc.superseded import deprecation
deprecation(31834, "the keyword ``add_equalities`` is deprecated; use ``add_equations``", 3)
add_equations = True
self._compute_ridges(self._algorithm_to_dual(algorithm))
cdef size_t n_ridges = self._ridges.length

Expand Down Expand Up @@ -2673,7 +2659,7 @@ cdef class CombinatorialPolyhedron(SageObject):
"""
return self.face_generator().meet_of_Hrep(*indices)

def face_generator(self, dimension=None, algorithm=None, **kwds):
def face_generator(self, dimension=None, algorithm=None):
r"""
Iterator over all proper faces of specified dimension.

Expand Down Expand Up @@ -2760,35 +2746,14 @@ cdef class CombinatorialPolyhedron(SageObject):
(A ray in the direction (1, 0), A vertex at (1, 0))
(A ray in the direction (0, 1), A vertex at (0, 1))

TESTS:

The kewword ``dual`` is deprecated::

sage: C = CombinatorialPolyhedron([[0,1,2],[0,1,3],[0,2,3],[1,2,3]])
sage: it = C.face_generator(1, False)
doctest:...: DeprecationWarning: the keyword dual is deprecated; use algorithm instead
See https://github.com/sagemath/sage/issues/33646 for details.
sage: it = C.face_generator(1, dual=True)

.. SEEALSO::

:class:`~sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator.FaceIterator`,
:class:`~sage.geometry.polyhedron.combinatorial_polyhedron.combinatorial_face.CombinatorialFace`.
"""
cdef int dual

if algorithm in (False, True):
from sage.misc.superseded import deprecation
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
dual = int(algorithm)
else:
dual = self._algorithm_to_dual(algorithm)

if kwds:
from sage.misc.superseded import deprecation
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
if 'dual' in kwds and dual == -1 and kwds['dual'] in (False, True):
dual = int(kwds['dual'])
dual = self._algorithm_to_dual(algorithm)

if dual == -1:
# Determine the faster way, to iterate through all faces.
Expand Down Expand Up @@ -3273,11 +3238,6 @@ cdef class CombinatorialPolyhedron(SageObject):
"""
return self._equations

cdef tuple equalities(self):
from sage.misc.superseded import deprecation
deprecation(31834, "the method equalities of CombinatorialPolyhedron is deprecated; use equations", 3)
return self.equations()

cdef unsigned int n_Vrepresentation(self) noexcept:
r"""
Return the number of elements in the Vrepresentation.
Expand Down
Loading