Open Helveg opened 2 years ago
Sooner or later I'll have to submit to the numbercrunchers and accomodate finer control over the used RNG.
Simple implementation: Add a new root config dict rng to the config tree that can contain dynamic RNG definitions:
rng
type
numpy
Then the dynamic numpy RNG contains 2 attributes:
generator
default_rng
BitGenerator
seed
None
We add a function get_rng to the Scaffold class, which returns the singletons for each configured node, where:
get_rng
Scaffold
def get_rng(self, node="bsb"): if node == "bsb": return self.rng.get(node, RandomGeneratorNode()) else: return self.rng[node]
Related: #183 , #759
Example configuration:
rng: bsb: {} numpy: generator: Mersenne nest: master_seed: 1234
Sooner or later I'll have to submit to the numbercrunchers and accomodate finer control over the used RNG.
Simple implementation: Add a new root config dict
rng
to the config tree that can contain dynamic RNG definitions:type
: defaultnumpy
, but also plugins like the simulators could add extra RNG types to control RNG inside of the simulators.Then the dynamic
numpy
RNG contains 2 attributes:generator
: defaultdefault_rng
, otherwise the name of theBitGenerator
class.seed
: defaultNone
or a seed sequence.We add a function
get_rng
to theScaffold
class, which returns the singletons for each configured node, where: