From 6b376867af1cef2665143e86f3f4c23e8843ffdb Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Wed, 16 Oct 2019 12:20:32 +0200 Subject: [PATCH] altered the deprecation message to be the correct one for methods --- .../combinatorial_face.pyx | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx b/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx index 3ab96cae236..7de7cdefa30 100644 --- a/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx +++ b/src/sage/geometry/polyhedron/combinatorial_polyhedron/combinatorial_face.pyx @@ -65,6 +65,7 @@ AUTHOR: #***************************************************************************** from __future__ import absolute_import, division, print_function +from sage.misc.superseded import deprecated_function_alias import numbers from sage.rings.integer cimport smallInteger @@ -396,17 +397,6 @@ cdef class CombinatorialFace(SageObject): sage: it = C.face_iter() sage: all(face.n_ambient_Vrepresentation() == len(face.Vrepr()) for face in it) True - """ - if self._dual: - return smallInteger(self.set_coatom_repr()) - else: - return smallInteger(self.n_atom_rep()) - - def n_Vrepr(self): - r""" - .. SEEALSO:: - - :meth:`CombinatorialFace.n_ambient_Vrepresentation` TESTS:: @@ -415,12 +405,15 @@ cdef class CombinatorialFace(SageObject): sage: it = C.face_iter() sage: face = next(it) sage: _ = face.n_Vrepr() - doctest:...: DeprecationWarning: the method n_Vrepr of CombinatorialFace is deprecated + doctest:...: DeprecationWarning: n_Vrepr is deprecated. Please use n_ambient_Vrepresentation instead. See https://trac.sagemath.org/28614 for details. """ - from sage.misc.superseded import deprecation - deprecation(28614, "the method n_Vrepr of CombinatorialFace is deprecated") - return self.n_ambient_Vrepresentation() + if self._dual: + return smallInteger(self.set_coatom_repr()) + else: + return smallInteger(self.n_atom_rep()) + + n_Vrepr = deprecated_function_alias(28614, n_ambient_Vrepresentation) def Hrepr(self, names=True): r""" @@ -523,12 +516,24 @@ cdef class CombinatorialFace(SageObject): sage: it = C.face_iter() sage: all(face.n_ambient_Hrepresentation() == len(face.Hrepr()) for face in it) True + + TESTS:: + + sage: P = polytopes.cube() + sage: C = CombinatorialPolyhedron(P) + sage: it = C.face_iter() + sage: face = next(it) + sage: _ = face.n_Hrepr() + doctest:...: DeprecationWarning: n_Hrepr is deprecated. Please use n_ambient_Hrepresentation instead. + See https://trac.sagemath.org/28614 for details. """ if not self._dual: return smallInteger(self.set_coatom_repr()) else: return smallInteger(self.n_atom_rep()) + n_Hrepr = deprecated_function_alias(28614, n_ambient_Hrepresentation) + def n_Hrepr(self): r""" .. SEEALSO:: @@ -542,7 +547,7 @@ cdef class CombinatorialFace(SageObject): sage: it = C.face_iter() sage: face = next(it) sage: _ = face.n_Hrepr() - doctest:...: DeprecationWarning: the method n_Hrepr of CombinatorialFace is deprecated + doctest:...: DeprecationWarning: n_Hrepr is deprecated. Please use n_ambient_Hrepresentation instead. See https://trac.sagemath.org/28614 for details. """ from sage.misc.superseded import deprecation