Check new neighbors deterministically#195
Conversation
One-exchange neighborhood iterator rigorously checks some of the generated configurations. The check is performed with the probability 5 %, as decided by `np.random`. Make the check deterministic (using an explicitly seeded `np.random.RandomState`) instead of relying on the default numpy random state, which need not be seeded.
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
=======================================
Coverage 66.33% 66.33%
=======================================
Files 17 17
Lines 1613 1613
=======================================
Hits 1070 1070
Misses 543 543 Continue to review full report at Codecov.
|
mfeurer
left a comment
There was a problem hiding this comment.
Thanks a lot for this fix. Unfortunately, this currently breaks one test which has a fixture that's based on the random seed used (which now changed). Could you please have a look into that?
of `get_one_exchange_neighborhood`. Update the hard-coded expected values.
I have updated the fixture to match the current behavior of the library. |
One-exchange neighborhood iterator rigorously checks some of the generated configurations. The check is performed with the probability 5 %, as decided by
np.random.Make the check deterministic (using an explicitly seeded
np.random.RandomState) instead of relying on the default numpy random state, which need not be seeded.Resolves #194.