Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prefer warn_deprecated instead of warnings.warn. #11297

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
Jul 1, 2018

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 24, 2018

warn_deprecated has the advantage of always listing the deprecation
version and removal version. Hopefully, in the future it will also be
able to set the stacklevel more systematically.

Redesign the way deprecation of rcParams is done to make it use
warn_deprecated. Merge obsolete_set into deprecated_ignore_map as they
are semantically similar, it's just that there's no alternative rcParam
for obsolete_set. Rename deprecated_set to deprecated_remain_as_none as
the former name really doesn't say anything about the deprecation
semantics.

text.dvipnghack and axes.hold should be completely removed but that'll
be another PR.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.0 milestone May 24, 2018
@anntzer anntzer force-pushed the warn_deprecated branch 2 times, most recently from 4d94f3d to d3d9fad Compare May 24, 2018 00:43
Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

This seems good to me so long as you caught all the warnings associated w/ deprecations....

@anntzer anntzer force-pushed the warn_deprecated branch from d3d9fad to 2e94ef6 Compare May 31, 2018 20:40
Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Not sure why Travis OSX is failing. Seems unrelated.

warn_deprecated has the advantage of always listing the deprecation
version and removal version.  Hopefully, in the future it will also be
able to set the stacklevel more systematically.

Redesign the way deprecation of rcParams is done to make it use
warn_deprecated.  Merge obsolete_set into deprecated_ignore_map as they
are semantically similar, it's just that there's no alternative rcParam
for obsolete_set.  Rename deprecated_set to deprecated_remain_as_none as
the former name really doesn't say anything about the deprecation
semantics.

text.dvipnghack and axes.hold should be completely removed but that'll
be another PR.
@anntzer anntzer force-pushed the warn_deprecated branch from 2e94ef6 to b100c00 Compare July 1, 2018 21:25
@anntzer anntzer mentioned this pull request Jul 1, 2018
2 tasks
@timhoffm timhoffm merged commit 0f05cf4 into matplotlib:master Jul 1, 2018
@anntzer anntzer deleted the warn_deprecated branch July 1, 2018 23:03
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