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

MNT: make layout deprecations pending #22345

Merged

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Jan 28, 2022

PR Summary

Closes #22343

As noted there, deprecating immediately emits a DeprecationWarning, whereas this will emit a PendingDeprecationWarning.

PR Checklist

Tests and Styling

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

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • 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).

@jklymak jklymak force-pushed the mnt-make-layout-deprecations-pending branch from 30fef49 to 0f77ba9 Compare January 28, 2022 14:48
@jklymak jklymak added this to the v3.6.0 milestone Jan 28, 2022
@anntzer
Copy link
Contributor

anntzer commented Jan 28, 2022

Thanks!

@timhoffm
Copy link
Member

Should the api change now be adapted as well?

@jklymak
Copy link
Member Author

jklymak commented Jan 29, 2022

Hmmm, I don't think I put in an API change note for the original deprecation, which was an oversight.

@jklymak
Copy link
Member Author

jklymak commented Jan 29, 2022

So now that I think about this a bit more, do we really want to get rid of figure.set_tight_layout()? That is used massively in the wild.

@timhoffm
Copy link
Member

I'd definitively get rid of get/set_constrained_layout_pads(). That's too specific for a figure method. But we're not in a hurry let's go an normal deprecation cycle here, including a pending round.

set_tight_layout/set_constrained_layout: In the very long run, we want to get rid of it because of the duplicate API. But there are 7.5k usages on GitHub, so I think a deprecation would be too annoying. I think we have to give a long lead to let it grow out to some extent.

  • This should be marked as 'discouraged' like we did with figure(tight_layout=True).
  • Maybe we want to set a PendingDeprecationWarning but without a timeline for the actual deprecation. The pending warning will usually only affect downstream libraries but not end-users. It's good if at least libraries have moved away from it, so that we can actually deprecate if we choose to without downstream libs annoying users with non-actionable deprecation warnings.

@jklymak
Copy link
Member Author

jklymak commented Jan 31, 2022

OK, so left the pending deprecations in, but changed the deprecation note to say that set_tight/constrained_layout are discouraged rather than that they will be deprecated.

@timhoffm timhoffm merged commit dec1e13 into matplotlib:main Feb 2, 2022
@jklymak jklymak mentioned this pull request Feb 3, 2022
6 tasks
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.

[MNT]: Delay (or make pending) the deprecation of set_constrained_layout/set_tight_layout
3 participants