Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Docstring section "Other Parameters" not rendering with rest of table #6924

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

Closed
LindyBalboa opened this issue Aug 8, 2016 · 9 comments · Fixed by #10995
Closed

Docstring section "Other Parameters" not rendering with rest of table #6924

LindyBalboa opened this issue Aug 8, 2016 · 9 comments · Fixed by #10995

Comments

@LindyBalboa
Copy link
Contributor

LindyBalboa commented Aug 8, 2016

It has been bothering me that in general, kwargs are not very uniform at all in the docs. In many places they are listed after a simple "Addition keyword arguments... : ". Numpydoc does allow for the section Other Parameters (underscored with dashes) but it does not seem to render properly with the Parameters and Returns section table. The Other Parameters section doesn't seem to actually be used in the numpy docs. However, there are several instances of it in mpl/axes/_axes.py.

Looking at the html in a browser inspector, you can see that Parameters and Returns are the header to a <tr> and the contents are in the respective <td>. However, with Other Parameters, the contents are being inserted into a new <tr> following the Other Parameters row.

@jenshnielsen
Copy link
Member

I agree, In general the docs could use a lot or work and we should be better at settling on a standard for how to format the doc strings.

I guess there are two perhaps solutions to the specific problem of Other Parameters.

  • We can probably submit a PR to numpy doc fixing this. Since it's not used in numpy it's probably just a bug.
  • Rewrite the docs to not use other parameters. I have cleaned out a few instances where other non numpy doc compatible headers where used. Like additional parameters or similar
  • Perhaps switching from numpydoc to sphinx napoleon will fix this. I think there is a pr for that somewhere. But that has it's own issues as far as I remember

@QuLogic
Copy link
Member

QuLogic commented Aug 8, 2016

Perhaps switching from numpydoc to sphinx napoleon will fix this. I think there is a pr for that somewhere. But that has it's own issues as far as I remember

That's #5743.

@LindyBalboa LindyBalboa changed the title Docstring section "Other Parameters" not rendering with rest of tabe Docstring section "Other Parameters" not rendering with rest of table Aug 8, 2016
@LindyBalboa
Copy link
Contributor Author

@QuLogic So is that something that NelleV has taken over or...? Trying to track the progression of that PR has me a little confused.

@QuLogic
Copy link
Member

QuLogic commented Sep 9, 2016

Sorry; didn't seem to have replied here. I don't think @NelleV took over, but just accidentally tagged that PR in some commits. Since it's now going in 2.1, I was holding off until 2.0 was out. But of course, that was before 2.0 took an extra 3-4 months...

@tacaswell
Copy link
Member

*an extra 11 months

@mdboom and I really thought we could do it in a weekend.....

@NelleV
Copy link
Member

NelleV commented Sep 9, 2016

I don't think so, and I disagree with the switch from numpydoc to napoleon. I believe that projects should stick to packages that are standard, and napoleon isn't the standard in the scientific python community.
I am also confused with the statement that "Other parameters" is not render properly.

@NelleV
Copy link
Member

NelleV commented Sep 9, 2016

And I did not take over that PR :)

@jenshnielsen
Copy link
Member

jenshnielsen commented Sep 9, 2016

I don't have any strong preference for numpydoc vs napoleon just wanted to make sure that this is coordinated.

The non correct rendering is explained in the original post:
Inspecting the page source makes it a bit more clear.

Looking at the html in a browser inspector, you can see that Parameters and Returns are the
header to a <tr> and the contents are in the respective <td>. However, with Other Parameters,
the contents
are being inserted into a new <tr> following the Other Parameters row.

I.e. here I would expect the gray box to extend all the way down on the left and not across in the other parameters section

@QuLogic
Copy link
Member

QuLogic commented Sep 9, 2016

Napoleon is bundled with Sphinx 1.4+ and implements the NumPyDoc format, so I don't really think it's that non-standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants