For-a-few-DPPs-more / structure-factor

Compute structure factor of stationary and isotropic point processes
https://for-a-few-dpps-more.github.io/structure-factor/
MIT License
10 stars 5 forks source link

Pass a random_state argument for reproducibility when using random variables #3

Closed guilgautier closed 2 years ago

guilgautier commented 3 years ago

It would be great to be able to pass a random_state or seed or rng argument for reproducibility when calling function involving random variables. See also the check_random_state function in sklearn https://github.com/scikit-learn/scikit-learn/blob/a45c0c99a38cffca6724cb8fd38b12edd4fb6b35/sklearn/utils/validation.py#L926

guilgautier commented 2 years ago

Numpy now makes use of [Generators](https://numpy.org/doc/stable/reference/random/generator.html)

The Generator provides access to a wide range of distributions, and served as a replacement for RandomState.

In the end, we use get_random_number_generator(seed) = np.random.default_rng(seed)