numpydoc icon indicating copy to clipboard operation
numpydoc copied to clipboard

Inconsistent docstring format under Style Guide and Example Tab on the website

Open xiao03 opened this issue 3 years ago • 1 comments

I noticed that the docstring of class Photo(ndarray) under Style Guide tab is not consistent with the docstring of function foo provided in the Example tab on the website.

Most of the functions in the numpy library adapt the former style of doc-string, while PEP 257 recommends the latter. Specifically, The problem is whether or not to leave the first line blank.

I believe there's no difference after the rendering, and it is just a consistency problem. Which format is preferred?

Screen Shot 2021-06-07 at 23 34 29 Screen Shot 2021-06-07 at 23 34 48

xiao03 avatar Jun 08 '21 03:06 xiao03

This is just a style choice and is not officially part of the numpydoc standard --- either is equally valid. There is a docstring validation feature that will be part of the next numpydoc release that allows you to check that all of the docstrings in your project use one or the other style if it's something you want to enforce.

rossbar avatar Jun 08 '21 07:06 rossbar