Skip to content

Commit 1dda562

Browse files
committed
remove deprecated stuff in polyhedron plot
1 parent dc99dc8 commit 1dda562

File tree

1 file changed

+19
-29
lines changed
  • src/sage/geometry/polyhedron

1 file changed

+19
-29
lines changed

src/sage/geometry/polyhedron/plot.py

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def __init__(self, polyhedron, proj=projection_func_identity):
390390

391391
self(proj)
392392

393-
def _repr_(self):
393+
def _repr_(self) -> str:
394394
"""
395395
Return a string describing the projection.
396396
@@ -1234,7 +1234,7 @@ def render_3d(self, point_opts=None, line_opts=None, polygon_opts=None):
12341234
def tikz(self, view=[0, 0, 1], angle=0, scale=1,
12351235
edge_color='blue!95!black', facet_color='blue!95!black',
12361236
opacity=0.8, vertex_color='green', axis=False,
1237-
output_type=None):
1237+
output_type='TikzPicture'):
12381238
r"""
12391239
Return a tikz picture of ``self`` as a string or as a
12401240
:class:`~sage.misc.latex_standalone.TikzPicture`
@@ -1256,8 +1256,8 @@ def tikz(self, view=[0, 0, 1], angle=0, scale=1,
12561256
- ``opacity`` -- real number (default: 0.8) between 0 and 1 giving the opacity of
12571257
the front facets
12581258
- ``axis`` -- boolean (default: ``False``); draw the axes at the origin or not
1259-
- ``output_type`` -- string (default: ``None``); valid values
1260-
are ``None`` (deprecated), ``'LatexExpr'`` and ``'TikzPicture'``,
1259+
- ``output_type`` -- string (default: ``'TikzPicture'``); valid values
1260+
are ``'LatexExpr'`` and ``'TikzPicture'``,
12611261
whether to return a :class:`LatexExpr` object (which inherits from Python
12621262
:class:`str`) or a :class:`TikzPicture` object from module
12631263
:mod:`sage.misc.latex_standalone`
@@ -1372,8 +1372,7 @@ def tikz(self, view=[0, 0, 1], angle=0, scale=1,
13721372
sage: Image3 = P3.projection().tikz([0.5, -1, -0.1], 55, scale=3,
13731373
....: edge_color='blue!95!black',
13741374
....: facet_color='orange!95!black', opacity=0.7,
1375-
....: vertex_color='yellow', axis=True,
1376-
....: output_type='TikzPicture')
1375+
....: vertex_color='yellow', axis=True)
13771376
sage: Image3
13781377
\documentclass[tikz]{standalone}
13791378
\begin{document}
@@ -1425,39 +1424,30 @@ def tikz(self, view=[0, 0, 1], angle=0, scale=1,
14251424
elif self.polyhedron_dim < 2 or self.polyhedron_dim > 3:
14261425
raise NotImplementedError("The polytope has to be 2 or 3-dimensional.")
14271426
elif self.polyhedron_ambient_dim == 2: # self is a polygon in 2-space
1428-
tikz_string = self._tikz_2d(scale, edge_color, facet_color, opacity,
1429-
vertex_color, axis)
1427+
tikz_string = self._tikz_2d(scale, edge_color,
1428+
facet_color, opacity,
1429+
vertex_color, axis)
14301430
elif self.polyhedron_dim == 2: # self is a polygon in 3-space
14311431
tikz_string = self._tikz_2d_in_3d(view, angle, scale, edge_color,
1432-
facet_color, opacity, vertex_color, axis)
1432+
facet_color, opacity,
1433+
vertex_color, axis)
14331434
else: # self is a 3-polytope in 3-space
14341435
tikz_string = self._tikz_3d_in_3d(view, angle, scale, edge_color,
1435-
facet_color, opacity, vertex_color, axis)
1436-
1437-
# set default value
1438-
if output_type is None:
1439-
from sage.misc.superseded import deprecation
1440-
msg = ("The default type of the returned object will soon be "
1441-
"changed from `sage.misc.latex.LatexExpr` to "
1442-
"`sage.misc.latex_standalone.TikzPicture`. Please "
1443-
"update your code to specify the desired output type as "
1444-
"`.tikz(output_type='LatexExpr')` to keep the old "
1445-
"behavior or `.tikz(output_type='TikzPicture')` to use "
1446-
"the future default behavior.")
1447-
deprecation(33002, msg)
1448-
output_type = 'LatexExpr'
1436+
facet_color, opacity,
1437+
vertex_color, axis)
14491438

14501439
# return
14511440
if output_type == 'LatexExpr':
14521441
return tikz_string
1453-
elif output_type == 'TikzPicture':
1442+
1443+
if output_type == 'TikzPicture':
14541444
from sage.misc.latex_standalone import TikzPicture
14551445
return TikzPicture(tikz_string, standalone_config=None,
1456-
usepackage=None, usetikzlibrary=None, macros=None,
1457-
use_sage_preamble=False)
1458-
else:
1459-
raise ValueError("output_type (='{}') must be 'LatexExpr' or"
1460-
" 'TikzPicture'".format(output_type))
1446+
usepackage=None, usetikzlibrary=None,
1447+
macros=None, use_sage_preamble=False)
1448+
1449+
raise ValueError("output_type (='{}') must be 'LatexExpr' or"
1450+
" 'TikzPicture'".format(output_type))
14611451

14621452
def _tikz_2d(self, scale, edge_color, facet_color, opacity, vertex_color, axis):
14631453
r"""

0 commit comments

Comments
 (0)