Switch to new random interface of numpy
np.random.seed is legacy. The numpy docs say:
The best practice is to not reseed a BitGenerator, rather to recreate a new one. This method is here for legacy reasons. This example demonstrates best practice.
from numpy.random import MT19937 from numpy.random import RandomState, SeedSequence rs = RandomState(MT19937(SeedSequence(123456789))) # Later, you want to restart the stream rs = RandomState(MT19937(SeedSequence(987654321)))
We might want to migrate eventually.