Alcampopiano / hypothesize

Robust statistics in Python
https://alcampopiano.github.io/hypothesize/
BSD 3-Clause "New" or "Revised" License
62 stars 3 forks source link

Use NumPy generators instead of global state #14

Open tupui opened 1 year ago

tupui commented 1 year ago

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