-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
MNT: Deprecate rcParams._get("backend") #30963
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
base: main
Are you sure you want to change the base?
Conversation
f343d24 to
7e92025
Compare
since 3.10 we have the official API `matplotlib.get_backend (auto_select=False)`. No problems have been reported and matplotlib-inline is using it https://github .com/ipython/matplotlib-inline/pull/38. Therefore, I remove the provisional status from the auto-select flag. Additionally, I deprecate the API rcParams._get('backend'), which the above is replacing. It seems that `rcParams._get("backend")` is not used anywhere publically, but let's still be defensive and deprecate. https://github.com/search?q=%2F%5C._get%5C%28%5B%22%27%5Dbackend%5B%22%27%5D%5C%29%2F+language%3APython+NOT+is%3Afork+NOT+path%3A**%2Fmatplotlib%2F**+NOT+path%3A**%2Fsite-packages**+NOT+path%3A**%2Fpyplot.py&type=code This is working towards matplotlib#26406. Follow-up to matplotlib#29039.
7e92025 to
fc8fb3a
Compare
|
Still need to filter the deprecation warnings for internal use. |
| _api.warn_deprecated( | ||
| "rcParams._get('backend') is deprecated since Matplotlib 3.11. " | ||
| "Use matplotlib.get_backend(auto_select=False) instead, which is " | ||
| "available since Matplotlib 3.10.", | ||
| ) |
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.
The first arg is since, not the full message.
| _api.warn_deprecated( | |
| "rcParams._get('backend') is deprecated since Matplotlib 3.11. " | |
| "Use matplotlib.get_backend(auto_select=False) instead, which is " | |
| "available since Matplotlib 3.10.", | |
| ) | |
| _api.warn_deprecated( | |
| "3.11", | |
| name="rcParams._get('backend')", | |
| addendum="Use matplotlib.get_backend(auto_select=False) instead, which is " | |
| "available since Matplotlib 3.10.", | |
| ) |
| "Use matplotlib.get_backend(auto_select=False) instead, which is " | ||
| "available since Matplotlib 3.10.", | ||
| ) | ||
| # TODO: When removing this, also remove the suppression context in |
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.
What is "this"? The comment is in an odd spot to decide if it's the if, the warning, or the whole method.
since 3.10 we have the official API
matplotlib.get_backend (auto_select=False). No problems have been reported and matplotlib-inline is using it. Therefore, I remove the provisional status from the auto-select flag.Additionally, I deprecate the API
rcParams._get('backend'), which the above is replacing.It seems that
rcParams._get("backend")is not used anywhere publically, but let's still be defensive and deprecate.https://github.com/search?q=%2F%5C._get%5C%28%5B%22%27%5Dbackend%5B%22%27%5D%5C%29%2F+language%3APython+NOT+is%3Afork+NOT+path%3A**%2Fmatplotlib%2F**+NOT+path%3A**%2Fsite-packages**+NOT+path%3A**%2Fpyplot.py&type=code
This is working towards removal of dynamic backend state from rcParams #26406.
Follow-up to #29039.