Skip to content

Commit d5ae3f1

Browse files
authored
Merge pull request #24 from kmatch98/master
Fix documentation errors
2 parents c6fe417 + aefdd6f commit d5ae3f1

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

adafruit_display_shapes/sparkline.py

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040

4141
class Sparkline(displayio.Group):
4242
# pylint: disable=too-many-arguments
43-
""" A sparkline graph.
44-
45-
: param width: Width of the sparkline graph in pixels
46-
: param height: Height of the sparkline graph in pixels
47-
: param max_items: Maximum number of values housed in the sparkline
48-
: param y_min: Lower range for the y-axis. Set to None for autorange.
49-
: param y_max: Upper range for the y-axis. Set to None for autorange.
50-
: param x: X-position on the screen, in pixels
51-
: param y: Y-position on the screen, in pixels
52-
: param color: Line color, the default value is 0xFFFFFF (WHITE)
43+
"""A sparkline graph.
44+
45+
:param width: Width of the sparkline graph in pixels
46+
:param height: Height of the sparkline graph in pixels
47+
:param max_items: Maximum number of values housed in the sparkline
48+
:param y_min: Lower range for the y-axis. Set to None for autorange.
49+
:param y_max: Upper range for the y-axis. Set to None for autorange.
50+
:param x: X-position on the screen, in pixels
51+
:param y: Y-position on the screen, in pixels
52+
:param color: Line color, the default value is 0xFFFFFF (WHITE)
5353
"""
5454

5555
def __init__(
@@ -86,8 +86,8 @@ def __init__(
8686
) # self is a group of lines
8787

8888
def add_value(self, value):
89-
""" Add a value to the sparkline.
90-
: param value: The value to be added to the sparkline
89+
"""Add a value to the sparkline.
90+
:param value: The value to be added to the sparkline
9191
"""
9292

9393
if value is not None:
@@ -123,9 +123,7 @@ def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top):
123123
# pylint: disable= too-many-branches, too-many-nested-blocks
124124

125125
def update(self):
126-
"""Update the drawing of the sparkline
127-
128-
"""
126+
"""Update the drawing of the sparkline."""
129127

130128
# get the y range
131129
if self.y_min is None:
@@ -212,7 +210,6 @@ def update(self):
212210
last_value = value # store value for the next iteration
213211

214212
def values(self):
215-
"""Returns the values displayed on the sparkline
216-
"""
213+
"""Returns the values displayed on the sparkline."""
217214

218215
return self._spark_list

examples/display_shapes_sparkline_ticks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
import board
3232
import displayio
3333
import terminalio
34+
from adafruit_display_text import label
3435
from adafruit_display_shapes.sparkline import Sparkline
3536
from adafruit_display_shapes.line import Line
3637
from adafruit_display_shapes.rect import Rect
37-
from adafruit_display_text import label
38+
3839

3940
if "DISPLAY" not in dir(board):
4041
# Setup the LCD display with driver

examples/display_shapes_sparkline_triple.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
import board
3232
import displayio
3333
import terminalio
34-
from adafruit_display_shapes.sparkline import Sparkline
3534
from adafruit_display_text import label
35+
from adafruit_display_shapes.sparkline import Sparkline
36+
3637

3738
if "DISPLAY" not in dir(board):
3839
# Setup the LCD display with driver

0 commit comments

Comments
 (0)