Closed PFMassiani closed 1 year ago
Excellent suggestion. I'll implement this in the next couple of weeks as time permits.
Adding a generator
keyword argument in all relevant sdeint functions.
If omitted generator=None
, it can just default to instantiate its own np.random.default_rng()
.
I'll assume no need for bitwise backwards compatibility with the old behavior.
Hello,
This is a follow up on #14 given numpy's latest recommendation regarding random number generation, which can be found here.
In short, using
np.random.XXX
is now legacy, and the recommended usage is:And instead of setting the global seed, one should pass the
Generator
instance to the place where it is needed. AFAIK,sdeint
does not allow passing aGenerator
instance.It would be nice to incorporate this feature for compatibility with newer code, e.g., with
sdeint
using a globalGenerator
instance that could be set by the user.Thanks