Skip to content
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

DOC: fix deprecation warnings in examples #23867

Merged
merged 1 commit into from
Sep 11, 2022

Conversation

StefRe
Copy link
Contributor

@StefRe StefRe commented Sep 11, 2022

PR Summary

  • The dist attribute was deprecated in Matplotlib 3.6 and will be removed two minor releases later.
  • Passing the loc parameter of init() positionally is deprecated since Matplotlib 3.6; the parameter will become keyword-only two minor releases later.
  • Passing the radius parameter of init() positionally is deprecated since Matplotlib 3.6; the parameter will become keyword-only two minor releases later.
  • Passing the closed parameter of init() positionally is deprecated since Matplotlib 3.6; the parameter will become keyword-only two minor releases later.
  • Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.

(#23855 was for the tutorials, this is for the examples, sorry - I didn't notice it first that there were deprecations in the examples too)

PR Checklist

Tests and Styling

  • [N/A] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [N/A] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

- The dist attribute was deprecated in Matplotlib 3.6 and will be
  removed two minor releases later.
- Passing the loc parameter of __init__() positionally is deprecated
  since Matplotlib 3.6; the parameter will become keyword-only two
  minor releases later.
- Passing the radius parameter of __init__() positionally is deprecated
  since Matplotlib 3.6; the parameter will become keyword-only two
  minor releases later.
- Passing the closed parameter of __init__() positionally is deprecated
  since Matplotlib 3.6; the parameter will become keyword-only two
  minor releases later.
- Auto-removal of grids by pcolor() and pcolormesh() is deprecated
  since 3.5 and will be removed two minor releases later; please call
  grid(False) first.
@StefRe StefRe changed the title DOC: fix deprecations in examples DOC: fix deprecation warnings in examples Sep 11, 2022
@oscargus
Copy link
Contributor

Thanks!

Do you have any input on the related issue #23866 ? That is, did you somehow enable the deprecation warnings or did you use a more manual approach?

@oscargus oscargus added this to the v3.6.0 milestone Sep 11, 2022
@StefRe
Copy link
Contributor Author

StefRe commented Sep 11, 2022

Actually I came across this by chance: I was checking in which tutorials and examples the output needs to be captured (for #23796 (comment)). To do so I "grepped" the rst file created by sphinx gallery for .. rst-class:: sphx-glr-script-out. This yielded the deprecation warnings too :). So yes - it's a manual process.

@StefRe
Copy link
Contributor Author

StefRe commented Sep 11, 2022

judging by

matplotlib/doc/conf.py

Lines 50 to 53 in 2171d95

# Unless we catch the warning explicitly somewhere, a warning should cause the
# docs build to fail. This is especially useful for getting rid of deprecated
# usage in the gallery.
warnings.filterwarnings('error', append=True)

warnings should make the docs build fail, but they don't do so for some reason. Maybe this is due to the append=True if sphinx gallery also controls warnings with the default append value of False? (I didn't check this, just a guess)

@oscargus
Copy link
Contributor

OK!

I have added a step that will at least list examples and tutorials with deprecation warnings in #23868 so that will help a bit.

Thanks for sorting this out!

@oscargus oscargus merged commit 06660ef into matplotlib:main Sep 11, 2022
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Sep 11, 2022
oscargus added a commit that referenced this pull request Sep 11, 2022
…867-on-v3.6.x

Backport PR #23867 on branch v3.6.x (DOC: fix deprecation warnings in examples)
@StefRe StefRe deleted the DOC/depr_examples branch September 11, 2022 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants