-
Notifications
You must be signed in to change notification settings - Fork 20
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
ENH: add less ufunc #150
base: main
Are you sure you want to change the base?
ENH: add less ufunc #150
Conversation
* draft the `less()` ufunc and turn its array API standard test on in CI * some of the changes here are modified/copied from other recent binary ufunc pull requests, like the broadcasting and type matching machinery; type matching in particular was expanded to include floating types, at least crudely * there are probably some formatting improvements that could be made for some of the ufunc workunits added here--feel free to push those in--some of that work is basically just find/replace in text editor...
def astype(view, dtype): | ||
new_view = pk.View([*view.shape], dtype=dtype) | ||
new_view[:] = view | ||
return new_view |
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.
was needed by the array API testing machinery for less()
def less_impl_5d_int8(tid: int, | ||
view1: pk.View5D[pk.int8], | ||
view2: pk.View5D[pk.int8], | ||
out: pk.View5D[pk.uint8]): |
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.
column-alignment could be cleaned up--feel free to help me with that... wasn't a high priority of course
view1_new = pk.View([*view1.shape], dtype=effective_dtype) | ||
view1_new[:] = view1 | ||
view1 = view1_new | ||
return view1, view2, effective_dtype |
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.
above two functions show up in some of my other binary ufunc branches/PRs, they may be slightly different here to accommodate expanding needs
* handle a few more dtype styles in `_typematch_views()`, which seem to be needed for the array API testsuite to pass with newer versions of `hypothesis`
* use properly sized integer types for `__lt__` comparisons
* adjust the `greater()` ufunc to pass its array API standard test, and turn this test on in the CI * this largely mirrors the changes in kokkosgh-150, except that we already had a draft implementation of `greater()` in place here
* add the `less_equal()` ufunc and turn its array API standard test on in the CI; this is naturally quite similar to kokkosgh-150
draft the
less()
ufunc and turn its array API standard test on in CIsome of the changes here are modified/copied from other recent binary ufunc pull requests, like the
broadcasting and type matching machinery; type matching in particular was expanded to include floating types, at least crudely
there are probably some formatting improvements that could be made for some of the ufunc workunits added here--feel free to push those in--some of that work is basically just find/replace in text editor...