bilby.core.utils.io.encode_numpy_random_generator

bilby.core.utils.io.encode_numpy_random_generator(generator)[source]

Encode a numpy random generator to a dictionary.

Adds the key __numpy_random_generator__ to the dictionary to indicate that the object is a numpy random generator.

The bit_generator_state key contains the state of the bit generator including its name.

Added in version 2.5.0.