Skip to content

Commit 6f17a43

Browse files
committed
Update Aggregate and Subset naming.
1 parent cd7783f commit 6f17a43

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

adafruit_led_animation/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The MIT License (MIT)
22
#
3-
# Copyright (c) 2020 Kattni Rembor for Adafruit Industries
3+
# Copyright (c) 2020 Roy Hooper
44
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal

adafruit_led_animation/animation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# The MIT License (MIT)
22
#
3-
# Copyright (c) 2019 Kattni Rembor for Adafruit Industries
3+
# Copyright (c) 2019-2020 Roy Hooper
4+
# Copyright (c) 2020 Kattni Rembor for Adafruit Industries
45
#
56
# Permission is hereby granted, free of charge, to any person obtaining a copy
67
# of this software and associated documentation files (the "Software"), to deal
@@ -353,7 +354,7 @@ def reset(self):
353354

354355
class RainbowComet(Comet):
355356
"""
356-
A comet animation.
357+
A rainbow comet animation.
357358
358359
:param pixel_object: The initialised LED object.
359360
:param float speed: Animation speed in seconds, e.g. ``0.1``.

adafruit_led_animation/helper.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The MIT License (MIT)
22
#
3-
# Copyright (c) 2019 Kattni Rembor for Adafruit Industries
3+
# Copyright (c) 2019 Roy Hooper
44
#
55
# Permission is hereby granted, free of charge, to any person obtaining a copy
66
# of this software and associated documentation files (the "Software"), to deal
@@ -47,9 +47,9 @@
4747
from . import NANOS_PER_SECOND, monotonic_ns
4848

4949

50-
class AggregatePixels:
50+
class PixelMap:
5151
"""
52-
AggregatePixels lets you treat ranges of pixels as single pixels for animation purposes.
52+
PixelMap lets you treat ranges of pixels as single pixels for animation purposes.
5353
5454
:param strip: An object that implements the Neopixel or Dotstar protocol.
5555
:param iterable pixel_ranges: Pixel ranges (or individual pixels).
@@ -59,10 +59,10 @@ class AggregatePixels:
5959
6060
import board
6161
import neopixel
62-
from adafruit_led_animation.helper import AggregatePixels
62+
from adafruit_led_animation.helper import PixelMap
6363
pixels = neopixel.NeoPixel(board.D12, 307, auto_write=False)
6464
65-
tree = AggregatePixels(pixels, [
65+
tree = PixelMap(pixels, [
6666
(0, 21), (21, 48), (48, 71), (71, 93),(93, 115), (115, 135), (135, 153),
6767
(153, 170), (170, 188), (188, 203), (203, 217), (217, 228), (228, 240),
6868
(240, 247), (247, 253), (253, 256), (256, 260), (260, 307)]
@@ -135,7 +135,7 @@ def brightness(self, brightness):
135135
def fill(self, color):
136136
"""
137137
Fill the used pixel ranges with color.
138-
:param color: Color to fill all pixels referenced by this AggregatePixels definition with.
138+
:param color: Color to fill all pixels referenced by this PixelMap definition with.
139139
"""
140140
if self._individual_pixels:
141141
for pixels in self._ranges:
@@ -163,9 +163,9 @@ def auto_write(self, value):
163163
self._pixels.auto_write = value
164164

165165

166-
class SubsetPixels:
166+
class PixelSubset:
167167
"""
168-
SubsetPixels lets you work with a subset of a pixel object.
168+
PixelSubset lets you work with a subset of a pixel object.
169169
170170
:param strip: An object that implements the Neopixel or Dotstar protocol.
171171
:param int start: Starting pixel number.
@@ -175,11 +175,11 @@ class SubsetPixels:
175175
176176
import board
177177
import neopixel
178-
from adafruit_led_animation.helper import SubsetPixels
178+
from adafruit_led_animation.helper import PixelSubset
179179
pixels = neopixel.NeoPixel(board.D12, 307, auto_write=False)
180180
181181
star_start = 260
182-
star_arm = SubsetPixels(pixels, star_start + 7, star_start + 15)
182+
star_arm = PixelSubset(pixels, star_start + 7, star_start + 15)
183183
star_arm.fill((255, 0, 255))
184184
pixels.show()
185185
"""

0 commit comments

Comments
 (0)