MCPcopy Create free account
hub / github.com/numpy/numpy / __bit_generator_ctor

Function __bit_generator_ctor

numpy/random/_pickle.py:17–37  ·  view source on GitHub ↗

Pickling helper function that returns a bit generator object Parameters ---------- bit_generator_name : str String containing the name of the BitGenerator Returns ------- bit_generator : BitGenerator BitGenerator instance

(bit_generator_name='MT19937')

Source from the content-addressed store, hash-verified

15
16
17def __bit_generator_ctor(bit_generator_name='MT19937'):
18 """
19 Pickling helper function that returns a bit generator object
20
21 Parameters
22 ----------
23 bit_generator_name : str
24 String containing the name of the BitGenerator
25
26 Returns
27 -------
28 bit_generator : BitGenerator
29 BitGenerator instance
30 """
31 if bit_generator_name in BitGenerators:
32 bit_generator = BitGenerators[bit_generator_name]
33 else:
34 raise ValueError(str(bit_generator_name) + ' is not a known '
35 'BitGenerator module.')
36
37 return bit_generator()
38
39
40def __generator_ctor(bit_generator_name="MT19937",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected