Skip to content

Add tail_length exception, update example imports. #22

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

Merged
merged 9 commits into from
May 18, 2020

Conversation

kattni
Copy link
Contributor

@kattni kattni commented May 18, 2020

Added exception for tail_length on Comet animation - if it was too long before, it failed with a slicing error on the line containing animations.animate() which was incredibly cryptic.

No idea why I thought I needed to make the example imports and usage more verbose. Thanks @dhalbert for noticing this.

@kattni
Copy link
Contributor Author

kattni commented May 18, 2020

Looking into fixing the Pylint failure with now setting tail_length = None.

@dhalbert
Copy link
Contributor

I forgot to note that you would revise the tail_length documentation, probably leaving out printing its value, etc.

@dhalbert
Copy link
Contributor

pylint should notice that self._tail_length cannot be None. Maybe if we removed the intermediate variable (I have not tried this.

        if tail_length is None:
            self._tail_length = int(len(pixel_object) / 4)
        else:
            self._tail_length = max(2, min(tail_length, len(pixel_object)))
        self._color_step = 0.9 / self._tail_length	

@kattni kattni requested a review from dhalbert May 18, 2020 19:46
Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

Yay!

@kattni kattni merged commit cb18147 into adafruit:master May 18, 2020
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 19, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS1841 to 1.0.2 from 1.0.1:
  > fixing blinka example
  > Merge pull request adafruit/Adafruit_CircuitPython_DS1841#2 from adafruit/pylint-update
  > build.yml: add black formatting check

Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.9.3 from 3.9.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#80 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#79 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_BluefruitConnect to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BluefruitConnect#21 from caternuson/example_update

Updating https://github.com/adafruit/Adafruit_CircuitPython_framebuf to 1.3.2 from 1.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_framebuf#32 from xdmtk/xdmtk-patch/font-bug

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#22 from kattni/comet-tail-exception

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 2.2.2 from 2.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyBadger#32 from FoamyGuy/button_debouncer_example
@kattni kattni deleted the comet-tail-exception branch November 3, 2021 20:51
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