Repository navigation
REF/TST: add seed to hdrboxplot, Use random order in pytest - #5148
Conversation
|
Closes #5110 |
|
xref #4965 |
|
Is there a way to replicate a specific random order when we need to investigate a failure? |
|
You can pass the seed argument to reproduce the same order |
|
The first 4 environments on travis that I have checked have only test failures in |
|
Ok, those are mainly regression tests but it doesn't set the seed in random panel. I will have to redo the regression test numbers because I don't know what seed or random state was used. The unit tests don't fail when I run the entire test module, but fails if I just run the test class. (half smart: The seed for the random panel is printed out and it uses a specific RandomState instance, but the followups in the test class use again the global random state where we don't know the seed to replicate.) |
|
PR for Theil test is #5149 |
d687b1e to
540e1d7
Compare
|
I think this can be merged after I rebase and it gets green. I added a fix that only seems to affect appveyor. |
767049d to
96fe3ab
Compare
96fe3ab to
91a29da
Compare
Codecov Report
@@ Coverage Diff @@
## master #5148 +/- ##
==========================================
+ Coverage 81.42% 81.42% +<.01%
==========================================
Files 581 581
Lines 90273 90277 +4
Branches 10099 10101 +2
==========================================
+ Hits 73508 73512 +4
Misses 14479 14479
Partials 2286 2286
Continue to review full report at Codecov.
|
9e03aca to
845e039
Compare
| #for ii, yy in enumerate([y1, y2, y3, y4]): | ||
| # fig = plt.figure() | ||
| # ax = fig.add_subplot(111) | ||
| # for ii, yy in enumerate([y1, y2, y3, y4]): |
There was a problem hiding this comment.
Are these worth keeping as comments? Or actually just defunct code? If it's the latter then second-best (after deleting) is to keep them pep8-invalid so they don't fall through the cracks.
845e039 to
8cfcbb8
Compare
Use random order to avoid intertest dependency
Ensure correct warning type is issued
890adbb to
c5bf4a6
Compare
|
@josef-pkt This is ready now. The changes to HDR are all backward compat and are both good practice and helpful in testing. |
| data = zip(range(dim), itertools.repeat((band, pca, | ||
| bounds, ks_gaussian))) | ||
| bounds, ks_gaussian, | ||
| seed, use_brute))) |
There was a problem hiding this comment.
Doesn't this use the same seed in each call/repeat?
causing perfect correlation across dim
(I never tried to understand the details here.)
There was a problem hiding this comment.
seed is just used for differential evolution, so maybe/likely it doesn't matter.
There was a problem hiding this comment.
No, it ultimately calls
which takes idx as a parameter (which comes from range).
I'm not trying to fix anything other than to allow it to be deterministic.
There was a problem hiding this comment.
But AFAICS it changes the differential evolution behavior.
Before it was using the global random state which continuous the random chain with each call.
Now it uses the same seed in each call to differential_evolution.
I don't think anymore that it matters in this case, but in general using identical seed would be incorrect, e.g. in bootstrap or parallel randomized optimization for the same function. The latter is the case that I thought about initially.
Allow seed to be set in differential evolution Allow end user to choose algorithm Set seed in all tests for reproducible results Small cleanups for style
c5bf4a6 to
0876cc7
Compare
|
I changed the title and added labels to indicate it includes now also a REF/ENH in graphics. |
|
If seed=None then the global is still used everywhere. |
Good, thanks for pointing it out. I skimmed the docstrings too fast, and didn't think about this. |
|
ETA for appveyor looks like 12 hours. merge when green |
|
@josef-pkt defacto green |
|
as green as it gets, merging @bashtage Thank you |
Use random order to avoid intertest dependency
Tests show there are some problems with order affecting test success.