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

Clean up rng #285

Merged
merged 15 commits into from
Jan 31, 2024
Merged

Clean up rng #285

merged 15 commits into from
Jan 31, 2024

Conversation

bernstei
Copy link
Contributor

@bernstei bernstei commented Jan 28, 2024

Replace all calls to np.random.<some sampling function> with passing an explicit np.random.Generator, so the user can keep better track of the random number state to make scripts reproducible. In particular, the random numbers for each op are generated from a generator that's spawned from the main one, so it's easy for things to be the same whether an op is actually done or skipped because the output file is already present.

Changes to pretty much every function that uses random numbers, because they all require a generator as a function argument. Since it's bad practice for reproducible scripts, wfl will not make it easy by defaulting to a random unknown rng state.

At least one test of this reproducibility, but maybe not comprehensive enough.

closes #284
closes #286

@bernstei bernstei merged commit 1193a85 into main Jan 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant