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

Update ulab #2992

Merged
merged 8 commits into from
Jun 1, 2020
Merged

Update ulab #2992

merged 8 commits into from
Jun 1, 2020

Conversation

jepler
Copy link
Member

@jepler jepler commented Jun 1, 2020

This gets us

  • the new "approx" submodule
  • the new "equal / not_equal" predicates (since we can't do array == array due to technical limitations)
  • vectorise() for vectori(s/z)ing arbitrary Python functions with reasonably good performance

The specific submodule ref is in a pending PR v923z/micropython-ulab#122 so it should not be merged while that PR is not resolved.

@v923z
Copy link

v923z commented Jun 1, 2020

This gets us

* the new "approx" submodule

* the new "equal / not_equal" predicates (since we can't do `array == array` due to technical limitations)

* vectorise() for vectori(s/z)ing arbitrary Python functions with reasonably good performance

This is definitely vectorize(). Since it was an original numpy function, I stuck with the American spelling:)

The specific submodule ref is in a pending PR v923z/micropython-ulab#122 so it should not be merged while that PR is not resolved.

The sub-module itself has been in master for approx. (pun intended) two weeks now.

@jepler
Copy link
Member Author

jepler commented Jun 1, 2020

The specific submodule ref is in a pending PR v923z/micropython-ulab#122 so it should not be merged while that PR is not resolved.

The sub-module itself has been in master for approx. (pun intended) two weeks now.

Overloaded terms. I mean to say, the git submodule ref for extmod/ulab is in the non-merged PR v923z/micropython-ulab#122.

@jepler jepler marked this pull request as ready for review June 1, 2020 19:47
@jepler jepler requested a review from tannewt June 1, 2020 19:47
@tannewt
Copy link
Member

tannewt commented Jun 1, 2020

Why can't we do == and !=? We shouldn't introduce a new API just because we can't match MicroPython or CPython.

@jepler
Copy link
Member Author

jepler commented Jun 1, 2020

equal and not_equal are in numpy. https://numpy.org/doc/stable/reference/generated/numpy.not_equal.html

However, on some more full implementations of Python, == and != can be used for this functionality as well (I think there may be a minor difference in how non-finite values are handled)

tannewt
tannewt previously approved these changes Jun 1, 2020
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for the update!

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Good! Thank you!

@tannewt tannewt merged commit e889287 into adafruit:master Jun 1, 2020
@v923z
Copy link

v923z commented Jun 2, 2020

Why can't we do == and !=? We shouldn't introduce a new API just because we can't match MicroPython or CPython.

@tannewt Here is what you need for the ==, and != operators to work: micropython#5593

I am not emotionally attached to the equal, and not_equal functions, so if you want, we can remove them. It was more like a temporary measure for circuitpython. As far as I remember, it was specifically a user request.

@tannewt
Copy link
Member

tannewt commented Jun 2, 2020

Thanks @v923z. I opened #2999 for reasons to merge upstream 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.

3 participants