rng#
- dageo.utils.rng(random=None)[source]#
Module-wide Random Number Generator.
Instantiate a random number generator.
- Parameters:
- random{None, int, np.random.Generator}, default: None
If
None
it returns anumpy.random.default_rng
instance instantiated on a module level.If
int
, it returns a newly creatednumpy.random.default_rng
instance, instantiated withint
as seed.If it is already a
numpy.random.Generator
instance, it simply returns it.
- Returns:
- rngrandom number generator
A
numpy.random.Generator
instance.