hypothesize icon indicating copy to clipboard operation
hypothesize copied to clipboard

Use NumPy generators instead of global state

Open tupui opened this issue 2 years ago • 0 comments

Hi, great library 👏

I have a suggestion for the seeding part. In NEP19, we recommend now to move away from the global state np.random.seed. Instead, the canonical way of using RNG is to use a generator with: rng = np.random.default_rng(seed_value). (Would be ok since you require a recent version of NumPy.)

This is especially important since in SciPy for e.g. we are not relying anymore on the global state but ask people to use the parameter random_state (sometimes called seed or rng depending on the function, sorry about the inconsistency, we are trying to resolve that slowly...).

tupui avatar Mar 01 '23 14:03 tupui