Skip to content

Conversation

ndgrigorian
Copy link
Collaborator

@ndgrigorian ndgrigorian commented Jun 6, 2025

This PR proposes an implementation for isin, a function likely coming to a future array API specification, which leverages a similar kernel to the implementation of searchsorted

This implementation uses the searchsorted kernel to check if the value has a position in the array. If that position is the number of elements in the array, it is not a member. Otherwise, if arr[pos] == val for some array arr being searched for value val, then val is a member.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

Copy link

github-actions bot commented Jun 6, 2025

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Copy link

github-actions bot commented Jun 6, 2025

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_8 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@coveralls
Copy link
Collaborator

coveralls commented Jun 6, 2025

Coverage Status

coverage: 85.262% (+0.05%) from 85.208%
when pulling 68bc84e on feature/searchsorted-based-isin
into 3091e5b on master.

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from 1805102 to 5355fb8 Compare June 6, 2025 22:41
Copy link

github-actions bot commented Jun 6, 2025

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_10 ran successfully.
Passed: 1114
Failed: 7
Skipped: 119

@ndgrigorian
Copy link
Collaborator Author

@antonwolfy
implementation is updated and now permits Python scalars in second argument

tests still need to be added, but isin itself is ready for review

@ndgrigorian ndgrigorian marked this pull request as ready for review June 11, 2025 22:15
@ndgrigorian ndgrigorian requested a review from antonwolfy June 11, 2025 22:20
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_17 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_18 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_22 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_23 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian requested a review from antonwolfy June 17, 2025 06:24
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_24 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from b3822f3 to f7e0967 Compare June 17, 2025 07:40
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_23 ran successfully.
Passed: 1116
Failed: 5
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_24 ran successfully.
Passed: 1112
Failed: 9
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from 8f19cb5 to 3cf7445 Compare June 17, 2025 21:32
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_26 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from 3cf7445 to 7c6a4be Compare June 17, 2025 22:20
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_27 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_30 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from 16c63e4 to 23c61a8 Compare June 18, 2025 20:06
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_35 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_58 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from a8d9474 to 62a9fa4 Compare September 17, 2025 17:16
Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_153 ran successfully.
Passed: 1116
Failed: 5
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_157 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian force-pushed the feature/searchsorted-based-isin branch from b61f09e to 1ac19ae Compare September 17, 2025 20:14
antonwolfy
antonwolfy previously approved these changes Sep 17, 2025
Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

Thank you @ndgrigorian, no more comments from me

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_158 ran successfully.
Passed: 1114
Failed: 7
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_158 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

Copy link

Array API standard conformance tests for dpctl=0.21.0dev0=py310h93fe807_161 ran successfully.
Passed: 1115
Failed: 6
Skipped: 119

@ndgrigorian ndgrigorian merged commit 878cc19 into master Sep 17, 2025
85 of 99 checks passed
@ndgrigorian ndgrigorian deleted the feature/searchsorted-based-isin branch September 17, 2025 23:17
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