Skip to content

Commit 8ceb910

Browse files
committed
Attempt to cleanup sphinx warnings
* pygorithm/geometry/polygon2.py - fix incorrect indentation * pygorithm/geometry/rect2.py - :py:class doesn't work the same as :py:attr
1 parent 331e35a commit 8ceb910

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pygorithm/geometry/polygon2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Polygon2(object):
1919
index to the larger index will walk clockwise around the polygon.
2020
2121
.. note::
22-
22+
2323
Polygons should be used as if they were completely immutable to
2424
ensure correctness. All attributes of Polygon2 can be reconstructed
2525
from the points array, and thus cannot be changed on their own and

pygorithm/geometry/rect2.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class Rect2(object):
2828
many operations incurring expensive recalculations.
2929
3030
.. caution::
31-
32-
Collision detection against a rectangle with cause
31+
32+
Collision detection against a polygon with cause
3333
initialization of the polygon representation of a
3434
rectangle. This has the noticeable performance
3535
characteristics that are seen whenever a polygon
36-
is constructed (see :py:class:~`pygorithm.geometry.polygon2.Polygon2`).
36+
is constructed (see :py:class:`.Polygon2`).
3737
This operation recurrs only if width and height
3838
were modified.
3939
@@ -45,7 +45,7 @@ def __init__(self, width, height, mincorner = None):
4545
"""
4646
Create a new rectangle of width and height.
4747
48-
If mincorner is None, the origin is assumed.
48+
If ``mincorner is None``, the origin is assumed.
4949
5050
:param width: width of this rect
5151
:type width: :class:`numbers.Number`
@@ -69,8 +69,8 @@ def polygon(self):
6969
7070
.. caution::
7171
72-
This does not include the mincorner (which should be passed as
73-
offset)
72+
This does not include the :py:attr:~`pygorithm.geometry.rect2.Rect2.mincorner`
73+
(which should be passed as offset for polygon operations)
7474
7575
:returns: polygon representation of this rectangle
7676
:rtype: :class:`pygorithm.geometry.polygon2.Polygon2`
@@ -96,7 +96,7 @@ def width(self):
9696
:returns: width of this rect
9797
:rtype: :class:`numbers.Number`
9898
99-
:raises ValueError: if trying to set width <= 1e-07
99+
:raises ValueError: if trying to set ``width <= 1e-07``
100100
"""
101101
return self._width
102102

@@ -121,7 +121,7 @@ def height(self):
121121
:returns: height of this rect
122122
:rtype: :class:`numbers.Number`
123123
124-
:raises ValueError: if trying to set height <= 1e-07
124+
:raises ValueError: if trying to set ``height <= 1e-07``
125125
"""
126126
return self._height
127127

@@ -185,7 +185,7 @@ def contains_point(rect, point):
185185
186186
.. tip::
187187
188-
This will never return True, True
188+
This will never return ``True, True``
189189
190190
:param rect: the rect
191191
:type rect: :class:`pygorithm.geometry.rect2.Rect2`
@@ -359,9 +359,9 @@ def find_intersection(cls, *args, **kwargs):
359359
360360
For Rect-Polygon intersection:
361361
362-
Must be passed in 3 arguments - a :py:class:~`pygorithm.geometry.rect2.Rect2`,
363-
a :py:class:~`pygorithm.geometry.polygon2.Polygon2`, and a
364-
:py:class:~`pygorithm.geometry.vector2.Vector2`. The vector must come immediately
362+
Must be passed in 3 arguments - a :py:class:`.Rect2`,
363+
a :py:class:`.Polygon2`, and a
364+
:py:class:`.Vector2`. The vector must come immediately
365365
after the polygon, but the rect can be either the first or last unnamed argument.
366366
If it is the first argument, the mtv is against the rectangle. If it is the last
367367
argument, the mtv is against the polygon.

0 commit comments

Comments
 (0)