Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use (float, float) as parameter type for 2D positions in docstrings#12237

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
NelleV merged 1 commit intomatplotlib:masterfromtimhoffm:doc-xy
Sep 24, 2018

Conversation

timhoffm
Copy link
Member

PR Summary

Application of#12227 to the docstrings.

PR Checklist

  • Documentation is sphinx and numpydoc compliant

@timhoffmtimhoffm added this to thev3.0.x milestoneSep 23, 2018
The (x,y) coordinates of the offset in display units.
A callable must have the signature::

def offset(width, height, xdescent, ydescent, renderer) \
Copy link
Member

Choose a reason for hiding this comment

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

I don't get line 191 here... Do you mean it should return (float, float)?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is the notation for the return type hint.
https://13820-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/offsetbox_api.html#matplotlib.offsetbox.OffsetBox.set_offset

We're already using this in other places such as:
https://13820-1385122-gh.circle-artifacts.com/0/home/circleci/project/doc/build/html/api/_as_gen/matplotlib.artist.Artist.set_contains.html#matplotlib.artist.Artist.set_contains

I've just not annotated the function parameters in this example to keep it more readable, and their types are quite obvious anyway.

Copy link
Member

@jklymakjklymak left a comment

Choose a reason for hiding this comment

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

Looks great but a couple of small comments...

@@ -773,9 +783,12 @@ def set_transform(self, t):

def set_offset(self, xy):
"""
set offset of the container.
Set the offset of the container.
Copy link
Member

Choose a reason for hiding this comment

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

the extra "the" wasn't really necessary here.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I think we mostly use the form with the article in the docs. But I don't care too much.

@NelleVNelleV merged commit2603ebc intomatplotlib:masterSep 24, 2018
@NelleV
Copy link
Member

Thanks@timhoffm !

meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestSep 24, 2018
@timhoffmtimhoffm deleted the doc-xy branchSeptember 24, 2018 12:01
dstansby added a commit that referenced this pull requestSep 24, 2018
…237-on-v3.0.xBackport PR#12237 on branch v3.0.x (Use (float, float) as parameter type for 2D positions in docstrings)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jklymakjklymakjklymak left review comments

Assignees
No one assigned
Projects
None yet
Milestone
v3.0.1
Development

Successfully merging this pull request may close these issues.

3 participants
@timhoffm@NelleV@jklymak

[8]ページ先頭

©2009-2025 Movatter.jp