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


Python util.generic_sesh函数代码示例

本文整理汇总了Python中pycds.util.generic_sesh函数的典型用法代码示例。如果您正苦于以下问题:Python generic_sesh函数的具体用法?Python generic_sesh怎么用?Python generic_sesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: obs_sesh

 def obs_sesh(request, variable_sesh, history_stn1_hourly, history_stn2_hourly,
              var_temp_point, var_temp_point2,
              var_precip_net1_1, var_precip_net2_1):
     if request.param in [MonthlyAverageOfDailyMaxTemperature, MonthlyAverageOfDailyMinTemperature]:
         observations = [
             Obs(variable=var, history=hx,
                 time=datetime.datetime(2000, month, day, hour), datum=float(hour))
             for (var, hx) in [(var_temp_point, history_stn1_hourly),
                               (var_temp_point2, history_stn2_hourly)]
             for month in months
             for day in days
             for hour in hours
         ]
     else:
         observations = [
             Obs(variable=var, history=hx,
                 time=datetime.datetime(2000, month, day, hour), datum=1.0)
             for (var, hx) in [(var_precip_net1_1, history_stn1_hourly),
                               (var_precip_net2_1, history_stn2_hourly)]
             for month in months
             for day in days
             for hour in hours
         ]
     for sesh in generic_sesh(variable_sesh , observations):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:25,代码来源:test_wa_monthly_views_common.py

示例2: obs_sesh

 def obs_sesh(variable_sesh, var_temp_point, history_stn1_daily):
     observations = [
         Obs(id=i + 100, variable=var_temp_point, history=history_stn1_daily,
               time=datetime.datetime(2000, 1, i+10, 12), datum=float(i+10))
          for i in range(0,n_days)
         ]
     for sesh in generic_sesh(variable_sesh, observations):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:8,代码来源:test_daily_temperature_extrema.py

示例3: view_test_session

def view_test_session(mod_empty_view_session):
    for sesh in generic_sesh(mod_empty_view_session, [
        Description(id=1, desc='alpha'),
        Description(id=2, desc='beta'),
        Description(id=3, desc='gamma'),
        Thing(id=1, name='one', description_id=1),
        Thing(id=2, name='two', description_id=2),
        Thing(id=3, name='three', description_id=3),
        Thing(id=4, name='four', description_id=2),
        Thing(id=5, name='five', description_id=1),
    ]):
        yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:12,代码来源:test_view_helpers.py

示例4: sesh_with_climate_baseline_values

 def sesh_with_climate_baseline_values(sesh_with_station_and_history_records, histories):
     sesh = sesh_with_station_and_history_records
     variables = sesh.query(Variable)\
         .filter(Variable.network.has(name=pcic_climate_variable_network_name)) \
         .all()
     stations = sesh.query(Station).all()
     histories = [sesh.query(History)
                      .filter(History.station == station)
                      .order_by(History.sdate.desc())
                      .first()
                  for station in stations]
     derived_values = [
         DerivedValue(
             time=datetime.datetime(2000, month, monthrange(2000, month)[1], 23),
             datum=float(month),
             variable=variable,
             history=histories[h]
         )
         for variable in variables
         for h in range(2)
         for month in range(1, 13, h+1)  # a bit tricky: for history[1], leave out every other month
     ]
     for s in generic_sesh(sesh, derived_values):
         yield s
开发者ID:pacificclimate,项目名称:pycds,代码行数:24,代码来源:test_climate_baseline_helpers.py

示例5: flag_sesh

 def flag_sesh(obs_sesh, native_flag_discard, native_flag_non_discard,
               pcic_flag_discard, pcic_flag_non_discard):
     for sesh in generic_sesh(obs_sesh, [native_flag_discard, native_flag_non_discard,
                                         pcic_flag_discard, pcic_flag_non_discard]):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:5,代码来源:test_daily_temperature_extrema.py

示例6: sesh_with_station_and_history_records

def sesh_with_station_and_history_records(sesh_with_climate_baseline_variables, stations, histories):
    for sesh in generic_sesh(sesh_with_climate_baseline_variables, stations + histories):
        yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_climate_baseline_helpers.py

示例7: variable_sesh

 def variable_sesh(history_sesh, var_temp_point):
     for sesh in generic_sesh(history_sesh , [var_temp_point]):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_wa_monthly_views_common.py

示例8: sesh_with_other_network_and_climatology_variables

def sesh_with_other_network_and_climatology_variables(session, other_network, other_climatology_variables):
    for sesh in generic_sesh(session, [other_network] + other_climatology_variables):
        yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_climate_baseline_helpers.py

示例9: history_sesh

 def history_sesh(station_sesh, history_stn1_hourly):
     for sesh in generic_sesh(station_sesh , [history_stn1_hourly]):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_wa_monthly_views_common.py

示例10: station_sesh

 def station_sesh(network_sesh, station1):
     for sesh in generic_sesh(network_sesh , [station1]):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_wa_monthly_views_common.py

示例11: network_sesh

 def network_sesh(with_views_sesh, network1):
     for sesh in generic_sesh(with_views_sesh , [network1]):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_wa_monthly_views_common.py

示例12: variable_sesh

 def variable_sesh(history_sesh, var_temp_max, var_temp_min):
     for sesh in generic_sesh(history_sesh, [var_temp_max, var_temp_min]):
         yield sesh
开发者ID:pacificclimate,项目名称:pycds,代码行数:3,代码来源:test_daily_temperature_extrema.py


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