本文整理汇总了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)
示例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)
示例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)
示例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)