Skip to content

Commit ccf69f5

Browse files
committed
Added type annotations to docstrings
1 parent 288a4f5 commit ccf69f5

File tree

7 files changed

+53
-53
lines changed

7 files changed

+53
-53
lines changed

adafruit_display_shapes/circle.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ class Circle(RoundRect):
3636
# pylint: disable=too-few-public-methods, invalid-name
3737
"""A circle.
3838
39-
:param x0: The x-position of the center.
40-
:param y0: The y-position of the center.
41-
:param r: The radius of the circle.
42-
:param fill: The color to fill the circle. Can be a hex value for a color or
39+
:param int x0: The x-position of the center.
40+
:param int y0: The y-position of the center.
41+
:param int r: The radius of the circle.
42+
:param int fill: (Optional) The color to fill the circle. Can be a hex value for a color or
4343
``None`` for transparent.
44-
:param outline: The outline of the circle. Can be a hex value for a color or
44+
:param int outline: (Optional) The outline of the circle. Can be a hex value for a color or
4545
``None`` for no outline.
46-
:param stroke: Used for the outline. Will not change the radius.
46+
:param int stroke: Used for the outline. Will not change the radius.
4747
4848
"""
4949

adafruit_display_shapes/line.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class Line(Polygon):
3636
# pylint: disable=too-many-arguments,invalid-name, too-few-public-methods
3737
"""A line.
3838
39-
:param x0: The x-position of the first vertex.
40-
:param y0: The y-position of the first vertex.
41-
:param x1: The x-position of the second vertex.
42-
:param y1: The y-position of the second vertex.
43-
:param color: The color of the line.
39+
:param int x0: The x-position of the first vertex.
40+
:param int y0: The y-position of the first vertex.
41+
:param int x1: The x-position of the second vertex.
42+
:param int y1: The y-position of the second vertex.
43+
:param int color: The color of the line.
4444
"""
4545

4646
def __init__(

adafruit_display_shapes/polygon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class Polygon(displayio.TileGrid):
3636
# pylint: disable=too-many-arguments,invalid-name
3737
"""A polygon.
3838
39-
:param points: A list of (x, y) tuples of the points
40-
:param outline: The outline of the polygon. Can be a hex value for a color or
39+
:param list points: A list of (x, y) tuples of the points
40+
:param int outline: (Optional) The outline of the polygon. Can be a hex value for a color or
4141
``None`` for no outline.
4242
"""
4343

adafruit_display_shapes/rect.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@
3535
class Rect(displayio.TileGrid):
3636
"""A rectangle.
3737
38-
:param x: The x-position of the top left corner.
39-
:param y: The y-position of the top left corner.
40-
:param width: The width of the rectangle.
41-
:param height: The height of the rectangle.
42-
:param fill: The color to fill the rectangle. Can be a hex value for a color or
43-
``None`` for transparent.
44-
:param outline: The outline of the rectangle. Can be a hex value for a color or
38+
:param int x: The x-position of the top left corner.
39+
:param int y: The y-position of the top left corner.
40+
:param int width: The width of the rectangle.
41+
:param int height: The height of the rectangle.
42+
:param int fill: (Optional) The color to fill the rectangle. Can be a hex value for a color or
43+
``None`` for transparent.
44+
:param int outline: (Optional) The outline of the rectangle. Can be a hex value for a color or
4545
``None`` for no outline.
46-
:param stroke: Used for the outline. Will not change the outer bound size set by ``width`` and
47-
``height``.
46+
:param int stroke: Used for the outline. Will not change the outer bound size set by ``width``
47+
and ``height``.
4848
4949
"""
5050

adafruit_display_shapes/roundrect.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ class RoundRect(displayio.TileGrid):
2626
# pylint: disable=too-many-arguments
2727
"""A round-corner rectangle.
2828
29-
:param x: The x-position of the top left corner.
30-
:param y: The y-position of the top left corner.
31-
:param width: The width of the rounded-corner rectangle.
32-
:param height: The height of the rounded-corner rectangle.
33-
:param r: The radius of the rounded corner.
34-
:param fill: The color to fill the rounded-corner rectangle. Can be a hex value for a color or
35-
``None`` for transparent.
36-
:param outline: The outline of the rounded-corner rectangle. Can be a hex value for a color or
37-
``None`` for no outline.
38-
:param stroke: Used for the outline. Will not change the outer bound size set by ``width`` and
39-
``height``.
29+
:param int x: The x-position of the top left corner.
30+
:param int y: The y-position of the top left corner.
31+
:param int width: The width of the rounded-corner rectangle.
32+
:param int height: The height of the rounded-corner rectangle.
33+
:param int r: The radius of the rounded corner.
34+
:param int fill: (Optional) The color to fill the rounded-corner rectangle. Can be a hex value
35+
for a color or ``None`` for transparent.
36+
:param int outline: (Optional) The outline of the rounded-corner rectangle. Can be a hex value
37+
for a color or ``None`` for no outline.
38+
:param int stroke: Used for the outline. Will not change the outer bound size set by ``width``
39+
and ``height``.
4040
4141
"""
4242

adafruit_display_shapes/sparkline.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@ class Sparkline(displayio.Group):
5151
# pylint: disable=too-many-arguments
5252
"""A sparkline graph.
5353
54-
:param width: Width of the sparkline graph in pixels
55-
:param height: Height of the sparkline graph in pixels
56-
:param max_items: Maximum number of values housed in the sparkline
57-
:param dyn_xpitch: dynamically change xpitch (True)
58-
:param y_min: Lower range for the y-axis. Set to None for autorange.
59-
:param y_max: Upper range for the y-axis. Set to None for autorange.
60-
:param x: X-position on the screen, in pixels
61-
:param y: Y-position on the screen, in pixels
62-
:param color: Line color, the default value is 0xFFFFFF (WHITE)
54+
:param int width: Width of the sparkline graph in pixels
55+
:param int height: Height of the sparkline graph in pixels
56+
:param int max_items: Maximum number of values housed in the sparkline
57+
:param bool dyn_xpitch: (Optional) Dynamically change xpitch (True)
58+
:param int y_min: (Optional) Lower range for the y-axis. Set to None for autorange.
59+
:param int y_max: (Optional) Upper range for the y-axis. Set to None for autorange.
60+
:param int x: X-position on the screen, in pixels
61+
:param int y: Y-position on the screen, in pixels
62+
:param int color: Line color, the default value is 0xFFFFFF (WHITE)
6363
6464
Note: If dyn_xpitch is True (default), the sparkline will allways span
6565
the complete width. Otherwise, the sparkline will grow when you
@@ -113,8 +113,8 @@ def clear_values(self) -> None:
113113
def add_value(self, value: float, update: bool = True) -> None:
114114
"""Add a value to the sparkline.
115115
116-
:param value: The value to be added to the sparkline
117-
:param update: trigger recreation of primitives
116+
:param float value: The value to be added to the sparkline
117+
:param bool update: trigger recreation of primitives
118118
119119
Note: when adding multiple values it is more efficient to call
120120
this method with parameter 'update=False' and then to manually

adafruit_display_shapes/triangle.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ class Triangle(Polygon):
3636
# pylint: disable=too-many-arguments,invalid-name
3737
"""A triangle.
3838
39-
:param x0: The x-position of the first vertex.
40-
:param y0: The y-position of the first vertex.
41-
:param x1: The x-position of the second vertex.
42-
:param y1: The y-position of the second vertex.
43-
:param x2: The x-position of the third vertex.
44-
:param y2: The y-position of the third vertex.
45-
:param fill: The color to fill the triangle. Can be a hex value for a color or
46-
``None`` for transparent.
47-
:param outline: The outline of the triangle. Can be a hex value for a color or
39+
:param int x0: The x-position of the first vertex.
40+
:param int y0: The y-position of the first vertex.
41+
:param int x1: The x-position of the second vertex.
42+
:param int y1: The y-position of the second vertex.
43+
:param int x2: The x-position of the third vertex.
44+
:param int y2: The y-position of the third vertex.
45+
:param int fill: (Optional) The color to fill the triangle. Can be a hex value for a color or
46+
``None`` for transparent.
47+
:param int outline: (Optional) The outline of the triangle. Can be a hex value for a color or
4848
``None`` for no outline.
4949
"""
5050
# pylint: disable=too-many-locals

0 commit comments

Comments
 (0)