algorithm.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:zipline-chinese 作者: zhanghan1990 项目源码 文件源码
def attach_pipeline(self, pipeline, name, chunksize=None):
        """
        Register a pipeline to be computed at the start of each day.
        """
        if self._pipelines:
            raise NotImplementedError("Multiple pipelines are not supported.")
        if chunksize is None:
            # Make the first chunk smaller to get more immediate results:
            # (one week, then every half year)
            chunks = iter(chain([5], repeat(126)))
        else:
            chunks = iter(repeat(int(chunksize)))
        self._pipelines[name] = pipeline, chunks

        # Return the pipeline to allow expressions like
        # p = attach_pipeline(Pipeline(), 'name')
        return pipeline
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号