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


Python Timeseries.time_step方法代码示例

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


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

示例1: MultiTimeseriesProcessDb

# 需要导入模块: from pthelma.timeseries import Timeseries [as 别名]
# 或者: from pthelma.timeseries.Timeseries import time_step [as 别名]
def MultiTimeseriesProcessDb(method, timeseries_arg, out_timeseries_id,
                             db, read_tstep_func, transaction=None, 
                             commit=True, options={}):
    out_timeseries = Timeseries(id = out_timeseries_id)
    opts = copy.deepcopy(options)
    if 'append_only' in opts and opts['append_only']:
        bounds = timeseries_bounding_dates_from_db(db, 
                                                   id = out_timeseries_id)
        opts['start_date'] = bounds[1] if bounds else None;
        opts['interval_exclusive'] = True
    tseries_arg={}
    for key in timeseries_arg:
        ts = Timeseries(id=timeseries_arg[key])
        if ('append_only' in opts and opts['append_only']) \
                         and opts['start_date'] is not None:
            ts.read_from_db(db, bottom_only=True)
            if ts.bounding_dates()[0]>opts['start_date']:
                ts.read_from_db(db)
        else:
            ts.read_from_db(db)
        ts.time_step = read_tstep_func(ts.id)
        tseries_arg[key] = ts
    MultiTimeseriesProcess(method, tseries_arg, out_timeseries, opts)
    if 'append_only' in opts and opts['append_only']:
        out_timeseries.append_to_db(db=db, transaction=transaction,
                                    commit=commit)
    else:
        out_timeseries.write_to_db(db=db, transaction=transaction, 
                                   commit=commit)
开发者ID:aptiko,项目名称:pthelma,代码行数:31,代码来源:tsprocess.py


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