Skip to content

generators.utils.factory

Data - Generators - Factory¤

Factory ¤

An experimental factor that generates a history based on a stepper and the given length.

Source code in eerily/generators/utils/factory.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
class Factory:
    """
    An experimental factor that generates a history
    based on a stepper and the given length.
    """

    def __init__(self, format: Optional[Literal["list", "dataframe"]] = None):
        self.format = format

    def __call__(self, stepper: Iterator, length: int):
        i = 0
        while i < length:
            yield next(stepper)
            i += 1