Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Deprecate old keyword and method field
Browse files Browse the repository at this point in the history
  • Loading branch information
jplab committed Mar 8, 2017
1 parent fd5f71a commit 1e26fe9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 4 additions & 3 deletions src/sage/geometry/polyhedron/backend_cdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from .base_QQ import Polyhedron_QQ
from .base_RDF import Polyhedron_RDF


from sage.misc.decorators import rename_keyword

#########################################################################
class Polyhedron_cdd(Polyhedron_base):
Expand Down Expand Up @@ -214,11 +214,12 @@ def cdd_linearities():
return [int(i)-1 for i in l[2:]] # make indices pythonic

# nested function
def cdd_convert(string, field=self.field()):
@rename_keyword(deprecation=22551, field='base_ring')
def cdd_convert(string, base_ring=self.base_ring()):
"""
Converts the cdd output string to a numerical value.
"""
return [field(x) for x in string.split()]
return [base_ring(x) for x in string.split()]

# nested function
def find_in_cddout(expected_string):
Expand Down
10 changes: 4 additions & 6 deletions src/sage/geometry/polyhedron/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def _delete(self):

def base_extend(self, base_ring, backend=None):
"""
Return a new polyhedron over a larger field.
Return a new polyhedron over a larger base ring.
INPUT:
Expand Down Expand Up @@ -2032,8 +2032,6 @@ def base_ring(self):
"""
return self.parent().base_ring()

field = base_ring

@cached_method
def center(self):
"""
Expand Down Expand Up @@ -2103,7 +2101,7 @@ def radius_square(self):
OUTPUT:
The square of the radius, which is in :meth:`field`.
The square of the radius, which is in :meth:`base_ring`.
EXAMPLES::
Expand Down Expand Up @@ -2667,7 +2665,7 @@ def dilation(self, scalar):
OUTPUT:
The polyhedron dilated by that scalar, possibly coerced to a
bigger field.
bigger base ring.
EXAMPLES::
Expand Down Expand Up @@ -2730,7 +2728,7 @@ def _acted_upon_(self, actor, self_on_left):
Multiplication by another polyhedron returns the product
polytope. Multiplication by a scalar returns the polytope
dilated by that scalar, possibly coerced to the bigger field.
dilated by that scalar, possibly coerced to the bigger base ring.
EXAMPLES::
Expand Down
4 changes: 1 addition & 3 deletions src/sage/geometry/polyhedron/constructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,11 @@
from __future__ import absolute_import

from sage.rings.all import QQ, ZZ, RDF, RR
from sage.misc.decorators import rename_keyword

from .misc import _make_listlist, _common_length_of


#########################################################################
@rename_keyword(deprecation=11634, field='base_ring')
def Polyhedron(vertices=None, rays=None, lines=None,
ieqs=None, eqns=None,
ambient_dim=None, base_ring=None, minimize=True, verbose=False,
Expand Down Expand Up @@ -363,7 +361,7 @@ def Polyhedron(vertices=None, rays=None, lines=None,
* Once constructed, a ``Polyhedron`` object is immutable.
* Although the option ``field=RDF`` allows numerical data to
* Although the option ``base_ring=RDF`` allows numerical data to
be used, it might not give the right answer for degenerate
input data - the results can depend upon the tolerance
setting of cdd.
Expand Down

0 comments on commit 1e26fe9

Please sign in to comment.