-
Notifications
You must be signed in to change notification settings - Fork 14
Use rng everywhere #40
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
Conversation
Remark to myself: we drop assertions for now because it seems that it is hard/impossible to create identical random numbers accross machines/versions for numpy. See: numpy/numpy#22975 |
@@ -216,13 +220,15 @@ def sample_covariance_matrix(Sigma, N, seed = None): | |||
return: sample covariance matrix S | |||
""" | |||
if seed is not None: | |||
np.random.seed(seed) | |||
|
|||
rng = np.random.default_rng(seed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do this unconditionally. default_rng(None)
will pull random entropy from the OS and will be vastly more likely to give you a distinct PRNG than np.random.randint(low=11111, high=99999)
will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thanks for the hint! Will adjust this
No description provided.