skrf.mathFunctions.set_rand_rngο
- skrf.mathFunctions.set_rand_rng(rng)[source]ο
Set the global
numpyrandom number generator instance for generating random numbers in scikit-rf. This is useful for fixing a random seed for reproducible Monte Carlo analysis.This function is expected to be called before using any scikit-rf features, since itβs a global variable and thread-unsafe. To temporarily change the random number generator of a particular method (e.g.
skrf.media.Media.random()), use therngargument instead.- Parameters:
rng (
numpy.random.Generator) β Any random number generator accepted bynumpy.- Return type:
None
Examples
>>> set_rand_rng(np.random.default_rng(seed=42))