From eadaf9fb541abbcd98df8ab5030a6923666e079e Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 9 Sep 2020 09:24:39 -0500 Subject: [PATCH 1/5] Correct errors in documentation strings (delete excess spaces) --- adafruit_display_shapes/sparkline.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/adafruit_display_shapes/sparkline.py b/adafruit_display_shapes/sparkline.py index a80e87a..acbba55 100644 --- a/adafruit_display_shapes/sparkline.py +++ b/adafruit_display_shapes/sparkline.py @@ -42,14 +42,14 @@ class Sparkline(displayio.Group): # pylint: disable=too-many-arguments """ A sparkline graph. - : param width: Width of the sparkline graph in pixels - : param height: Height of the sparkline graph in pixels - : param max_items: Maximum number of values housed in the sparkline - : param y_min: Lower range for the y-axis. Set to None for autorange. - : param y_max: Upper range for the y-axis. Set to None for autorange. - : param x: X-position on the screen, in pixels - : param y: Y-position on the screen, in pixels - : param color: Line color, the default value is 0xFFFFFF (WHITE) + :param width: Width of the sparkline graph in pixels + :param height: Height of the sparkline graph in pixels + :param max_items: Maximum number of values housed in the sparkline + :param y_min: Lower range for the y-axis. Set to None for autorange. + :param y_max: Upper range for the y-axis. Set to None for autorange. + :param x: X-position on the screen, in pixels + :param y: Y-position on the screen, in pixels + :param color: Line color, the default value is 0xFFFFFF (WHITE) """ def __init__( @@ -87,7 +87,7 @@ def __init__( def add_value(self, value): """ Add a value to the sparkline. - : param value: The value to be added to the sparkline + :param value: The value to be added to the sparkline """ if value is not None: @@ -212,7 +212,6 @@ def update(self): last_value = value # store value for the next iteration def values(self): - """Returns the values displayed on the sparkline - """ + """Returns the values displayed on the sparkline""" return self._spark_list From 620f04c1b7c28e8dd405c1d4a97f69a058c2f61f Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 9 Sep 2020 09:26:03 -0500 Subject: [PATCH 2/5] Add missing period. --- adafruit_display_shapes/sparkline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_display_shapes/sparkline.py b/adafruit_display_shapes/sparkline.py index acbba55..181f4bd 100644 --- a/adafruit_display_shapes/sparkline.py +++ b/adafruit_display_shapes/sparkline.py @@ -212,6 +212,6 @@ def update(self): last_value = value # store value for the next iteration def values(self): - """Returns the values displayed on the sparkline""" + """Returns the values displayed on the sparkline.""" return self._spark_list From 90e617a2469a6dcc820acc21eba2a5cd5aec7bea Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 9 Sep 2020 09:27:37 -0500 Subject: [PATCH 3/5] Add missing period. --- adafruit_display_shapes/sparkline.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/adafruit_display_shapes/sparkline.py b/adafruit_display_shapes/sparkline.py index 181f4bd..d0e6ff3 100644 --- a/adafruit_display_shapes/sparkline.py +++ b/adafruit_display_shapes/sparkline.py @@ -123,9 +123,7 @@ def _plotline(self, x_1, last_value, x_2, value, y_bottom, y_top): # pylint: disable= too-many-branches, too-many-nested-blocks def update(self): - """Update the drawing of the sparkline - - """ + """Update the drawing of the sparkline.""" # get the y range if self.y_min is None: From b6a86326b64be03993fa5aa414b4d6c56d89489f Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 9 Sep 2020 10:10:57 -0500 Subject: [PATCH 4/5] Ran black, fixed pylint import error in examples --- adafruit_display_shapes/sparkline.py | 4 ++-- examples/display_shapes_sparkline_ticks.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/adafruit_display_shapes/sparkline.py b/adafruit_display_shapes/sparkline.py index d0e6ff3..83de076 100644 --- a/adafruit_display_shapes/sparkline.py +++ b/adafruit_display_shapes/sparkline.py @@ -40,7 +40,7 @@ class Sparkline(displayio.Group): # pylint: disable=too-many-arguments - """ A sparkline graph. + """A sparkline graph. :param width: Width of the sparkline graph in pixels :param height: Height of the sparkline graph in pixels @@ -86,7 +86,7 @@ def __init__( ) # self is a group of lines def add_value(self, value): - """ Add a value to the sparkline. + """Add a value to the sparkline. :param value: The value to be added to the sparkline """ diff --git a/examples/display_shapes_sparkline_ticks.py b/examples/display_shapes_sparkline_ticks.py index cdafbfb..59fe606 100755 --- a/examples/display_shapes_sparkline_ticks.py +++ b/examples/display_shapes_sparkline_ticks.py @@ -31,10 +31,11 @@ import board import displayio import terminalio +from adafruit_display_text import label from adafruit_display_shapes.sparkline import Sparkline from adafruit_display_shapes.line import Line from adafruit_display_shapes.rect import Rect -from adafruit_display_text import label + if "DISPLAY" not in dir(board): # Setup the LCD display with driver From aefdd6ff9b6cb8580248cbb01501eeb0efeadd10 Mon Sep 17 00:00:00 2001 From: Kevin Matocha Date: Wed, 9 Sep 2020 10:13:51 -0500 Subject: [PATCH 5/5] Fix pylint import sequence --- examples/display_shapes_sparkline_triple.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/display_shapes_sparkline_triple.py b/examples/display_shapes_sparkline_triple.py index f58a99d..ba8d774 100755 --- a/examples/display_shapes_sparkline_triple.py +++ b/examples/display_shapes_sparkline_triple.py @@ -31,8 +31,9 @@ import board import displayio import terminalio -from adafruit_display_shapes.sparkline import Sparkline from adafruit_display_text import label +from adafruit_display_shapes.sparkline import Sparkline + if "DISPLAY" not in dir(board): # Setup the LCD display with driver