Randomness and Reproducibility
pypuf strives to make all results fully reproducible.
One key ingredient to this is to only use seeded random number generators. To avoid re-using seeds where different random generators are expected, pypuf implements a convenience function to obtain random generators based on a string description.
- pypuf.random.prng(description: str) Generator
Returns an instance of
numpy.random.Generatorseeded based on a text description.>>> from pypuf.random import prng >>> seed = 5 >>> my_prng = prng(f'my favorite random numbers, seed {seed}') >>> my_prng.integers(2, 6, 3) array([4, 3, 2])