Skip to content

[MRG] update numpydoc to upstream, include fix for line numbers #7355

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

Merged
merged 14 commits into from
Jul 18, 2017

Conversation

amueller
Copy link
Member

@amueller amueller commented Sep 7, 2016

Fixes #4077.

This also includes numpy/numpydoc#61 which fixes the gigantic long tracebacks generated by numpydoc. Now they are actually (approximately) helpful.

The new numpydoc has a Yields section which I didn't make use of yet.

It looks like having trailing underscores at attributes and not having backticks is an error again. I'm not sure why that is. I know it used to be that way. Did we hack our numpydoc at some point? Maybe @jnothman or @ogrisel or @GaelVaroquaux remember?

Oh and obviously I fixed the upstream stuff so I have less trouble fixing our docs for the release, so this would be nice to merge ;)


This change is Reviewable

@amueller amueller added this to the 0.18 milestone Sep 7, 2016
@amueller amueller changed the title update numpydoc to upstream, include fix for line numbers [MRG] update numpydoc to upstream, include fix for line numbers Sep 7, 2016
@jnothman
Copy link
Member

jnothman commented Sep 7, 2016

Did we hack our numpydoc at some point?

We certainly did. The merge with upstream is not so simple.

@amueller
Copy link
Member Author

amueller commented Sep 7, 2016

@jnothman This PR does it. And it's not so bad. There are two changes relative to numpydoc master in here. I would argue both are bugfixes (and have PRs to upstream)

@jnothman
Copy link
Member

jnothman commented Sep 8, 2016

This PR does it. And it's not so bad.

Sorry I didn't read properly. Would it be worth doing a diff of the HTML generated to make sure you've not missed any differences?

@amueller
Copy link
Member Author

amueller commented Sep 8, 2016

There are probably quite some differences, but I'll try to do a diff.

@amueller
Copy link
Member Author

amueller commented Sep 8, 2016

There is no table for the methods with links, and the attributes are now below the notes. The attributes should be documented like the methods now. I'm not sure where the method table went, I think that was my fault.

@amueller
Copy link
Member Author

amueller commented Sep 8, 2016

So this might indeed need a little bit more work.

@amueller amueller modified the milestones: 0.18, 0.19 Sep 22, 2016
@amueller
Copy link
Member Author

This should be good now. The new version has the Attribute section next to the Methods section, instead next to the Parameters section. Otherwise the docs should be pretty much the same.

@jnothman
Copy link
Member

I don't think having attributes after References makes sense in our context, even if I get why Attributes and Methods logically fit together. Should we change numpydoc to make this configurable?

@jnothman
Copy link
Member

Also, I think we should rename numpy_ext to numpydoc?

@amueller
Copy link
Member Author

amueller commented Nov 2, 2016

happy to change numpy_ext to numpydoc, this way I thought the diff would be easier to read (though I guess a git mv should work).

Making the order of sections configurable would be nice indeed. It's not super obvious but doable.
I'm not sure what a good order would be though. Do you think methods after references makes sense?

@jnothman
Copy link
Member

jnothman commented Nov 3, 2016

The ordering should emphasise the "things you should know" or "things you
might not know were there" first. It's fine to have methods after
references, as methods are mostly common (with small variation). I'd also
like to find a way to put the gallery of auto_examples higher in the file,
but am not sure how that interacts with sphinx_gallery, and didn't find a
way to do it easily when I first introduced the gallery.

On 3 November 2016 at 08:28, Andreas Mueller notifications@github.com
wrote:

happy to change numpy_ext to numpydoc, this way I thought the diff would
be easier to read (though I guess a git mv should work).

Making the order of sections configurable would be nice indeed. It's not
super obvious but doable.
I'm not sure what a good order would be though. Do you think methods after
references makes sense?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7355 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz69nPzLj3fSxCAnYwETuVl-wdCgL-ks5q6QCLgaJpZM4J3NUn
.

@jnothman
Copy link
Member

jnothman commented Nov 3, 2016

I think the key point, though, is that attributes are more important for a
description of our estimators than they are in numpy docs.

On 3 November 2016 at 12:03, Joel Nothman joel.nothman@gmail.com wrote:

The ordering should emphasise the "things you should know" or "things you
might not know were there" first. It's fine to have methods after
references, as methods are mostly common (with small variation). I'd also
like to find a way to put the gallery of auto_examples higher in the file,
but am not sure how that interacts with sphinx_gallery, and didn't find a
way to do it easily when I first introduced the gallery.

On 3 November 2016 at 08:28, Andreas Mueller notifications@github.com
wrote:

happy to change numpy_ext to numpydoc, this way I thought the diff would
be easier to read (though I guess a git mv should work).

Making the order of sections configurable would be nice indeed. It's not
super obvious but doable.
I'm not sure what a good order would be though. Do you think methods
after references makes sense?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#7355 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz69nPzLj3fSxCAnYwETuVl-wdCgL-ks5q6QCLgaJpZM4J3NUn
.

@neerajgangwar
Copy link
Contributor

Feature request: Is it possible to move numpydoc to sklearn/externals? It will help in #7793.

@amueller
Copy link
Member Author

yes, but we need numpy/numpydoc#77 first. Hurray for cross-project dependency chains!

@jnothman
Copy link
Member

We can do this now... :)))

@jnothman
Copy link
Member

I would like to see this happen. It holds up some other fixes. But I'd also rather see us depend on numpydoc as a pypi dependency rather than including the source. WDYT?

@amueller amueller mentioned this pull request Jun 19, 2017
@amueller
Copy link
Member Author

right now the circle build doesn't have the template mechanism for moving the attributes up. But otherwise it looks good. We can either wait for a numpydoc release (which seems imminent) or pip install the github version. Without this it's near impossible to fix doc build errors....

@jnothman
Copy link
Member

jnothman commented Jun 19, 2017 via email

@amueller
Copy link
Member Author

yeah, it's not really ;)

@amueller
Copy link
Member Author

The thing is more that it helps get rid of all the issues in the website. Cherry picking to and fro from this branch is pretty annoying.

@amueller
Copy link
Member Author

Numpydoc was just released, I'm triggering Circle so we can see what it looks like.

@ogrisel
Copy link
Member

ogrisel commented Jun 26, 2017

The files doc/sphinxext/README.txt and doc/sphinxext/LICENSE.txt should be deleted (I think).

# Conflicts:
#	sklearn/datasets/species_distributions.py
@amueller
Copy link
Member Author

@ogrisel done :)

@ogrisel ogrisel merged commit 71408e0 into scikit-learn:master Jul 18, 2017
@jnothman
Copy link
Member

This has drastically changed the attributes listing. See any class, e.g. http://scikit-learn.org/dev/modules/generated/sklearn.cluster.bicluster.SpectralBiclustering.html

@jnothman
Copy link
Member

@jnothman
Copy link
Member

Numpydoc changed Attributes from a Parameter List to a Member List.

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Attributes issue raised at numpy/numpydoc#102

@amueller
Copy link
Member Author

@jnothman I though we were fine with that? I posted screenshots above.

@jnothman
Copy link
Member

jnothman commented Jul 22, 2017 via email

@amueller
Copy link
Member Author

I don't think it's unreadable, but yeah, it was better before. So we could revert, monkey patch, or fix in upstream and use a dev version to build the website?

@jnothman
Copy link
Member

jnothman commented Jul 23, 2017 via email

@jnothman
Copy link
Member

A particularly bad case of attributes at http://scikit-learn.org/dev/modules/generated/sklearn.model_selection.GridSearchCV.html. See numpy/numpydoc#104. Perhaps we should consider reverting before we get bug reports about this, pending some fixes upstream that I hope I find time to make.

@amueller
Copy link
Member Author

That's indeed pretty bad. I'm slightly against reverting because it makes error messages unreadable. But I guess readable docs is more important than readable doc-building error messages.

@jnothman
Copy link
Member

jnothman commented Jul 24, 2017 via email

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

Successfully merging this pull request may close these issues.

Sync docstring->Sphinx processing with the numpydoc project
5 participants