Skip to content

Commit 58c4079

Browse files
author
Release Manager
committed
gh-37869: `sage.geometry.polyhedron`: Remove deprecated code <!-- ^ 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 #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 #12345". --> Remove code deprecated in: - #32592 (2021) - #33646 (2022) - #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, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #37869 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee
2 parents 56e555d + 94c6cd8 commit 58c4079

File tree

4 files changed

+4
-74
lines changed

4 files changed

+4
-74
lines changed

src/sage/geometry/polyhedron/backend_cdd.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@
2222
from .base import Polyhedron_base
2323
from .base_QQ import Polyhedron_QQ
2424

25-
from sage.misc.lazy_import import lazy_import
26-
lazy_import('sage.geometry.polyhedron.backend_cdd_rdf', 'Polyhedron_RDF_cdd', deprecation=32592)
27-
2825

2926
class Polyhedron_cdd(Polyhedron_base):
3027
r"""

src/sage/geometry/polyhedron/base3.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ def _test_combinatorial_polyhedron(self, tester=None, **options):
372372
prefix=tester._prefix+" ")
373373
tester.info(tester._prefix + " ", newline=False)
374374

375-
def face_generator(self, face_dimension=None, algorithm=None, **kwds):
375+
def face_generator(self, face_dimension=None, algorithm=None):
376376
r"""
377377
Return an iterator over the faces of given dimension.
378378
@@ -590,22 +590,6 @@ def face_generator(self, face_dimension=None, algorithm=None, **kwds):
590590
sage: f.ambient_Hrepresentation()
591591
(An equation (1, 1, 1) x - 6 == 0,)
592592
593-
The ``dual`` keyword is deprecated::
594-
595-
sage: P = polytopes.hypercube(4)
596-
sage: list(P.face_generator(dual=False))[:4]
597-
doctest:...: DeprecationWarning: the keyword dual is deprecated; use algorithm instead
598-
See https://github.com/sagemath/sage/issues/33646 for details.
599-
[A 4-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 16 vertices,
600-
A -1-dimensional face of a Polyhedron in ZZ^4,
601-
A 3-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 8 vertices,
602-
A 3-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 8 vertices]
603-
sage: list(P.face_generator(True))[:4]
604-
[A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices,
605-
A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices,
606-
A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices,
607-
A 1-dimensional face of a Polyhedron in ZZ^4 defined as the convex hull of 2 vertices]
608-
609593
Check that we catch incorrect algorithms::
610594
611595
sage: list(P.face_generator(2, algorithm='integrate'))[:4]
@@ -618,19 +602,9 @@ def face_generator(self, face_dimension=None, algorithm=None, **kwds):
618602
dual = False
619603
elif algorithm == 'dual':
620604
dual = True
621-
elif algorithm in (False, True):
622-
from sage.misc.superseded import deprecation
623-
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
624-
dual = algorithm
625605
elif algorithm is not None:
626606
raise ValueError("algorithm must be 'primal', 'dual' or None")
627607

628-
if kwds:
629-
from sage.misc.superseded import deprecation
630-
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
631-
if 'dual' in kwds and dual is None:
632-
dual = kwds['dual']
633-
634608
from sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator import FaceIterator_geom
635609
return FaceIterator_geom(self, output_dimension=face_dimension, dual=dual)
636610

src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pxd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ cdef class CombinatorialPolyhedron(SageObject):
3434
cdef tuple Vrep(self)
3535
cdef tuple facet_names(self)
3636
cdef tuple equations(self)
37-
cdef tuple equalities(self)
3837
cdef unsigned int n_Vrepresentation(self) noexcept
3938
cdef unsigned int n_Hrepresentation(self) noexcept
4039
cdef bint is_bounded(self) noexcept

src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ cdef class CombinatorialPolyhedron(SageObject):
13591359
adjacency_matrix.set_immutable()
13601360
return adjacency_matrix
13611361

1362-
def ridges(self, add_equations=False, names=True, add_equalities=False, algorithm=None):
1362+
def ridges(self, add_equations=False, names=True, algorithm=None):
13631363
r"""
13641364
Return the ridges.
13651365
@@ -1453,21 +1453,7 @@ cdef class CombinatorialPolyhedron(SageObject):
14531453
sage: C = CombinatorialPolyhedron(polytopes.simplex())
14541454
sage: C.ridges(names=False, add_equations=True)
14551455
((2, 3), (1, 3), (0, 3), (1, 2), (0, 2), (0, 1))
1456-
1457-
The keyword ``add_equalities`` is deprecated::
1458-
1459-
sage: C = CombinatorialPolyhedron(polytopes.simplex())
1460-
sage: r = C.ridges(add_equations=True)
1461-
sage: r1 = C.ridges(add_equalities=True)
1462-
doctest:...: DeprecationWarning: the keyword ``add_equalities`` is deprecated; use ``add_equations``
1463-
See https://github.com/sagemath/sage/issues/31834 for details.
1464-
sage: r == r1
1465-
True
14661456
"""
1467-
if add_equalities:
1468-
from sage.misc.superseded import deprecation
1469-
deprecation(31834, "the keyword ``add_equalities`` is deprecated; use ``add_equations``", 3)
1470-
add_equations = True
14711457
self._compute_ridges(self._algorithm_to_dual(algorithm))
14721458
cdef size_t n_ridges = self._ridges.length
14731459

@@ -2673,7 +2659,7 @@ cdef class CombinatorialPolyhedron(SageObject):
26732659
"""
26742660
return self.face_generator().meet_of_Hrep(*indices)
26752661

2676-
def face_generator(self, dimension=None, algorithm=None, **kwds):
2662+
def face_generator(self, dimension=None, algorithm=None):
26772663
r"""
26782664
Iterator over all proper faces of specified dimension.
26792665
@@ -2760,35 +2746,14 @@ cdef class CombinatorialPolyhedron(SageObject):
27602746
(A ray in the direction (1, 0), A vertex at (1, 0))
27612747
(A ray in the direction (0, 1), A vertex at (0, 1))
27622748
2763-
TESTS:
2764-
2765-
The kewword ``dual`` is deprecated::
2766-
2767-
sage: C = CombinatorialPolyhedron([[0,1,2],[0,1,3],[0,2,3],[1,2,3]])
2768-
sage: it = C.face_generator(1, False)
2769-
doctest:...: DeprecationWarning: the keyword dual is deprecated; use algorithm instead
2770-
See https://github.com/sagemath/sage/issues/33646 for details.
2771-
sage: it = C.face_generator(1, dual=True)
2772-
27732749
.. SEEALSO::
27742750
27752751
:class:`~sage.geometry.polyhedron.combinatorial_polyhedron.face_iterator.FaceIterator`,
27762752
:class:`~sage.geometry.polyhedron.combinatorial_polyhedron.combinatorial_face.CombinatorialFace`.
27772753
"""
27782754
cdef int dual
27792755

2780-
if algorithm in (False, True):
2781-
from sage.misc.superseded import deprecation
2782-
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
2783-
dual = int(algorithm)
2784-
else:
2785-
dual = self._algorithm_to_dual(algorithm)
2786-
2787-
if kwds:
2788-
from sage.misc.superseded import deprecation
2789-
deprecation(33646, "the keyword dual is deprecated; use algorithm instead")
2790-
if 'dual' in kwds and dual == -1 and kwds['dual'] in (False, True):
2791-
dual = int(kwds['dual'])
2756+
dual = self._algorithm_to_dual(algorithm)
27922757

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

3276-
cdef tuple equalities(self):
3277-
from sage.misc.superseded import deprecation
3278-
deprecation(31834, "the method equalities of CombinatorialPolyhedron is deprecated; use equations", 3)
3279-
return self.equations()
3280-
32813241
cdef unsigned int n_Vrepresentation(self) noexcept:
32823242
r"""
32833243
Return the number of elements in the Vrepresentation.

0 commit comments

Comments
 (0)