![]() |
Belle II Software development
|
Public Member Functions | |
__init__ (self, generator_function, *args, **kwargs) | |
generator (self) | |
Public Attributes | |
generator_function = generator_function | |
Generator function that has not been 'primed'. | |
args = args | |
Positional argument tuple used to 'prime' the ArgumentsGenerator.generator_function . | |
kwargs = kwargs | |
Keyword argument dictionary used to 'prime' the ArgumentsGenerator.generator_function . | |
Simple little class to hold a generator (uninitialised) and the necessary args/kwargs to initialise it. This lets us reuse a generator by setting it up again fresh. This is not optimal for expensive calculations, but it is nice for making large sequences of Job input arguments on the fly.
Definition at line 87 of file backends.py.
__init__ | ( | self, | |
generator_function, | |||
* | args, | ||
** | kwargs ) |
Parameters: generator_function (py:function): A function (callable) that contains a ``yield`` statement. This generator should *not* be initialised i.e. you haven't called it with ``generator_function(*args, **kwargs)`` yet. That will happen when accessing the `ArgumentsGenerator.generator` property. args (tuple): The positional arguments you want to send into the initialisation of the generator. kwargs (dict): The keyword arguments you want to send into the initialisation of the generator.
Definition at line 94 of file backends.py.
generator | ( | self | ) |
Returns: generator: The initialised generator (using the args and kwargs for initialisation). It should be ready to have ``next``/``send`` called on it.
Definition at line 111 of file backends.py.
args = args |
Positional argument tuple used to 'prime' the ArgumentsGenerator.generator_function
.
Definition at line 106 of file backends.py.
generator_function = generator_function |
Generator function that has not been 'primed'.
Definition at line 104 of file backends.py.
kwargs = kwargs |
Keyword argument dictionary used to 'prime' the ArgumentsGenerator.generator_function
.
Definition at line 108 of file backends.py.