8000 [MRG] DOC examples with correct notebook style by plagree · Pull Request #9061 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

[MRG] DOC examples with correct notebook style #9061

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 4 commits into from
Jun 20, 2017

Conversation

plagree
Copy link
Contributor
@plagree plagree commented Jun 8, 2017

Reference Issue

Fix #8979

What does this implement/fix? Explain your changes.

A lot of examples were written with some separator of this form to make clearer:

#####################
# Plotting

The issue is that those separators are interpreted in sphinx-gallery and transformed to a notebook style which was not intended at first. This PR aims at fixing those bad displays.

It is at early stage of fix. The objective is to have a visualization of the fix on a few examples.

@plagree plagree force-pushed the example_notebook_style branch from d9287ff to ed62ea0 Compare June 13, 2017 08:58
@plagree plagree changed the title [WIP] DOC examples with correct notebook style [MRG] DOC examples with correct notebook style Jun 13, 2017
@plagree
Copy link
Contributor Author
plagree commented Jun 13, 2017

Ping @lesteve for review

2 examples of changes brought by this PR:

@lesteve
Copy link
Member
lesteve commented Jun 14, 2017

Please use "Fix #issueNumber" in your PR description, this way the associated issue gets closed automatically when the PR is merged. For more details, look at this. I have edited your description but try to remember next time.

@lesteve
Copy link
Member
lesteve commented Jun 14, 2017

I am not too sure this is a great use of the notebook style example: https://11259-843222-gh.circle-artifacts.com/0/home/ubuntu/scikit-learn/doc/_build/html/stable/auto_examples/linear_model/plot_lasso_model_selection.html.

Basically not having the last two plots side-by-side makes it harder to compare them.

See http://scikit-learn.org/0.17/auto_examples/linear_model/plot_lasso_model_selection.html for how the example looked before the notebook-style changes in sphinx-gallery.

@lesteve
Copy link
Member
lesteve commented Jun 14, 2017

Thinking about it actua 8000 lly, I reckon the best course of action is to replace the 2nd # by a space, i.e. replace:

######################################
# A comment goes here

by:

# ####################################
# A comment goes here

This way you still keep the comment as a way to structure the example and sphinx-gallery will not create a cell.

@jnothman
Copy link
Member

An alternative may be RST-style headings:

# A comment goes here
# ===================

@lesteve
Copy link
Member
lesteve commented Jun 15, 2017

Yeah but I'd rather do an automatic replacement to get rid of the notebook style examples that weren't intended as such (i.e. all except the cached pipeline one AFAIK).

Transforming some examples to use the notebook style is possible but in other PRs, I would say.

@jnothman
Copy link
Member

were you replying to me? I was not objecting to that position.

@lesteve
Copy link
Member
lesteve commented Jun 15, 2017

were you replying to me? I was not objecting to that position.

Yes. It's just that we have some back on forth on this one at the sprint and I just wanted to make clear that I favoured the solution of not using the notebook style in this PR.

@glemaitre
Copy link
Member

@plagree Could you make the following changes:

Otherwise LGTM. However, I think that we should have a look to the example to improve some parts (use sphinx directives and notebook style where it makes sense).

@plagree plagree force-pushed the example_notebook_style branch from ed62ea0 to 7bbf4ae Compare June 20, 2017 08:09
@plagree
Copy link
Contributor Author
plagree commented Jun 20, 2017

Sorry for my delayed answer. Sure, I'll try to remember this "Fix #issueNumber" thing next time.

@glemaitre This is done. But I guess I should change back every modification I did to the pattern proposed by @lesteve ? Not only in examples/linear_model/plot_lasso_model_selection.html

@glemaitre
Copy link
Member

@plagree yep sorry. I was checking the example one by one. I forgot to mention this.
@lesteve style + the example which look strange and we should be good for a merge

@glemaitre
Copy link
Member

LGTM @raghavrv can you have a quick look

Copy link
Member
@raghavrv raghavrv left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. I'm merging this.

@raghavrv raghavrv merged commit 1f6ac72 into scikit-learn:master Jun 20, 2017
dmohns pushed a commit to dmohns/scikit-learn that referenced this pull request Aug 7, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
dmohns pushed a commit to dmohns/scikit-learn that referenced this pull request Aug 7, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
AishwaryaRK pushed a commit to AishwaryaRK/scikit-learn that referenced this pull request Aug 29, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
jwjohnson314 pushed a commit to jwjohnson314/scikit-learn that referenced this pull request Dec 18, 2017
* DOC examples with correct notebook style

* Modifications in examples/ to avoid unwanted notebook style

* Remove last notebook style example

* Space formatting to avoid notebook style
@GaelVaroquaux GaelVaroquaux mentioned this pull request Feb 7, 2022
47 tasks
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.

DOC Reviews examples and correct notebook style when it was not intended
5 participants
0