Commit daff56a9 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

fix

parent 4c4fcf5d
......@@ -77,13 +77,6 @@ objects, generate new ones via :func:`spawn_sseq()`.
import numpy as np
# Stack of SeedSequence objects. Will always start out with a well-defined
# default. Users can change the "random seed" used by a calculation by pushing
# a different SeedSequence before invoking any other nifty6.random calls
_sseq = [np.random.SeedSequence(42)]
# Stack of random number generators associated with _sseq.
_rng = [np.random.default_rng(_sseq[-1])]
# fix for numpy issue #16539
def _fix_seed(seed):
......@@ -92,6 +85,14 @@ def _fix_seed(seed):
raise TypeError("random seed shold have integer type")
# Stack of SeedSequence objects. Will always start out with a well-defined
# default. Users can change the "random seed" used by a calculation by pushing
# a different SeedSequence before invoking any other nifty6.random calls
_sseq = [np.random.SeedSequence(_fix_seed(42))]
# Stack of random number generators associated with _sseq.
_rng = [np.random.default_rng(_sseq[-1])]
def getState():
"""Returns the full internal state of the module. Intended for pickling.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment