DOC Convert style sheet examples to MEP12#7890
Conversation
6d43d72 to
4562a4c
Compare
| 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.
Question to a PEP8 expert (@QuLogic ?) : are URLs longer than 80 characters OK with our pycodestyle setup?
There was a problem hiding this comment.
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.
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.
@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.
Yes, it does: our documentation build is else going to fail.
(To be precise, lines can be longer, but not shorter than the title)
4562a4c to
69eee92
Compare
NelleV
left a comment
There was a problem hiding this comment.
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.
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.
Remove this line; the return value is not used for anything.
| # Fixing random state for reproducibility | ||
| np.random.seed(19680801) | ||
|
|
||
| fig, ax = plt.subplots() |
There was a problem hiding this comment.
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.
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.