bilby.core.utils.random.resolve_random_state
- bilby.core.utils.random.resolve_random_state(random_state)[source]
Resolve the provided random state into a random number generator.
- Parameters:
- random_state: None, int, np.random.Generator, or jax.random.KeyArray
The random state to resolve. If None, the default random generator will be used. If an int, a new
numpy.random.default_rngobject will be created with that seed. If anumpy.random.Generator, it will be returned as is. If ajax.random.KeyArray, a correspondingorng.RandomGeneratorgenerator will be created and returned.
- Returns:
- np.random.Generator or orng.RandomGenerator
The resolved random number generator.