Skip to content

Commit

Permalink
sagemathgh-37869: sage.geometry.polyhedron: Remove deprecated code
Browse files Browse the repository at this point in the history
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Remove code deprecated in:
- sagemath#32592 (2021)
- sagemath#33646 (2022)
- sagemath#31834 (2021)

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#37869
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee
  • Loading branch information
Release Manager committed May 8, 2024
2 parents 56ac6bc + 94c6cd8 commit 8b963fc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 74 deletions.
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

0 comments on commit 8b963fc

Please sign in to comment.