Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customcolorschase #51

Merged
merged 20 commits into from
Jun 22, 2020
Merged

Customcolorschase #51

merged 20 commits into from
Jun 22, 2020

Conversation

cjsieh
Copy link

@cjsieh cjsieh commented Jun 15, 2020

Allow for a list of colors to be used with the Chase animation. New animation CustomColorsChase is provided with example. Issue#50 .

cjsieh added 7 commits June 14, 2020 18:50
Add ability to select custom colors for chase animation
Added CustomColorChase example.  Updated All example with new CustomColorChase
Changed from customcolorchase to customcolorschase
Changed from customcolorchase to customcolorschase
Changed example CustomColorChase to CustomColorsChase
Change from CustomColorChase to CustomColorsChase
changed from customcolorchase to customcolorschase
@ladyada ladyada requested a review from kattni June 15, 2020 16:57
fixed spaces before/after parameters
cjsieh added 3 commits June 15, 2020 13:37
reformatted via black
reformatted via black
fixed "line too long" as indicated by pylint
@kattni
Copy link
Contributor

kattni commented Jun 18, 2020

I am working on reviewing your code. The current Pylint failure is not in your code. I am submitting a PR with the fix.

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested these successfully with a Neopixel Featherwing, and with a 30 pixel strip. Really neat animation, thank you for adding it @cjsieh!

Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, @cjsieh! Thanks so much for contributing this animation. I've tested it and it works successfully. There are a few changes I'd like to see before we merge it. Please see the suggestions below. Note: I committed a fix to a separate file that was causing Pylint to fail on a file you had not edited. The new Pylint failure is addressed in the comments below. Make sure you update your local version sequence.py to match the new version in the PR.

With the new example, I think it would be better to choose some other nice color combinations and include them without themed names.

Let me know if you need any assistance with any of the changes. I'm happy to help!

# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
"""
`adafruit_led_animation.animation.rainbowchase`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated to match the module name, e.g. adafruit_led_animation.animation.customcolorchase.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

`adafruit_led_animation.animation.rainbowchase`
================================================================================

Rainbow chase animation for CircuitPython helper library for LED animations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated to describe the module, e.g. Custom color chase animation for CircuitPython helper library for LED animations..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

from adafruit_led_animation.color import RAINBOW


class CustomColorsChase(Chase):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class names are typically singular. Please update this to CustomColorChase. This will also require updating all subsequent use of the class name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

Comment on lines 28 to 31
# Patriotic
custom_colors_chase_rwb = CustomColorsChase(
pixels, speed=0.1, colors=[RED, WHITE, BLUE], size=2, spacing=3
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a worldwide community and want everyone to feel welcome and included. Including this color combination under this name limits the scope of the example to the US, and could create a situation where users from elsewhere in the world, or even in the US, feel excluded. In light of the current climate, I feel it should be removed altogether.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

custom_colors_chase_rwb = CustomColorsChase(
pixels, speed=0.1, colors=[RED, WHITE, BLUE], size=2, spacing=3
)
# St Pat Day
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Associating these color combinations with holidays could be exclusionary as some do not celebrate them. The colors are fine, but please remove the holiday themed comments.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

)

# colors default to RAINBOW
custom_colors_chase_rainbow = CustomColorsChase(pixels, speed=0.1, size=2, spacing=3)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would update this to custom_color_chase_rainbow - removing the s from colors to match the class rename. Same suggestion goes for all instances of custom_colors in this example.

@@ -43,6 +44,9 @@
rainbow_comet = RainbowComet(pixels, speed=0.1, tail_length=7, bounce=True)
rainbow_chase = RainbowChase(pixels, speed=0.1, size=3, spacing=2, step=8)
rainbow_sparkle = RainbowSparkle(pixels, speed=0.1, num_sparkles=15)
custom_colors_chase = CustomColorsChase(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call this custom_color_chase to match the class rename. (As well, the class name will need to be updated.)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@@ -57,6 +61,7 @@
rainbow_comet,
sparkle_pulse,
rainbow_chase,
custom_colors_chase,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this to match, e.g. custom_color_chase.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

@@ -0,0 +1,61 @@
"""
This example displays the basic animations in sequence, at a five second interval.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment needs to be updated to describe the new example.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


from adafruit_led_animation.animation.customcolorschase import CustomColorsChase
from adafruit_led_animation.sequence import AnimationSequence
from adafruit_led_animation.color import PINK, PURPLE, GREEN, RED, WHITE, BLUE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PURPLE is not used. If you do not intend to use it, please remove it from the imports.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

cjsieh added 8 commits June 19, 2020 21:22
remove references to rainbowchase.  Change customcolorschase to customcolorchase.
put in wrong place
Changed references to rainbowchase.  Changed from CustomColorsChase to CustomColorChase
changed from customcolorschase to customcolorchase
change from CustomColorsChase to CustomColorChase
changed from ccustomcolorschase to customcolorchase
prefixed "black" formating
fixed description
removed reference to advance_on_cycle_complete as not used now
Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates!

@kattni kattni merged commit 3dbe521 into adafruit:master Jun 22, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 23, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM9x to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_RFM9x#45 from jerryneedell/jerryn_size

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.3.1 from 2.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#51 from cjsieh/customcolorchase
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#52 from kattni/sequence-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 3.1.1 from 3.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#41 from brentru/example-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_NTP to 2.1.0 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_NTP#11 from theelectricmayhem/patch-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants