'Register a pipeline to be computed at the start of each day.
Parameters
pipeline : Pipeline
The pipeline to have computed.
name : str
The name of the pipeline.
chunks : int or iterator, optional
The number of days to compute pipeline results for. Increasing
this number will make it longer to get the first results but
may improve the total runtime of the simulation. If an iterator
is passed, we will run in chunks based on values of the itereator.
Returns
pipeline : Pipeline
Returns the pipeline that was attached unchanged.
See Also
:func:`zipline.api.pipeline_output`'

@api_method
@require_not_initialized(AttachPipelineAfterInitialize())
@expect_types(pipeline=Pipeline, name=string_types, chunks=(int, Iterable, type(None)))
def attach_pipeline(self, pipeline, name, chunks=None):

    if self._pipelines:
        raise NotImplementedError('Multiple    pipelines    are    not    supported.')
    if (chunks is None):
        chunks = chain([5], repeat(126))
    elif isinstance(chunks, int):
        chunks = repeat(chunks)
    self._pipelines[name] = (pipeline, iter(chunks))
    return pipeline
