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

numpydoc sphinx extension disabled. was: Docstring convention #3431

Closed
ghost opened this issue Apr 23, 2013 · 7 comments
Closed

numpydoc sphinx extension disabled. was: Docstring convention #3431

ghost opened this issue Apr 23, 2013 · 7 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Apr 23, 2013

edit: totally misguided.

Sphinx has great support for method signature metadata in docstrings,
there are python standars for ReST docstrings, and tooling to leverage
and generate the docstrings.

In practice pandas uses an ad-hoc "visual" format for docstrings, which
confuses sphinx and impedes automation.

Major cleanup all over.

http://www.python.org/dev/peps/pep-0257/
http://www.python.org/dev/peps/pep-0287/

edit: numpydoc is in use by pandas, unbeknownst to me previously.
#2916, #3422

Bad:

"""
        Parameters
        ----------
        key : for use with a lock

        Returns
        -------
        res : 3.5% annualized
"""

Better:

"""
:param key:  for use with a lock
:returns: 3.5% annualized
 """

Much Better:

"""Subject

some text

a code example::

    I.am.code(is=True)

:param key: for use with a lock
:type key: str
:returns: 3.5% annualized
:rtype: float
"""
@jseabold
Copy link
Contributor

This is the numpy docstring standard parsed with sphinxext/numpydoc.py. I'd be strongly against doing away with it since it's the de facto standard across many packages and what many people have come to expect. It's much easier to look at vs. the examples you've posted assuming this is what I'd see at the interpreter. What do you mean it confuses sphinx and impedes automation?

@ghost
Copy link
Author

ghost commented Apr 23, 2013

Thanks, I wasn't in on that.

I think I unceremoniously kicked out numpydoc due to this:
https://github.com/pydata/pandas-website/issues/20

Could see no diff at the time, probably explains why sphinx is yelling a lot.

The format seems to be harder to parse, that's what I meant by "impedes automation",
because it looks like free text.

@jseabold
Copy link
Contributor

Oh ok. It can be a real pain to get to zero warning docs builds the first time, if no one has been keeping up with it, but it's certainly possible. In my experience there's no such thing as a false positive warning. They all indicate some kind of formatting error which will show up in the built documentation.

@ghost
Copy link
Author

ghost commented Apr 23, 2013

Pretty sure I screwed up the 0.11.0 documentation for all distros until 0.12 comes out. nice.
cc/f***up @changhiskhan , @wesm

e6aaca5: DOC: bring back numpydoc

@ghost ghost closed this as completed Apr 23, 2013
@jseabold
Copy link
Contributor

Luckily in my experience no one ever reads the documentation ;)

@ghost
Copy link
Author

ghost commented Apr 23, 2013

well, maybe if you didn't use scary words like exogenous everywhere you'd
gain more traction :)

@jseabold
Copy link
Contributor

Feel free to add your voice to this "fun" discussion

statsmodels/statsmodels#395

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

No branches or pull requests

1 participant