Skip to content

MNT Avoid nested sequence in weighted_percentile #31211

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 29, 2025

Conversation

lucyleeow
Copy link
Member

Reference Issues/PRs

Use xp.stack instead of xp.asarray with a nested sequence of arrays - see data-apis/array-api-strict#147 - in weighted_percentile

I think this still gives the correct dtype and device of the output.

What does this implement/fix? Explain your changes.

Any other comments?

cc @ev-br and @ogrisel @betatim who reviewed the original PR

Copy link

✔️ Linting Passed

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

Generated for commit: 41f00c1. Link to the linter CI: here

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.

LGTM. Out of curiosity, do we expect the previous version to fail at some point ? should we run the array api tests before merging ?

@lucyleeow
Copy link
Member Author

lucyleeow commented Apr 23, 2025

Yes, the previous version will fail once data-apis/array-api-strict#147 is in released version (I tested all array-api tests in sklearn with that array-api-strict PR, and this was the only failure)

@lucyleeow
Copy link
Member Author

@jeremiedbb are you happy for this to go in?

@ogrisel ogrisel merged commit 7c976b4 into scikit-learn:main Apr 29, 2025
43 checks passed
@ogrisel
Copy link
Member

ogrisel commented Apr 29, 2025

I merged :)

@lucyleeow lucyleeow deleted the weighted_percentile_stack branch April 29, 2025 21:26
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