rng

Functions for standardized number generation.

Module Contents

Functions

seed_from_time(→ int)

Create a seed from the current time in microseconds.

seed_from_string(→ int)

Convert a string seed to an integer seed.

make_rng(→ numpy.random.Generator)

Create a numpy random number generator from a seed.

make_rng_time_seed(→ numpy.random.Generator)

Create a numpy random number generator from a seed.

seed_from_time(log_seed: bool = True) int

Create a seed from the current time in microseconds.

Parameters:

log_seed – If the seed should be logged. It probably should.

Returns:

The created seed.

seed_from_string(text: str) int

Convert a string seed to an integer seed.

Parameters:

text – The seed as string.

Returns:

The seed as integer.

make_rng(seed: int) numpy.random.Generator

Create a numpy random number generator from a seed.

Parameters:

seed – The seed to use.

Returns:

The random number generator.

make_rng_time_seed(log_seed: bool = True) numpy.random.Generator

Create a numpy random number generator from a seed.

Parameters:

log_seed – If the automatically created seed should be logged. It probably should.

Returns:

The random number generator.