-
Notifications
You must be signed in to change notification settings - Fork 100
Update to new build process and turn on lint. #18
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
Conversation
This introduces a minor change to the constructor API because the kwargs now must be keywords and not positional. I haven't tested these changes on device yet. Please only merge you test it or I follow up later to say its tested. For adafruit/circuitpython#475
self._brightness = min(max(brightness, 0.0), 1.0) | ||
|
||
def fill(self, color): | ||
"""Colors all pixels the given ***color***.""" | ||
auto_write = self.auto_write | ||
self.auto_write = False | ||
for i in range(len(self)): | ||
for i, _ in enumerate(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful, enumerate needs to be explicitly turned on for certain MicroPython builds (with a config header bit change). The safest and most universal code here is iterating with range.
Good catch! Would you be ok with using enumerate if I make the
tests/basics/enumerate.py test always run for us instead of checking for
its existence? It looks we always enable it in atmel-samd already.
…On Thu, Dec 7, 2017 at 4:58 PM Tony DiCola ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In neopixel.py
<#18 (comment)>
:
> self._brightness = min(max(brightness, 0.0), 1.0)
def fill(self, color):
"""Colors all pixels the given ***color***."""
auto_write = self.auto_write
self.auto_write = False
- for i in range(len(self)):
+ for i, _ in enumerate(self):
Be careful, enumerate needs to be explicitly turned on for certain
MicroPython builds (with a config header bit change). The safest and most
universal code here is iterating with range.
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#18 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADNqVDAJ5rSYOAZjY4frA3ZyfEAdPz5ks5s-InJgaJpZM4Q6auh>
.
|
FYI @microbuilder from discussion we're taking this change to the neopixel library but it looks like the nRF52 port in progress doesn't have the enumerate function turned on. Like mentioned above this means this updated neopixel library will now fail to run. It's an easy 1 line header fix to turn on enumerate in the nRF52 port though--check with @tannewt |
include it and therefore support our drivers that use it. Related to adafruit/Adafruit_CircuitPython_NeoPixel#18
Looks good! Tested successfully on 2.x. Merging. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADS1x15 to 0.2.0 from 0.1.0: > Merge pull request adafruit/Adafruit_CircuitPython_ADS1x15#4 from tannewt/lint > Merge pull request adafruit/Adafruit_CircuitPython_ADS1x15#3 from mrmcwethy/updatebundle Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel to 3.0.0 from 2.0.0: > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#18 from chickadee-tech/lint > Switch files for new build process.
This introduces a minor change to the constructor API because the kwargs now must be keywords and not positional.
I haven't tested these changes on device yet. Please only merge you test it or I follow up later to say its tested.
For adafruit/circuitpython#475