Skip to content

MAINT: small improvements to the pdf backend #14413

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 7 commits into from
Jun 5, 2019

Conversation

jkseppan
Copy link
Member

@jkseppan jkseppan commented Jun 2, 2019

PR Summary

Improve some docstrings and comments, use generators instead of keeping nextFoo style counters

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

jkseppan added 4 commits June 2, 2019 09:03
Instead of the `self.nextFoo` counters. This way the various name
sequences are defined closer together and it's impossible to forget
to increment the counters.
draw_markers has been implemented, draw_line_collection was removed years ago
but draw_quad_mesh could be implemented
and delete a useless comment
@@ -482,21 +511,21 @@ def __init__(self, filename, metadata=None):
if v is not None}

self.fontNames = {} # maps filenames to internal font names
self.nextFont = 1 # next free internal font name
self.internalFontName = (Name(f'F{i}') for i in itertools.count(1))
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really mind the API break (it's clearly intended to be a private API), but please add an API change note and make the new APIs private.

----------

id : int
object id of the stream
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
object id of the stream
Object id of the stream.

Generally, parameter descriptions should start with a capital letter and finish with a period, even if they are not complete sentences.

(Also in the following docs).

for `'Creator'`, `'Producer'` and `'CreationDate'`. They
can be removed by setting them to `None`.
"""
self.objectId = itertools.count(1) # consumed by reserveObject
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better name this

Suggested change
self.objectId = itertools.count(1) # consumed by reserveObject
self._object_id_generator = itertools.count(1) # consumed by reserveObject

?

Copy link
Member Author

Choose a reason for hiding this comment

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

I gave the new names _seq suffixes to keep the lines slightly shorter.

jkseppan added 3 commits June 5, 2019 06:03
and name the new members like _foo_seq to make them obviously private
and to conform to PEP8
The pytest version requirement has changed.
@jkseppan jkseppan merged commit d19e8c1 into matplotlib:master Jun 5, 2019
@jkseppan jkseppan deleted the pdf-improve branch June 5, 2019 09:25
@anntzer
Copy link
Contributor

anntzer commented Jun 5, 2019

Not a huge deal here, but note that we normally wait for approval from two reviewers (other than the PR author) to merge (except for docs-only changes where one reviewer is enough).

@jkseppan
Copy link
Member Author

jkseppan commented Jun 5, 2019 via email

@anntzer
Copy link
Contributor

anntzer commented Jun 5, 2019

No worries :)

@QuLogic QuLogic added this to the v3.2.0 milestone Jun 5, 2019
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.

4 participants