bilby.core.utils.random.Generator

class bilby.core.utils.random.Generator[source]

Bases: object

Class to hold the random number generator.

This class is used to ensure that the same random number generator is used throughout bilby.

It should not be used directly, instead use random.rng to generate random numbers. See the documentation for more details.

__init__(*args, **kwargs)
__call__(*args, **kwargs)

Call self as a function.

Methods

__init__(*args, **kwargs)

Attributes

rng

Random number generator.

rng = Generator(PCG64) at 0x7F2145D458C0

Random number generator.

This is a numpy.random.Generator object that is used to generate random numbers. By default, it is not seeded.

The recommended way to use this is to import the random module and use the rng attribute to generate random numbers. See the documentation for more details.