-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MAINT: consistent use of print(__doc__)
in examples
#21307
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
MAINT: consistent use of print(__doc__)
in examples
#21307
Conversation
3a8411b
to
dc1c5e5
Compare
I would say include them to be consistent. (Although it does not look as nice having a
In those cases, I think it is best to leave them as is. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks !
0f4d5eb
to
4a99a5f
Compare
So historically, they were there since we'd have pretty much all of the text on top of the file, and then the print would print all the information related to the example. But these days our examples are sectioned, and suited for a nice sphinx rendering and notebooks, and users can run them in binder. I'd say it'd be nicer if we remove them from all the files. |
Both are OK with me. I just need a wider agreement on what is the best solution. Can I help reach it? |
pinging @scikit-learn/core-devs since we kinda need an agreement on this. Question is: should we remove |
I'd tend towards removing as well. The printing is useful if one blindly runs the example from the command line without even looking at the code, but I'm not sure many people do (or even should) do that. |
I vote for removing. I think that people's usage patterns have evolved
and it is no longer beneficial.
|
I don't have a strong opinion for or against removing. |
no objection to remove them
… |
I prefer to remove it. |
4a99a5f
to
990738e
Compare
I have removed the initial Only exception, the 3 examples under |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work!
I just merged master and we can check if all CIs become green. |
Thanks @DimitriPapadopoulos |
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
What does this implement/fix? Explain your changes.
Run
print(__doc__)
right after the example docstring.As suggested in #21246 (review).
Any other comments?
examples/release_highlights
lack aprint(__doc__)
so I haven't added it (yet). Should I?examples/text
print__doc__
later in the code, together with additional usage information. Not sure I should change them.scikit-learn/examples/text/plot_document_classification_20newsgroups.py
Lines 111 to 113 in 2f2364d
scikit-learn/examples/text/plot_document_clustering.py
Lines 119 to 120 in 2f2364d
scikit-learn/examples/text/plot_hashing_vs_dict_vectorizer.py
Lines 65 to 68 in 2f2364d