8000 DOC: formatting fixes to mplot3d by eric-wieser · Pull Request #12033 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

DOC: formatting fixes to mplot3d #12033

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 2 commits into from
Sep 7, 2018

Conversation

eric-wieser
Copy link
Contributor

quiver seemed to be doing its own thing here

----------
X, Y, Z : array-like
The x, y and z coordinates of the arrow locations (default is
tail of arrow; see *pivot* kwarg)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I haven't and don't intend to touch any of these descriptions - my goal was only to switch to using Parameters

Copy link
Member

Choose a reason for hiding this comment

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

👍

quiver(X, Y, Z, U, V, W, **kwargs)

Arguments:
ax.quiver(X, Y, Z, U, V, W, /, length=1, arrow_length_ratio=.3, pivot='tail', normalize=False, **kwargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This replaces the signature in the docs, using the PEP570 syntax. There's precedent in ax.voxels, but it was admittedly set by me.

Copy link
Member

Choose a reason for hiding this comment

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

I did not look a the code, but if this is like Axes.quiver() this is technically not correct, because you can leave out some of the positional arguments. This is not something one can encode in a single signature line. We therefore use a "Call signatures" block. See the docs of Axes.quiver

Copy link
Contributor Author
@eric-wieser eric-wieser Sep 6, 2018

Choose a reason for hiding this comment

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

All 6 arguments are required to Axes3D.quiver:

        # handle args
        argi = 6
        if len(args) < argi:
            raise ValueError('Wrong number of arguments. Expected %d got %d' %
                             (argi, len(args)))

https://matplotlib.org/devel/documenting_mpl.html doesn't have any mention of "Call signatures" - perhaps it would be worth adding.

Copy link
Member
@timhoffm timhoffm Sep 6, 2018

Choose a reason for hiding this comment

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

If that doc signature is correct, we could directly change the signature of the function to be explicit. But if you don't want to go into this, that's fine as well.

Copy link
Contributor Author
@eric-wieser eric-wieser Sep 6, 2018

Choose a reason for hiding this comment

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

Until PEP570 is implemented, that would involve change the function signature to allow X to be passed by keyword. I think requiring it to be positional is a good idea.


*U*, *V*, *W*:
The x, y and z components of the arrow vectors
Plot a 3D field of arrows.

The arguments could be array-like or scalars, so long as they
Copy link
Member

Choose a reason for hiding this comment

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

probably should add The arguments *X*, *Y*, *Z*, *U*, *V*, *W* because the context above is deleted.

Copy link
Member
@NelleV NelleV left a comment

Choose a reason for hiding this comment

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

Thanks @eric-wieser !

----------
X, Y, Z : array-like
The x, y and z coordinates of the arrow locations (default is
tail of arrow; see *pivot* kwarg)
Copy link
Member

Choose a reason for hiding this comment

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

👍

@NelleV NelleV merged commit 0b84ecb into matplotlib:master Sep 7, 2018
@QuLogic QuLogic added this to the v3.1 milestone Sep 7, 2018
@eric-wieser eric-wieser deleted the __signature__-docs branch March 23, 2019 18:06
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