In quite a few places in the main (non-test) code, random variates are sampled using functions in the top-level numpy.random namespace which map to the methods of a (globally shared) RandomState instance. From a reproducibility / ease of debugging perspective it would be better to instead allow explicitly passing an instance of the numpy.random.Generator class (introduced in Numpy v1.17) or the legacy numpy.random.RandomState class to functions which use (pseudo) random variates - see for example this blog post for a nice write up of why this is recommended. The current interface could be maintained by making this an optional keyword argument that defaults to a global Generator / RandomState instance if not specified, while allowing the user to explicitly control the random number generator if desired. This would also facilitate ensuring the tests are deterministic as discussed in #135.
Just to be clear as this would be quite a substantial change, I'm suggesting this more as a feature request / nice to have in future rather than as a blocker to acceptance for the JOSS review!
In quite a few places in the main (non-test) code, random variates are sampled using functions in the top-level
numpy.random
namespace which map to the methods of a (globally shared)RandomState
instance. From a reproducibility / ease of debugging perspective it would be better to instead allow explicitly passing an instance of thenumpy.random.Generator
class (introduced in Numpy v1.17) or the legacynumpy.random.RandomState
class to functions which use (pseudo) random variates - see for example this blog post for a nice write up of why this is recommended. The current interface could be maintained by making this an optional keyword argument that defaults to a globalGenerator
/RandomState
instance if not specified, while allowing the user to explicitly control the random number generator if desired. This would also facilitate ensuring the tests are deterministic as discussed in #135.Just to be clear as this would be quite a substantial change, I'm suggesting this more as a feature request / nice to have in future rather than as a blocker to acceptance for the JOSS review!