8000 Modernize ArtistInspector a bit... by anntzer · Pull Request #12038 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Modernize ArtistInspector a bit... #12038

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
Sep 7, 2018
Merged

Modernize ArtistInspector a bit... #12038

merged 1 commit into from
Sep 7, 2018

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Sep 6, 2018

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

@@ -11,22 +11,6 @@
from .path import Path
from .transforms import (Bbox, IdentityTransform, Transform, TransformedBbox,
TransformedPatchPath, TransformedPath)
# Note, matplotlib artists use the doc strings for set and get
Copy link
Contributor Author

Choose a reason for hiding this comment

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

that comment is essentially completely false now (even the magic string for aliases is "Alias for", not "alias for" :))

else:
return s
return s + ''.join(' or %s' % x
for x in sorted(self.aliasd.get(s, [])))
Copy link
Member

Choose a reason for hiding this comment

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

Just to keep this structurally similar to alias_name_rest():

aliases = ''.join(' or %s' % x for x in sorted(self.aliasd.get(s, [])))
return s + aliases

Also slightly more readable.

ds = o.__doc__
if ds is None:
return False
return ds.startswith('Alias for ')

def aliased_name(self, s):
"""
return 'PROPNAME or alias' if *s* has an alias, else return
PROPNAME.
return 'PROPNAME or alias' if *s* has an alias, else return PROPNAME.
Copy link
Member

Choose a reason for hiding this comment

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

May give it a capital to start, when you're editing anyway. 😄

@anntzer
Copy link
Contributor Author
anntzer commented Sep 6, 2018

comments handled

@NelleV NelleV merged commit 21b5b3e into matplotlib:master Sep 7, 2018
@NelleV
Copy link
Member
NelleV commented Sep 7, 2018

Thanks @anntzer

@anntzer anntzer deleted the ai2 branch September 7, 2018 18:57
@QuLogic QuLogic added this to the v3.1 milestone Sep 7, 2018
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
0