Skip to content

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

Closed

Description

@LindyBalboa

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.

Activity

  1. jenshnielsen commented on Aug 8, 2016

    @jenshnielsen
    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
  2. QuLogic commented on Aug 8, 2016

    @QuLogic
    Member

    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.

  3. changed the title [-]Docstring section "Other Parameters" not rendering with rest of tabe[/-] [+]Docstring section "Other Parameters" not rendering with rest of table[/+] on Aug 8, 2016
  4. LindyBalboa commented on Aug 16, 2016

    @LindyBalboa
    ContributorAuthor

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

  5. QuLogic commented on Sep 9, 2016

    @QuLogic
    Member

    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...

  6. tacaswell commented on Sep 9, 2016

    @tacaswell
    Member

    *an extra 11 months

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

  7. NelleV commented on Sep 9, 2016

    @NelleV
    Member

    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.

  8. NelleV commented on Sep 9, 2016

    @NelleV
    Member

    And I did not take over that PR :)

  9. jenshnielsen commented on Sep 9, 2016

    @jenshnielsen
    Member

    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

  10. QuLogic commented on Sep 9, 2016

    @QuLogic
    Member

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

  11. added this to the v2.2-doc milestone on Apr 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions