Skip to content

Commit

Permalink
Trac #34164: Fix docstring markup in sage/plot and sage/graphs
Browse files Browse the repository at this point in the history
Part of #34157:
{{{
sage/plot/polygon.py:99:1: RST215 Inline interpreted text or phrase
reference start-string without end-string.
sage/plot/polygon.py:113:1: RST215 Inline interpreted text or phrase
reference start-string without end-string.
sage/graphs/dot2tex_utils.py:89:1: RST201 Block quote ends without a
blank line; unexpected unindent.
sage/graphs/dot2tex_utils.py:91:1: RST301 Unexpected indentation.
sage/graphs/graph_plot.py:50:1: RST299 The "csv-table" directive
requires content; none supplied.
}}}

URL: https://trac.sagemath.org/34164
Reported by: klee
Ticket author(s): Frédéric Chapoton
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Jul 25, 2022
2 parents b03229e + c088449 commit 6e41b53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
10 changes: 6 additions & 4 deletions src/sage/graphs/dot2tex_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ def quoted_latex(x):
"""
return re.sub("\"|\r|(%[^\n]*)?\n","", latex(x))


def quoted_str(x):
"""
Strips the string representation of ``x`` to make it suitable for
a ``dot2tex`` string, and especially a node label (``dot2tex``
gets confused by newlines, and braces)
r"""
Strip the string representation of ``x`` to make it suitable for
a ``dot2tex`` string, and especially a node label.
Indeed, ``dot2tex`` gets confused by newlines, and braces.
EXAMPLES::
Expand Down
13 changes: 8 additions & 5 deletions src/sage/plot/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ def _repr_(self):

def __getitem__(self, i):
"""
Return `i`th vertex of Polygon primitive, starting count
from 0th vertex.
Return `i`-th vertex of Polygon primitive
It is starting count from 0th vertex.
EXAMPLES::
Expand All @@ -111,9 +112,11 @@ def __getitem__(self, i):

def __setitem__(self, i, point):
"""
Changes `i`th vertex of Polygon primitive, starting count
from 0th vertex. Note that this only changes a vertex,
but does not create new vertices.
Change `i`-th vertex of Polygon primitive
It is starting count from 0th vertex.
Note that this only changes a vertex, but does not create new vertices.
EXAMPLES::
Expand Down

0 comments on commit 6e41b53

Please sign in to comment.