-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
DOC use notebook-style for plot_bayesian_ridge.py #22794
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
Conversation
|
Thanks for your PR, FYI I edited the title of your PR so that it contains the example filename. The reason for this is that we have a script that updates the #22406 automatically and relies on the example filename being in the PR title. |
ogrisel
left a comment
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.
Thanks for the PR @fkaren27!
I had a look at the rendering from the CI (see the "doc artifact" link):
https://181160-843222-gh.circle-artifacts.com/0/doc/auto_examples/linear_model/plot_bayesian_ridge.html
I think the 3 matplotlib figures would benefit from being each in their own cell. So please introduce new cell markers # %% to separate them.
Note that when doing so, the final line of the first cell will be:
plt.legend(loc="best", prop=dict(size=12)the returned value of that function call will then be displayed in a yellow rectangle used to render the output of the cell in notebook-style examples. Since the string representation of a matplotlib legend object is not interesting to the reader, we silence such noisy output with a dummy variable assignment:
_ = plt.legend(loc="best", prop=dict(size=12)
You can also drop the final plt.show(), I think.
|
The black formatter complains on the CI. To automatically fixes those, you can run: or directly using VS Code ( |
jeremiedbb
left a comment
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.
Thanks @fkaren27. I think the rendering would be improved by making the comments separating sections as titles
Co-authored-by: Jérémie du Boisberranger <[email protected]>
|
Merging, thanks a lot! |
Co-authored-by: Jérémie du Boisberranger <[email protected]> Co-authored-by: Loïc Estève <[email protected]>
Reference Issues/PRs
towards #22406
This is a work in progress as part of the #pariswimlds sprint.