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

Commit

Permalink
33002: shorter deprecation message
Browse files Browse the repository at this point in the history
  • Loading branch information
seblabbe committed Jul 7, 2022
1 parent a1d5989 commit 4ef07a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/doc/en/thematic_tutorials/geometry/polytope_tikz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ paper. TikZ is a very versatile tool to draw in scientific documents
and Sage can deal easily with 3-dimensional polytopes. Finally sagetex
makes everything work together nicely between Sage, TikZ and
LaTeX. Since version 6.3 of Sage, there is a function for (projection
of) polytopes to output a TikZ picture of the polytope. Since Version 9.7 of SageMath,
the tikz output can be a ``TikzPicture`` object from the sage module
of) polytopes to output a TikZ picture of the polytope. Since version 9.7 of
SageMath, the tikz output can be a ``TikzPicture`` object from the sage module
``sage.misc.latex_standalone``. This short tutorial shows how it all works.

Instructions
Expand Down
17 changes: 6 additions & 11 deletions src/sage/geometry/polyhedron/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1421,17 +1421,12 @@ def tikz(self, view=[0, 0, 1], angle=0, scale=1,
# set default value
if output_type is None:
from sage.misc.superseded import deprecation
msg = ("Since SageMath 5.13 (ticket #12083), the method .tikz() "
"of a polyhedron returns an object of type ``LatexExpr`` "
"which is a Python str. Since SageMath 9.7, this "
"default behavior of returning an object of type "
"LatexExpr is deprecated as the default output will soon "
"change to an object of type ``TikzPicture`` from the "
"module sage.misc.latex_standalone (newly introduced in "
"SageMath 9.6). Please update your code to specify the "
"desired output type as ``.tikz(output_type='LatexExpr')`` "
"to keep the old behavior or "
"``.tikz(output_type='TikzPicture')`` to use "
msg = ("The default type of the returned object will soon be "
"changed from `sage.misc.latex.LatexExpr` to "
"`sage.misc.latex_standalone.TikzPicture`. Please "
"update your code to specify the desired output type as "
"`.tikz(output_type='LatexExpr')` to keep the old "
"behavior or `.tikz(output_type='TikzPicture')` to use "
"the future default behavior.")
deprecation(33002, msg)
output_type = 'LatexExpr'
Expand Down

0 comments on commit 4ef07a9

Please sign in to comment.