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


Python Aggregator.lazy_aggregate方法代码示例

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


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

示例1: test_kwarg_pass_through_no_kwargs

# 需要导入模块: from iris.analysis import Aggregator [as 别名]
# 或者: from iris.analysis.Aggregator import lazy_aggregate [as 别名]
 def test_kwarg_pass_through_no_kwargs(self):
     lazy_func = Mock()
     data = sentinel.data
     axis = sentinel.axis
     aggregator = Aggregator('', None, lazy_func=lazy_func)
     aggregator.lazy_aggregate(data, axis)
     lazy_func.assert_called_once_with(data, axis)
开发者ID:Jozhogg,项目名称:iris,代码行数:9,代码来源:test_Aggregator.py

示例2: test_kwarg_pass_through_init_kwargs

# 需要导入模块: from iris.analysis import Aggregator [as 别名]
# 或者: from iris.analysis.Aggregator import lazy_aggregate [as 别名]
 def test_kwarg_pass_through_init_kwargs(self):
     lazy_func = Mock()
     data = sentinel.data
     axis = sentinel.axis
     kwargs = dict(wibble='wobble', foo='bar')
     aggregator = Aggregator('', None, lazy_func=lazy_func, **kwargs)
     aggregator.lazy_aggregate(data, axis)
     lazy_func.assert_called_once_with(data, axis, **kwargs)
开发者ID:Jozhogg,项目名称:iris,代码行数:10,代码来源:test_Aggregator.py

示例3: test_kwarg_pass_through_combined_kwargs

# 需要导入模块: from iris.analysis import Aggregator [as 别名]
# 或者: from iris.analysis.Aggregator import lazy_aggregate [as 别名]
 def test_kwarg_pass_through_combined_kwargs(self):
     lazy_func = Mock()
     data = sentinel.data
     axis = sentinel.axis
     init_kwargs = dict(wibble='wobble', var=1.0)
     call_kwargs = dict(foo='foo', var=0.5)
     aggregator = Aggregator('', None, lazy_func=lazy_func, **init_kwargs)
     aggregator.lazy_aggregate(data, axis, **call_kwargs)
     expected_kwargs = init_kwargs.copy()
     expected_kwargs.update(call_kwargs)
     lazy_func.assert_called_once_with(data, axis, **expected_kwargs)
开发者ID:Jozhogg,项目名称:iris,代码行数:13,代码来源:test_Aggregator.py

示例4: test_no_lazy_func

# 需要导入模块: from iris.analysis import Aggregator [as 别名]
# 或者: from iris.analysis.Aggregator import lazy_aggregate [as 别名]
 def test_no_lazy_func(self):
     dummy_agg = Aggregator('custom_op', lambda x: 1)
     expected = 'custom_op aggregator does not support lazy operation'
     with self.assertRaisesRegexp(LazyAggregatorError, expected):
         dummy_agg.lazy_aggregate(np.arange(10), axis=0)
开发者ID:Jozhogg,项目名称:iris,代码行数:7,代码来源:test_Aggregator.py


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