MNT: reference the proper variable in bootstrapper#7868
MNT: reference the proper variable in bootstrapper#7868NelleV merged 1 commit intomatplotlib:masterfrom
Conversation
NelleV
left a comment
There was a problem hiding this comment.
This looks good.
(I think at some point, we'll maybe have to expose a couple of parameters to make sure some elements are reproducible in this piece of code, but that is out of scope for this PR).
| ii = np.random.randint(M, size=(N, M)) | ||
| bsData = x[ii] | ||
| bs_index = np.random.randint(M, size=(N, M)) | ||
| bsData = data[bs_index] |
There was a problem hiding this comment.
np.random.choice(data, N * len(data), replace=True).reshape((N, M))?
There was a problem hiding this comment.
@anntzer that looks like it would work too. Not sure that performance would be significantly impacted in either direction. So I'm going to punt of figuring out which is better until the refactor associated with MEP 28 like a mentioned in my comment to Nelle.
There was a problem hiding this comment.
np.random.choice(, ...) is basically implemented as array[np.random.randint(...)] so it's the same.
|
|
||
| ii = np.random.randint(M, size=(N, M)) | ||
| bsData = x[ii] | ||
| bs_index = np.random.randint(M, size=(N, M)) |
There was a problem hiding this comment.
Much better than before! Using underscored bs_index next to camelcased bsData is a bit strange... bsIndices would be my choice. but I'm nitpicking :)
There was a problem hiding this comment.
The latter is not pep8 compliant, so I'd rather go for the pep8 compliant one though it is not coherent on this particular function.
|
I am very tempted not to wait for appveyor… |
|
Meh, unless we're cutting a release right now I don't see what merging early buys... |
|
@dopplershift We have a lot of pull requests opened right now, and if PRs don't appear on the first page, they tend to be forgotten by reviewers. |
Current coverage is 62.12% (diff: 100%)@@ master #7868 diff @@
==========================================
Files 174 174
Lines 56072 56072
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 34833 34833
Misses 21239 21239
Partials 0 0
|
|
Thanks @phobson ! |
|
Backported to |
MNT: reference the proper variable in bootstrapper
Cleans up some unclear code that magically worked due to python's scoping rules.
ref comment