Skip to content

"native" numpy integration - #2

Open
shadoxxhd wants to merge 4 commits into
lbt:masterfrom
shadoxxhd:substrip3
Open

"native" numpy integration#2
shadoxxhd wants to merge 4 commits into
lbt:masterfrom
shadoxxhd:substrip3

Conversation

@shadoxxhd

Copy link
Copy Markdown

This integration includes some breaking changes to the existing substrip interface, which to me seem more natural. If minimally disruptive numpy integration was preferred, my "substrip2" branch might be better suited (if desired, I'll make a pull request for that one).

@shadoxxhd

Copy link
Copy Markdown
Author

breaking changes:

  • __getitem__ returns numpy arrays instead of lists for slice indices
  • getPixels returns a numpy view (reference) to the LED data, instead of a copied list
  • createPixelSubStrip uses slice()-like arguments, instead of start,stop,num (or a passed slice object)
  • the PixelSubStrip constructor only takes slice objects as substrip extent specification, and offloads index validation to numpy, resulting in different Exception strings
  • getPixelColor* functions return numpy arrays instead of lists for slice indices

the substrip2 branch also returns numpy arrays instead of lists, but keeps the original arguments/validation logic of the PixelSubStrip constructor, but that could be trivially reverted with return type checks/conversions

@shadoxxhd

Copy link
Copy Markdown
Author

compared to my original pull request, this is based on your force-pushed changes

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.

1 participant