Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 1 commit into from
Jan 21, 2017

Conversation

naoyak
Copy link
Contributor

@naoyak naoyak commented Jan 20, 2017

Ref: #7206

Added titles to docstrings for sphinx-gallery and updated some code syntax.

@naoyak naoyak changed the title Convert style sheet examples to MEP12 DOC Convert style sheet examples to MEP12 Jan 20, 2017
@naoyak naoyak force-pushed the mep12-style-sheets branch from 6d43d72 to 4562a4c Compare January 20, 2017 10:01
Copy link
Contributor

@afvincent afvincent left a 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/
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Member

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
=====================

Copy link
Member

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
=========================================

Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@naoyak naoyak force-pushed the mep12-style-sheets branch from 4562a4c to 69eee92 Compare January 20, 2017 18:32
@NelleV NelleV changed the title DOC Convert style sheet examples to MEP12 [MRG+2] DOC Convert style sheet examples to MEP12 Jan 20, 2017
Copy link
Member

@NelleV NelleV left a 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/
Copy link
Member

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
Copy link
Member

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()
Copy link
Member

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.

Copy link
Member

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.

@phobson phobson merged commit 59478d2 into matplotlib:master Jan 21, 2017
@naoyak naoyak deleted the mep12-style-sheets branch January 21, 2017 03:41
@phobson
Copy link
Member

phobson commented Jan 21, 2017

Should this get back-ported to v.2.0.0-doc? My thought is yes

phobson added a commit that referenced this pull request Jan 21, 2017
DOC: Convert style sheet examples to MEP12
@phobson
Copy link
Member

phobson commented Jan 21, 2017

backported to v2.0.0-doc as 64fdd33

@QuLogic
Copy link
Member

QuLogic commented Jan 21, 2017

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.

@naoyak
Copy link
Contributor Author

naoyak commented Jan 21, 2017

yeah, I was about to update when I saw that it had been merged - can send in another quick PR

@QuLogic
Copy link
Member

QuLogic commented Jan 21, 2017

Thanks @naoyak.

@QuLogic QuLogic changed the title [MRG+2] DOC Convert style sheet examples to MEP12 DOC Convert style sheet examples to MEP12 Jan 21, 2017
@QuLogic QuLogic added this to the 2.0.1 (next bug fix release) milestone Jan 21, 2017
@naoyak naoyak restored the mep12-style-sheets branch January 21, 2017 04:20
@naoyak
Copy link
Contributor Author

naoyak commented Jan 21, 2017

@QuLogic thanks for the input, I put those changes into #7900.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants