10000 Better handle deprecated rcParams. by anntzer · Pull Request #13929 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Better handle deprecated rcParams. #13929

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
Apr 21, 2019
Merged

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Apr 11, 2019
  • Don't trigger a deprecation in repr() (e.g., in $ pydoc matplotlib).
  • Don't trigger a deprecation in test_style.py::test_alias.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 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

- Don't trigger a deprecation in repr() (e.g., in `$ pydoc matplotlib`).
- Don't trigger a deprecation in test_style.py::test_alias.
width=80 - indent).split('\n')
with cbook._suppress_matplotlib_deprecation_warning():
repr_split = pprint.pformat(dict(self), indent=1,
width=80 - indent).split('\n')
repr_indented = ('\n' + ' ' * indent).join(repr_split)
Copy link
Member

Choose a reason for hiding this comment

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

Not exactly related to this PR, but I don't understand why we don't pass indent=indent and skip doing the indent ourselves here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps(?) because the behavior of pprint's indent is less than optimal and would result in

RcParams({        '_internal.classic_mode': False,
         'agg.path.chunksize': 0,
         'animation.avconv_args': [],
         'animation.avconv_path': 'avconv',
...

see also the example at https://docs.python.org/3/library/pprint.html#pprint.PrettyPrinter with indent=4 which clearly shows this (curious?) behavior.

@tacaswell tacaswell added this to the v3.2.0 milestone Apr 12, 2019
@efiring efiring merged commit 369c3c3 into matplotlib:master Apr 21, 2019
@anntzer anntzer deleted the rcdeprecated branch April 21, 2019 19:34
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.

5 participants
0