Skip to content

MAINT Remove scalar manipulation in consine_distances now clip fixed in array-api-compat #31171

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

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

lucyleeow
Copy link
Member

Reference Issues/PRs

data-apis/array-api-compat#177 has been fixed for a while and there has been a more recent release so I think this todo can be removed now.

cc @ogrisel

What does this implement/fix? Explain your changes.

Any other comments?

Copy link

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 67f083f. Link to the linter CI: here

@lucyleeow lucyleeow changed the title MAINT Remove scalar manipulation now clip fixed in array-api-compat MAINT Remove scalar manipulation in consine_distances now clip fixed in array-api-compat Apr 11, 2025
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

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

The fixes are in our vendored copy:

# At least handle the case of Python integers correctly (see
# https://github.com/numpy/numpy/pull/26892).
if wrapped_xp.isdtype(x.dtype, "integral"):
if type(min) is int and min <= wrapped_xp.iinfo(x.dtype).min:
min = None
if type(max) is int and max >= wrapped_xp.iinfo(x.dtype).max:
max = None

For this PR, LGTM

Copy link
Member

@jeremiedbb jeremiedbb 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 clean-up

@jeremiedbb jeremiedbb merged commit d0ca47b into scikit-learn:main Apr 11, 2025
40 checks passed
@lucyleeow lucyleeow deleted the cosine_todo branch April 11, 2025 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants