Skip to content

Improve documentation of text module #16004

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
Dec 30, 2019
Merged

Conversation

timhoffm
Copy link
Member

PR Summary

The usual standardization of docstrings.

@timhoffm timhoffm added this to the v3.3.0 milestone Dec 22, 2019
Draw the :class:`Annotation` object to the given *renderer*.
"""

"""Draw the `Annotation` object to the given *renderer*."""
Copy link
Contributor

Choose a reason for hiding this comment

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

inherit docstring?

Copy link
Member Author

Choose a reason for hiding this comment

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

The inherited one would be "Draw the Text object to the given renderer.", which is slightly confusing. Right now, I can't think of a generic version that would suit both. So would leave this in.

Copy link
Contributor

Choose a reason for hiding this comment

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

Text.draw could also be inherited, I guess?

Copy link
Member Author

Choose a reason for hiding this comment

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

The base is Artist.draw, which has a technical comment on subclassing. It's probably possible to find a generic way of expressing that, so that it's appropriate in all Artist subclasses. But for now, I think leaving the explicit docstrings is the simplest solution.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I'll fix the base docstring later.

@timhoffm timhoffm force-pushed the doc-text branch 2 times, most recently from 5ef6f69 to 9a483f2 Compare December 24, 2019 12:45
"""
return self._horizontalalignment

def get_unitless_position(self):
"Return the unitless position of the text as a tuple (*x*, *y*)"
"""Return the (x, y) unitless position of the text."""
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps be consistent between

x, y
(x, y)
(*x*, *y*)
*(x, y)*

?
all of them occur right now in this patch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Gone with the simple (x, y).

@anntzer anntzer merged commit f842e9f into matplotlib:master Dec 30, 2019
@timhoffm timhoffm deleted the doc-text branch December 30, 2019 17:15
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.

2 participants