Skip to content

What is the correct order for Class sections?Β #572

Closed
@lucascolley

Description

@lucascolley

https://numpydoc.readthedocs.io/en/latest/format.html#class-docstring states that the Attributes section should be "located below the Parameters section". In practice, docscrape works with the order:

  • ...
  • Parameters
  • Returns
  • ...
  • See Also
  • Notes
  • References
  • Examples
  • Attributes
  • Methods

This seems deliberate, as

def test_class_members_doc_sphinx():

tests that Examples comes above Attributes and Methods.

However, this seems to create some weird doc pages, like https://scipy.github.io/devdocs/reference/generated/scipy.interpolate.CubicHermiteSpline.html. Is it really intentional that Attributes and Methods come below References and Notes? When reading the style guide, I interpret it as immediately below the Parameters section, which seems to make intuitive sense.

If this is intentional, then we should update the wording of the style guide to make it more clear. I'm pretty sure this is a mismatch though, so I have opened gh-571 to change the orders in docscrape.

x-ref scipy/scipy#21099

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions