Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MAINT: Added deprecation warning to show argument for waterfall plot #4056

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
Loading
from

Conversation

Ja-Tink
Copy link
Contributor

@Ja-Tink Ja-Tink commented Apr 8, 2025

Overview

Implements #3819 (to be tracked on #3507)

Description of the changes proposed in this pull request:
I added a deprecation warning to the "show" argument in _waterfall.py. If this looks good, I am happy to add a similar warning to all the other plotting functions as outlined in #3819.

Screenshot 2025-04-07 at 10 48 22 PM

Checklist

  • All pre-commit checks pass.
  • Unit tests added (if fixing a bug or adding a new feature)

@Ja-Tink
Copy link
Contributor Author

Ja-Tink commented Apr 8, 2025

Also, should I update the docs to reflect this change? Or should that wait until all the plot functions have been changed?

@Ja-Tink Ja-Tink changed the title Added deprecation warning to show argument for waterfall plot MAINT: Added deprecation warning to show argument for waterfall plot Apr 8, 2025
if show is not None:
warnings.warn(
"WARNING: `show` argument is deprecated and will be removed in a future version. Please omit this argument and call plt.show() manually.",
category=UserWarning,

Choose a reason for hiding this comment

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

Should this be DeprecationWarning ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the catch, fixed

# Deprecation warning
if show is not None:
warnings.warn(
"WARNING: `show` argument is deprecated and will be removed in a future version. Please omit this argument and call plt.show() manually.",

Choose a reason for hiding this comment

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

The WARNING: prefix is not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -13,7 +15,7 @@
# plot that is associated with that feature get overlaid on the plot...it would quickly allow users to answer
# why a feature is pushing down or up. Perhaps the best way to do this would be with an ICE plot hanging off
# of the bar...
def waterfall(shap_values, max_display=10, show=True):
def waterfall(shap_values, max_display=10, show=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please let's not change the default here since this is a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha, I'll change that.

In that case, when should the deprecation warning trigger? Is there a way to detect whether show=True because it is the default argument versus it being explicitly passed by the user? If not, should the warning trigger whenever the function is called, regardless of the arguments used?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, I am a bit reluctant to add this, since we use the show parameter in a lot of different plots and I would like to deprecate all of them at once.

Copy link

codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.63%. Comparing base (cf81cfd) to head (cbd70b3).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4056   +/-   ##
=======================================
  Coverage   65.63%   65.63%           
=======================================
  Files          94       94           
  Lines       13141    13144    +3     
=======================================
+ Hits         8625     8627    +2     
- Misses       4516     4517    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.