-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC Convert style sheet examples to MEP12 #7890
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
6d43d72
to
4562a4c
Compare
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.
LGTM.
This example demonstrates the style used in the Bayesian Methods for Hackers | ||
[1]_ online book. | ||
|
||
.. [1] http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/ |
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.
Question to a PEP8 expert (@QuLogic ?) : are URLs longer than 80 characters OK with our pycodestyle setup?
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.
I was wondering about that too and pushed this to see if the build would fail.
Obviously there isn't much of a way around this short of using a URL shortener or something.
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.
I think it might ignore URLs in docstrings. You could get it to fit with backslashes, but it'd be ugly.
===================== | ||
Bayesian Methods for Hackers style sheet | ||
===================== | ||
|
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.
@NelleV does the length of the =
's need to match the title?
E.g.,
=====================
Bayesian Methods for Hackers style sheet
=====================
vs
=========================================
Bayesian Methods for Hackers style sheet
=========================================
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.
Yes, it does: our documentation build is else going to fail.
(To be precise, lines can be longer, but not shorter than the title)
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.
👍
4562a4c
to
69eee92
Compare
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 patch!
Waiting for the CI stuff to finish before merging.
This example demonstrates the style used in the Bayesian Methods for Hackers | ||
[1]_ online book. | ||
|
||
.. [1] http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/ |
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.
I think it might ignore URLs in docstrings. You could get it to fit with backslashes, but it'd be ugly.
def plot_beta_hist(ax, a, b): | ||
ax.hist(beta(a, b, size=10000), histtype="stepfilled", | ||
bins=25, alpha=0.8, normed=True) | ||
return ax |
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.
Remove this line; the return value is not used for anything.
@@ -12,13 +16,16 @@ | |||
# Fixing random state for reproducibility | |||
np.random.seed(19680801) | |||
|
|||
fig, ax = plt.subplots() |
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.
You might need to do this within the context to ensure that general figure styling matches the style.
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.
Or maybe change the example to use plt.style.use
like the other ones.
Should this get back-ported to |
DOC: Convert style sheet examples to MEP12
backported to |
Hmm, I should have made that a hard "Request changes"; the fivethirtyeight example is wrong because the figure is not created within the context, but I had not tested it out at the time. |
yeah, I was about to update when I saw that it had been merged - can send in another quick PR |
Thanks @naoyak. |
Ref: #7206
Added titles to docstrings for sphinx-gallery and updated some code syntax.