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

Function __generator_ctor

numpy/random/_pickle.py:40–58  ·  view source on GitHub ↗

Pickling helper function that returns a Generator object Parameters ---------- bit_generator_name : str String containing the core BitGenerator's name bit_generator_ctor : callable, optional Callable function that takes bit_generator_name as its only argument

(bit_generator_name="MT19937",
                     bit_generator_ctor=__bit_generator_ctor)

Source from the content-addressed store, hash-verified

38
39
40def __generator_ctor(bit_generator_name="MT19937",
41 bit_generator_ctor=__bit_generator_ctor):
42 """
43 Pickling helper function that returns a Generator object
44
45 Parameters
46 ----------
47 bit_generator_name : str
48 String containing the core BitGenerator's name
49 bit_generator_ctor : callable, optional
50 Callable function that takes bit_generator_name as its only argument
51 and returns an instantized bit generator.
52
53 Returns
54 -------
55 rg : Generator
56 Generator using the named core BitGenerator
57 """
58 return Generator(bit_generator_ctor(bit_generator_name))
59
60
61def __randomstate_ctor(bit_generator_name="MT19937",

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected