8000 Deprecate the 'warn' parameter to matplotlib.use(). by anntzer · Pull Request #14144 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Deprecate the 'warn' parameter to matplotlib.use(). #14144

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
May 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/api/next_api_changes/2019-05-06-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Deprecations
````````````

The ``warn`` parameter to `matplotlib.use()` is deprecated (catch the
`ImportError` emitted on backend switch failure and reemit a warning yourself
if so desired).
3 changes: 2 additions & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,7 @@ def __exit__(self, exc_type, exc_value, exc_tb):


@cbook._rename_parameter("3.1", "arg", "backend")
@cbook._delete_parameter("3.1", "warn")
def use(backend, warn=False, force=True):
"""
Select the backend used for rendering and GUI integration.
Expand All @@ -1248,7 +1249,7 @@ def use(backend, warn=False, force=True):

warn : bool, optional, default: False
If True and not *force*, emit a warning if a failure-to-switch
`ImportError` has been suppressed.
`ImportError` has been suppressed. This parameter is deprecated.

force : bool, optional, default: True
If True (the default), raise an `ImportError` if the backend cannot be
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def setup():
"Could not set locale to English/United States. "
"Some date-related tests may fail.")

mpl.use('Agg', force=True, warn=False) # use Agg backend for these tests
mpl.use('Agg')

with cbook._suppress_matplotlib_deprecation_warning():
mpl.rcdefaults() # Start with all defaults
Expand Down
0