Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
DOC: Use napoleon sphinx extension#5743
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
QuLogic commentedDec 24, 2015
Also, I'm wondering what's the point of some of the "Call signature" lines in |
tacaswell commentedDec 24, 2015
The |
efiring commentedDec 25, 2015
It looks like most of those |
QuLogic commentedDec 25, 2015
I spent a little time looking into the different images, and it seems like, e.g., the tight layout demo, just picks font sizes at random. It makes the doc build a bit unreproducible; can we stop doing that? |
mdboom commentedDec 29, 2015
Yes! In this case, I don't see any reason why it's random, let's just hardcode the values in the example. In other cases where the example really does want to use random data, we should at least seed the random number generator so the results are predictable. |
tacaswell commentedJan 3, 2016
This needs a rebase. |
QuLogic commentedJan 4, 2016
Yes, waiting for#5769 as well. |
doc/README.txt Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we really still need to run it twice? I think this is left over from some old setup which should be removed. Travis only runs python make once and that seems to work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yea, I wondered about that, but I don't know for sure why it's there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Yeah -- I had forgotten that was there. I vaguely recall that was once true (back in ancient times when we didn't even use Sphinx extensions), but I haven't had to do that in years. Let's take it out while we're in here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Alright, I removed it.
58f367e tobe45da2Compare74d4cb5 to94a7cd6CompareQuLogic commentedJan 6, 2016
I was going to add in fixes to several docstrings with incorrect headings and such, but that might balloon this PR to something rather big. The changes here are enough to get the build to pass without error, so maybe that should be left to some later PR? |
tacaswell commentedJan 6, 2016
Better to not let the prefect be the enemy of the good. |
85a764b toa016430CompareQuLogic commentedJan 6, 2016
Let's call this done for now then, and I'll work on the other stuff in another PR as time permits. |
mdboom commentedJan 7, 2016
Should we hold off on this until investigating the bugs@QuLogic alluded to on gitter? |
QuLogic commentedMar 30, 2016
Once we merge the PRs from@jenshnielsen, this should work without warning on Sphinx 1.4. The I don't know whether or not you still wish to put this on 2.0, but it shouldn't break anything at this point. |
jklymak commentedJan 19, 2018
Is this something that will ever happen? Folks have been putting a lot of documentation effort in recently. If the standard is supposed to be slightly different it'd be good to know sooner rather than later. If this won't happen, this can be closed? |
efiring commentedJan 20, 2018
There are two parts to this: docstring cleanups and the switch to Napoleon. I suspect most of the docstring cleanups have been done by now in other PRs, but I haven't checked. As for the switch to Napoleon, the advantage is that it removes a dependency; the disadvantage is that Napoleon might not perfectly track numpydoc. |
timhoffm commentedApr 17, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Indeed, most docstring cleanups from here are already merged.#11064 handles the remaining docstring changes, so that this PR can be significantly simplified and focus only on a possible switch to napoleon (or be closed, if there are no longer plans for switching to napoleon). |
jklymak commentedMay 24, 2018
Closing as it doesn't seem there is any appetite to switch to napoleon. OTOH, if someone wants to take the "switch" part of the PR on, that'd be fine w/ me.... |
anntzer commentedJun 15, 2018
Reopening per#11397 (comment). |
timhoffm commentedJun 19, 2018
If we want to switch to napoleon, we'd need a careful look at the changes that may introduce in the generated files. While technically implementing the same specification, napoleon and numpydoc interpret it differently, sometimes stricter, sometimes more strict. We're probably knowingly and unknowingly adapting our docstrings to the numpydoc interpretation by just using it and checking what works and what doesn't. This "learned" formatting has to be reevaluated when swiching to napoleon. |
anntzer commentedOct 23, 2018
fwiw, it looks like sklearn (including one of numpydoc's maintainers...) is considering switching to napoleon (scikit-learn/scikit-learn#11440). |
matthew-brett commentedOct 23, 2018
But - reading that thread - they are pretty ambiguous about it. The main argument for Napoleon seems to be 'it comes with sphinx' - but that's not a very powerful argument on its own, given that numpydoc is so easy to install. |
anntzer commentedOct 23, 2018
That's why I said "considering", not "decided".
|
matthew-brett commentedOct 23, 2018
Sure, but I don't know if it's really true the Napoleon really gets better maintenance. Among the big scientific Python projects, Numpy, Scipy, Pandas, Scikit-image, Scikit-learn, Sympy and Astropy all use Numpydoc, with Statsmodels being the only one I know of that uses Napoleon. Pauli Virtanen leads Scipy, and maintains Numpydoc, so I think it's reasonable to hope it will stay fit for purpose for a while. How about waiting with a plan to review in a year's time? |
timhoffm commentedOct 23, 2018
There are some subtle differences in the parsers concerning name and type detection and formatting. e.g.numpy/numpydoc#72 (comment) We now tune the docs to be numpydoc compliant. So we really would have to test how napoleon behaves. Nevertheless, I have the feeling that napoleon has a more sane parser. |
dstansby commentedApr 26, 2019
Isupsect even if we want to switch to |
This is now building without warning, but there are a few differences. For some reason, some images are not consistent between this and
v2.x; I think some of the documentation scripts are missing sorting (I'm using Python 3).The biggest difference seems to be with parameter listings. The existing result seems to be a bunch of paragraphs and blockquotes, but the new result is a bunch of bullet lists. I think this may actually be more correct, but it does change the look somewhat.
Fixes#5731.