Skip to content
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

Fix notebook-style examples #22406

Closed
47 tasks done
GaelVaroquaux opened this issue Feb 7, 2022 · 47 comments · Fixed by #23365
Closed
47 tasks done

Fix notebook-style examples #22406

GaelVaroquaux opened this issue Feb 7, 2022 · 47 comments · Fixed by #23365
Assignees
Labels
Documentation Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve

Comments

@GaelVaroquaux
Copy link
Member

GaelVaroquaux commented Feb 7, 2022

Describe the issue linked to the documentation

Many legitimate notebook style examples have been broken, and specifically by the following PR
#9061

List of examples to update

Note for maintainers: the content between begin/end_auto_generated is updated automatically by a script. If you edit it by hand your changes may be reverted. The script doing the update: https://gist.github.com/lesteve/478d52599d394ec5e7f56dbf0827a5e9

Here are all the examples that use patterns like # ####### (found by ag -l '# #####*\s#' examples | sort, note there may be false positives ... for I removed examples/impute/plot_missing_values.py which is using # %% but also # #### as title underlines ...):

begin_auto_generated

end_auto_generated

Suggest a potential alternative/fix

The examples need to be reviewed on a case by case, to know whether they are "notebook-syle", as in https://sphinx-gallery.github.io/stable/tutorials/plot_parse.html#sphx-glr-tutorials-plot-parse-py or not. In general, we should favor notebook-style examples, which are typically more readable.

We should probably favor the "# %%" syntax to the long line of "###"
https://sphinx-gallery.github.io/stable/syntax.html#embed-rst-in-your-example-python-files

In terms of reviewing workflow, it can be useful to to send different PRs, rather than a big PR which will be harder to review.

Pieces of advice if you are interested in working on this issue

@GaelVaroquaux GaelVaroquaux added Easy Well-defined and straightforward way to resolve Documentation good first issue Easy with clear instructions to resolve help wanted Needs Triage Issue requires triage labels Feb 7, 2022
@glemaitre glemaitre removed the Needs Triage Issue requires triage label Feb 7, 2022
@soma2000-lang
Copy link

Working on this

@lesteve
Copy link
Member

lesteve commented Feb 8, 2022

I have added a list of examples that uses a pattern like # ##### for comments. I think it is best to create one PR by example, this will make it easier to review changes.

@ss-is-master-chief
Copy link
Contributor

@GaelVaroquaux Do you mean that we wish to standardize (# %% (preferred), or # ##) the block splitter across all relevant scripts?

@ss-is-master-chief
Copy link
Contributor

/take

@GaelVaroquaux
Copy link
Member Author

GaelVaroquaux commented Feb 8, 2022 via email

@ss-is-master-chief
Copy link
Contributor

@GaelVaroquaux Make sense! How would you recommend that I help with this?

@lesteve
Copy link
Member

lesteve commented Feb 8, 2022

@ss-is-master-chief I have added a "Pieces of advice if you are interested in working on this issue" section in the top post to help you (and potentially other interested people to get started). If something is not clear let us know!

@zuggernautt
Copy link
Contributor

I want to help.

@MaxwellLZH
Copy link
Contributor

@Valavanca
Copy link
Contributor

@brendo-k
Copy link
Contributor

@NartayAikyn
Copy link
Contributor

@aditya172926
Copy link
Contributor

@svenstehle
Copy link
Contributor

@krishnakoumar27
Copy link
Contributor

@danifernandes-hub
Copy link
Contributor

@svenstehle
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Easy Well-defined and straightforward way to resolve good first issue Easy with clear instructions to resolve
Projects
None yet