Skip to content
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

Unable to properly format numpy argument for tuple. Guidance requested. #3355

Closed
bschollnick opened this issue Jan 19, 2017 · 3 comments
Closed
Assignees

Comments

@bschollnick
Copy link

I seem to be unable to get a tuple defined in the Arguments block of the docstring using numpy style docstrings with Napoleon. (I did not try using Google style).

I have tried a variety of different formating styles. Part of the problem is that I am unable to find a definitive method of defining a tuple in the docstring.

eg.

Args:
input_image : string
The filename of the image file to crop
output_image : string
The filename of the save file
(start_x, start_y) : tuple(integer, integer)
The x and y (Integers) coords to start cropping from

or

    (start_x, start_y) : tuple
        The x and y (Integers) coords to start cropping from

or

    (start_x, start_y) : (integer, integer)
        The x and y (Integers) coords to start cropping from

etc

In every case, I am seeing:

W: 95, 0: "tuple" missing or differing in parameter documentation (missing-param-doc)
W: 95, 0: "input_image, output_image, tuple" missing or differing in parameter type documentation (missing-type-doc)

Would it be possible for someone to give some guidance regarding tuple parameters?

@RobRuana RobRuana self-assigned this Jan 19, 2017
@RobRuana
Copy link
Contributor

Hi! Thanks for the question.

First, if you're using the NumPy style, you'll want to start the Args section with an underline, like so:

Args
----
input_image : string
    The filename of the image file to crop

Second, NumPy (and Google) style only support a single name for each parameter, so you'll want to do something like this:

Args
----
input_image : string
    The filename of the image file to crop
output_image : string
    The filename of the save file
start_point : tuple(int, int)
        The x and y (Integers) coords to start cropping from

or if you are using a namedtuple like the example here, you could do something like this:

Args
----
input_image : string
    The filename of the image file to crop
output_image : string
    The filename of the save file
start_point : Point
        The x and y (Integers) coords to start cropping from

Does that clear things up?

@RobRuana
Copy link
Contributor

Since I haven't heard back from you, I am going to close this issue. But feel free to reopen it if things aren't working for you! :)

@bschollnick
Copy link
Author

I'll give this a try. (I don't recall seeing the initial notification...)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants