Skip to content

[MRG + 1] DOC :issue: role to simplify what's news#7657

Merged
jnothman merged 5 commits intoscikit-learn:masterfrom
jnothman:sphinx_issues
Oct 25, 2016
Merged

[MRG + 1] DOC :issue: role to simplify what's news#7657
jnothman merged 5 commits intoscikit-learn:masterfrom
jnothman:sphinx_issues

Conversation

@jnothman
Copy link
Copy Markdown
Member

@jnothman jnothman commented Oct 12, 2016

I find the issue links in what's new to take up far too much space. The sphinx-issues project provides RST roles to simplify this, which I have here imported. I've just translated a sample to the role format, and will do more by regular expression shortly if others think this is a good idea.

It would also be good to use something like:

:user:`Joel Nothman <jnothman>`

for irregular contributors so we don't often need to modify the list of hyperlink targets at the bottom of the file. However, sphinx-issues does not currently support custom anchor text

@jnothman
Copy link
Copy Markdown
Member Author

To emphasise the benefit of :issue:, I've found a few cases where the number in the anchor text and the number in the link don't match.

@GaelVaroquaux
Copy link
Copy Markdown
Member

GaelVaroquaux commented Oct 12, 2016 via email

@jnothman
Copy link
Copy Markdown
Member Author

The code's in the repo. All 105 lines of it.

@jnothman
Copy link
Copy Markdown
Member Author

I mean, we could rewrite those macros, but why?

@GaelVaroquaux
Copy link
Copy Markdown
Member

I mean, we could rewrite those macros, but why?

Fair enough.

I have an alergy to sphinx extensions / macros because:

  1. I don't like having non-standard rst
  2. Any code we put in will break at some point (got bitten by this a few
    days ago: [MRG+1] DOC: fix the copybutton on the code blocks #7634)

@jnothman
Copy link
Copy Markdown
Member Author

jnothman commented Oct 12, 2016

:) But these:

  1. Are fairly simple implementations
  2. make the RST much more readable: it's hard to even match parentheses visually with the former version
  3. reduce the rate of error for entering issue links substantially (I found many with numbers mismatched, with _ missing from the end, with # missing from the anchor text, etc.)
  4. reduce the effort for entering issue links substantially, which is really the annoyance I wanted to save when adding what's new after the fact.
  5. are really easy to grep for to check what's new coverage of issues in a release

@jnothman
Copy link
Copy Markdown
Member Author

Honestly, no one checks what's new rendering in review, so we should at least make it easy syntactically to add entries!

@jnothman
Copy link
Copy Markdown
Member Author

As a concession to your very valid remarks, @GaelVaroquaux, I have crossed out the possibility of using the :user: macro. We can even delete it from the code if you insist!

@jnothman
Copy link
Copy Markdown
Member Author

test-sphinxext had been failing due to a missing docutils dependency. Have worked around


- Fix issue where ``min_grad_norm`` and ``n_iter_without_progress``
parameters were not being utilised by :class:`manifold.TSNE`.
`#6497 <https://github.com/scikit-learn/scikit-learn/pull/6497>`_
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

niptick: you could remove the line break here and there

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I realise. I've not worked out the regex to do so, and have little time to put to it manually. Contrib welcome.

@TomDLT
Copy link
Copy Markdown
Member

TomDLT commented Oct 13, 2016

The readability is indeed much better, yet I have no opinion upon adding rst macro.

@amueller
Copy link
Copy Markdown
Member

yes please, I just fixed many of them manually.

@amueller
Copy link
Copy Markdown
Member

I would also be +1 on the user role because a) the list at the bottom will get pretty long and b) people don't know how the references work and add a link to a name that is not declared at the bottom.

@jnothman
Copy link
Copy Markdown
Member Author

I would also be +1 on the user role because a) the list at the bottom will get pretty long and b) people don't know how the references work and add a link to a name that is not declared at the bottom.

Shh, Andy, one change at a time and we'll get this through the censors :P

@jnothman
Copy link
Copy Markdown
Member Author

Anyone have an easy way to fix up the line wrapping, or do I need to think?

@GaelVaroquaux
Copy link
Copy Markdown
Member

GaelVaroquaux commented Oct 15, 2016 via email

@jnothman
Copy link
Copy Markdown
Member Author

I am much more worried by the core codebase getting too complex than by
this.

Yes, I appreciate this. Some of the complexity is part of maturation. Some of it is having accepted too much breadth that we're beginning to struggle to maintain.

@jnothman
Copy link
Copy Markdown
Member Author

I've neatened up wrapping etc. Merge or rejection welcome before rebase gets out of hand.

@amueller
Copy link
Copy Markdown
Member

+1

@amueller amueller changed the title DOC :issue: role to simplify what's news [MRG + 1] DOC :issue: role to simplify what's news Oct 19, 2016
@amueller
Copy link
Copy Markdown
Member

I had two PRs within the last two days that had missing links for users...

@amueller
Copy link
Copy Markdown
Member

@ogrisel @agramfort @raghavrv wdyt?

@jnothman
Copy link
Copy Markdown
Member Author

But the extension doesn't currently support user links with custom anchor
text, so this PR isn't ready to do that yet.

On 21 October 2016 at 01:13, Andreas Mueller notifications@github.com
wrote:

@ogrisel https://github.com/ogrisel @agramfort
https://github.com/agramfort @raghavrv https://github.com/raghavrv
wdyt?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#7657 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEz641JKSEZxFWJ-PBuXIBuQwzUyc1Xks5q13b5gaJpZM4KVUEr
.

@raghavrv
Copy link
Copy Markdown
Member

I am +1 for this because

  • when one adds an issue information to a whatsnew entry one tends to copy that issue linking format and forgets to update either the link text or the link address (most often the address). This will help avoid such inconsistency.
  • Plus it's easier on the eyes.

@amueller
Copy link
Copy Markdown
Member

@jnothman right. I'll send a patch upstream?

@amueller
Copy link
Copy Markdown
Member

I'm happy to merge this as-is though

@raghavrv
Copy link
Copy Markdown
Member

raghavrv commented Oct 20, 2016

Let's do the merge and maybe make an issue for that later?

@amueller
Copy link
Copy Markdown
Member

@raghavrv @jnothman made an issue here: sloria/sphinx-issues#1 and I made a PR here: sloria/sphinx-issues#3

@NelleV
Copy link
Copy Markdown
Member

NelleV commented Oct 25, 2016

I am 👍 for the merge now. This makes the what's new page much more readable.

@jnothman
Copy link
Copy Markdown
Member Author

Merging. @amueller, I think it would be a good idea to backport changes into 0.18.X

@jnothman jnothman merged commit 3f4524e into scikit-learn:master Oct 25, 2016
@amueller
Copy link
Copy Markdown
Member

yeah, but I feel like we should update the version with the one that is currently in upstream. This one doesn't include my patch for the user names, right?

amueller pushed a commit to amueller/scikit-learn that referenced this pull request Oct 25, 2016
@jnothman
Copy link
Copy Markdown
Member Author

But you made no changes to the feature used here. I've made an issue for #7748 :author: use. I don't see the point in needing more rebases along the way.

amueller pushed a commit to amueller/scikit-learn that referenced this pull request Oct 27, 2016
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
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.

6 participants