Skip to content
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

Check new neighbors deterministically #195

Merged
merged 2 commits into from
Sep 16, 2021
Merged

Conversation

filipbartek
Copy link
Contributor

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.

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

codecov bot commented Sep 16, 2021

Codecov Report

Merging #195 (51c2fba) into master (9fd85c4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fd85c4...51c2fba. Read the comment docs.

Copy link
Contributor

@mfeurer mfeurer left a comment

Choose a reason for hiding this comment

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

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.
@filipbartek
Copy link
Contributor Author

filipbartek commented Sep 16, 2021

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?

I have updated the fixture to match the current behavior of the library.

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

Successfully merging this pull request may close these issues.

One-exchange neighborhood may raise ValueError non-deterministically
2 participants