Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
ENH examples are now reproducible #7386
Conversation
NelleV
changed the title from
ENH examples are now reproducible to [MRG] ENH examples are now reproducible
Nov 3, 2016
story645
added the
Documentation
label
Nov 3, 2016
|
LGTM but super curious if you did this manually or with a script. |
|
I git grepped to find which examples needed it and did it manually. With vim it was quite straightforward and reasonable fast (~20minutes). |
|
The code added after functions is one line too high; should be two blank lines after the function and one after the new code, but it's the other way around. |
|
@QuLogic I am not sure what you mean by this. pep8 is happy. |
| @@ -7,6 +7,10 @@ | ||
| from matplotlib.collections import EventCollection | ||
| import numpy as np | ||
| +# Fixing random state for reproducibility | ||
| +np.random.seed(19680801) |
|
Maybe pep8 became less strict about it, or maybe it only requires two blank lines before the function? I prefer to also use two blank lines after (at least for top-level functions). |
|
It only requires two blank lines before a function. It has never required blank lines after. |
|
The seed is, in many places, one blank line away from the function and two blank lines away from the code. This makes it "seem" more related to the function when it's not. So the single blank line after the function is not bad; it's just the implication when coupled with the two blank lines below the seeding. |
QuLogic
referenced
this pull request
Nov 3, 2016
Closed
DOC: Use a consistent random seed in examples. #7382
QuLogic
added this to the
2.1 (next point release)
milestone
Nov 3, 2016
|
I think @ivanov noted some other files in |
|
I'll do another PR for those, as they shouldn't be in that folder (it predates the gallery generation scripts). |
ivanov
changed the title from
[MRG] ENH examples are now reproducible to [MRG+1] ENH examples are now reproducible
Nov 3, 2016
tacaswell
merged commit dbf9c44
into matplotlib:master
Nov 3, 2016
|
|
NelleV commentedNov 3, 2016
supersedes #7382