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

Skip to content

backend_ps cleanup. #15233

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
Mar 10, 2020
Merged

backend_ps cleanup. #15233

merged 1 commit into from
Mar 10, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Sep 9, 2019

Dedupe some code between backend_ps and backend_bases (the edgecolor and
facecolor handling -- see changelog), as well as between the non-tex and
tex cases (by formatting the header metadata ("dsc_comments") earlier).

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

@anntzer anntzer force-pushed the ps branch 2 times, most recently from 1420e27 to f4d742f Compare March 4, 2020 10:36
@@ -1006,28 +985,18 @@ def print_figure_impl(fh):

@cbook._delete_parameter("3.2", "dryrun")
def _print_figure_tex(
self, outfile, format, dpi, facecolor, edgecolor,
orientation, papertype, *,
metadata=None, dryrun=False, bbox_inches_restore=None, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

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

So this function is technically private, but we still have _delete_parameter on it, so is it really safe to be deleting other parameters 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.

The _delete_parameter is there because previously it couldn't go onto the public caller (print_ps) which just accepted dryrun into kwargs (xref #16231).
print_ps only ever passes facecolor/edgecolor as kwargs anyways, so they would get silently absorbed into kwargs.

@anntzer
Copy link
Contributor Author

anntzer commented Mar 10, 2020

rebased

Dedupe some code between backend_ps and backend_bases (the edgecolor and
facecolor handling -- see changelog), as well as between the non-tex and
tex cases (by formatting the header metadata ("dsc_comments") earlier).

Also simplify a bit papersize handling in usetex case.
@QuLogic QuLogic added this to the v3.3.0 milestone Mar 10, 2020
@QuLogic QuLogic merged commit d7ba944 into matplotlib:master Mar 10, 2020
@anntzer anntzer deleted the ps branch March 10, 2020 23:36
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.

4 participants