当前位置: 首页>>代码示例>>Python>>正文


Python AssetFinder.retrieve_all方法代码示例

本文整理汇总了Python中zipline.assets.AssetFinder.retrieve_all方法的典型用法代码示例。如果您正苦于以下问题:Python AssetFinder.retrieve_all方法的具体用法?Python AssetFinder.retrieve_all怎么用?Python AssetFinder.retrieve_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在zipline.assets.AssetFinder的用法示例。


在下文中一共展示了AssetFinder.retrieve_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: engine_from_files

# 需要导入模块: from zipline.assets import AssetFinder [as 别名]
# 或者: from zipline.assets.AssetFinder import retrieve_all [as 别名]
def engine_from_files(daily_bar_path,
                      adjustments_path,
                      asset_db_path,
                      calendar,
                      warmup_assets=False):
    """
    Construct a SimplePipelineEngine from local filesystem resources.

    Parameters
    ----------
    daily_bar_path : str
        Path to pass to `BcolzDailyBarReader`.
    adjustments_path : str
        Path to pass to SQLiteAdjustmentReader.
    asset_db_path : str
        Path to pass to `AssetFinder`.
    calendar : pd.DatetimeIndex
        Calendar to use for the loader.
    warmup_assets : bool, optional
        Whether or not to populate AssetFinder caches.  This can speed up
        initial latency on subsequent pipeline runs, at the cost of extra
        memory consumption.  Default is False
    """
    loader = USEquityPricingLoader.from_files(daily_bar_path, adjustments_path)
    asset_finder = AssetFinder(asset_db_path)
    if warmup_assets:
        results = asset_finder.retrieve_all(asset_finder.sids)
        print("Warmed up %d assets." % len(results))

    return SimplePipelineEngine(
        lambda _: loader,
        calendar,
        asset_finder,
    )
开发者ID:AtwooTM,项目名称:zipline,代码行数:36,代码来源:__init__.py


注:本文中的zipline.assets.AssetFinder.retrieve_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。