Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Closed
QuLogic wants to merge6 commits intomatplotlib:masterfromQuLogic:sphinx-napoleon

Conversation

QuLogic
Copy link
Member

This is now building without warning, but there are a few differences. For some reason, some images are not consistent between this andv2.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.

@QuLogicQuLogic added this to thenext major release (2.0) milestoneDec 24, 2015
@QuLogic
Copy link
MemberAuthor

Also, I'm wondering what's the point of some of the "Call signature" lines inaxes/_axes.py because they seem to be redundant?

@tacaswell
Copy link
Member

TheCall signature lines probably pre-date sphinx.

@efiring
Copy link
Member

It looks like most of thoseCall signature blocks can be deleted, but there are exceptions such asbarbs,quiver,contour, andclabel where there are multiple signatures hidden within*args that Sphinx cannot handle automatically.

@QuLogic
Copy link
MemberAuthor

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
Copy link
Member

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?

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.

This was referencedDec 30, 2015
@tacaswell
Copy link
Member

This needs a rebase.

@QuLogic
Copy link
MemberAuthor

Yes, waiting for#5769 as well.

if sphinx older than 1.3, sphinxcontrib-napoleon,then type "python make.py
html" in this directory. Waitfor the initial run (which builds the example
gallery) to be done,then run "python make.py html" again. The top file of the
results willbe ./build/html/index.html
Copy link
Member

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.

Copy link
MemberAuthor

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.

Copy link
Member

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.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Alright, I removed it.

@QuLogicQuLogicforce-pushed thesphinx-napoleon branch 2 times, most recently from58f367e tobe45da2CompareJanuary 5, 2016 08:01
@QuLogicQuLogicforce-pushed thesphinx-napoleon branch 2 times, most recently from74d4cb5 to94a7cd6CompareJanuary 6, 2016 03:39
@QuLogic
Copy link
MemberAuthor

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
Copy link
Member

Better to not let the prefect be the enemy of the good.

@QuLogicQuLogic changed the title[WIP] DOC: Use napoleon sphinx extensionDOC: Use napoleon sphinx extensionJan 6, 2016
@QuLogicQuLogicforce-pushed thesphinx-napoleon branch 2 times, most recently from85a764b toa016430CompareJanuary 6, 2016 08:36
@QuLogic
Copy link
MemberAuthor

Let's call this done for now then, and I'll work on the other stuff in another PR as time permits.

@mdboom
Copy link
Member

Should we hold off on this until investigating the bugs@QuLogic alluded to on gitter?

@tacaswelltacaswell modified the milestones:2.1 (next point release),2.0 (style change major release)Feb 8, 2016
@QuLogic
Copy link
MemberAuthor

Once we merge the PRs from@jenshnielsen, this should work without warning on Sphinx 1.4. Thenapoleon_use_param=False setting also makes the bugs go away with 1.3, but there are still some warnings.

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.

@tacaswelltacaswell changed the base branch fromv2.x tov2.0.xJanuary 20, 2017 16:04
@tacaswelltacaswell reopened thisJan 20, 2017
@QuLogicQuLogic changed the base branch fromv2.0.x tomasterJanuary 20, 2017 22:08
@tacaswelltacaswell modified the milestones:2.1 (next point release),2.1.1 (next bug fix release)Sep 24, 2017
@tacaswelltacaswell modified the milestones:2.1.1 (next bug fix release),2.2 (next feature release)Oct 9, 2017
@jklymak
Copy link
Member

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
Copy link
Member

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.
@QuLogic, what are your thoughts on this now?

@timhoffm
Copy link
Member

timhoffm commentedApr 17, 2018
edited
Loading

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
Copy link
Member

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
Copy link
Contributor

Reopening per#11397 (comment).

@anntzeranntzer reopened thisJun 15, 2018
@timhoffm
Copy link
Member

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
Copy link
Contributor

fwiw, it looks like sklearn (including one of numpydoc's maintainers...) is considering switching to napoleon (scikit-learn/scikit-learn#11440).

@matthew-brett
Copy link
Contributor

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
Copy link
Contributor

That's why I said "considering", not "decided".
However I agree with Gael's points:

Is there a long-term reason that Napoleon would get less maintenance than
numpydocs if projects switch to it? It's embedded in sphinx, so it will
get a lot of exposure. Of course, it's a question of community dynamics,
and there is a lot of social in there.

That it's included in sphinx. I tend to hope that it is more likely to
become a community standard. Everybody who does sphinx docs has napoleon.

@matthew-brett
Copy link
Contributor

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?

anntzer and timhoffm reacted with thumbs up emoji

@timhoffm
Copy link
Member

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
Copy link
Member

Isupsect even if we want to switch tonapoleon, this PR is so out of date that attempting to rebase it will be more hassle than it's worth; if no-one objects in a week or so I'll close this but leave the issue open.

timhoffm reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Move from numpydoc to sphinxcontrib-napoleon
12 participants
@QuLogic@tacaswell@efiring@mdboom@jenshnielsen@NelleV@jklymak@timhoffm@anntzer@matthew-brett@dstansby@story645

[8]ページ先頭

©2009-2025 Movatter.jp