-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Handled non finite values in ax.pie - issue #29860 #29873
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
Handled non finite values in ax.pie - issue #29860 #29873
Conversation
Thanks for your contribution! It seems like you have accidentally added empty lines with spaces and also removed the definition of |
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
Hey, thanks for the review.! Do you want me to update the code according to the suggestions and submit a new PR? |
There's no need for a new PR; you should update this one with the corrections. |
The fix + test look good! Can you please clean up the the whitespace/linting issues? |
Yeah, sure! |
7aca539
to
5ddcb77
Compare
|
||
def test_pie_non_finite_values(): | ||
fig, ax = plt.subplots() | ||
df = [5, float('nan'), float('inf')] |
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.
df = [5, float('nan'), float('inf')] | |
values = [5, float('nan'), float('inf')] |
Optional. df
is typically used as variable name for dataframes, so it's slightly misleading here.
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.
Thanks a lot for this - it looks like your first PR to Matplotlib, so contratulations on getting it merged!
Closes #29860 issue
Changes makes sure that user gets proper value error message when data contains non finite values and passed into function pie() in lib/matplotlib/axes/_axes.py. Added the condition to check data for any infinite or Nan value, and if encountered one of these, we raise a value error with 'Wedges sizes must be finite numbers'. Also added test_pie_non_finite_values() in tests/test_axes.py for testing the added functionality.
PR summary
PR checklist
ax.pie()
raisesValueError
when input containsNaN
#29860" is in the body of the PR description to link the related issue