Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork10.9k
fix quantile all zeros error#28597
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Hello, I'm a new contributor to this project and have submitted this pull request to address [Issue#28589]. However, I noticed that some of the status checks are failing. I've reviewed the output but am unsure how to resolve these issues. Could someone please provide guidance on the reasons for these failures and suggest steps to address them? Thank you for your assistance. |
with pytest.raises(ValueError, match="Weights must contain non-zero value."): | ||
np.quantile(y, 0.5, weights=w, method="inverted_cdf") | ||
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.
Could someone please provide guidance on the reasons for these failures and suggest steps to address them?
You can reproduce the linter failure observed in CI locally by runningspin lint
on your branch. Purging the extra blank line it complains about will allowspin lint
to pass locally and in CI. I checked the full test suite locally on this branch and it seems "ok."
The Qemu job failure in CI is clearly unrelated so don't worry about that.
For bug fixes, we usually prefix commits and titles of PRs withBUG:
. You can find the list of prefixes in our docs.
Note for other NumPy devs--gh-28594 is very similar to this.
BUG: Raise error in
quantile
whenweights
sum to zeroAdded a check in
np.quantile
to raise aValueError
when theweights
parameter are all zero, preventing invalid computations. Added corresponding tests to verify this behavior.Closes#28589.