本文整理汇总了Python中bamboo.models.calculation.Calculation.find方法的典型用法代码示例。如果您正苦于以下问题:Python Calculation.find方法的具体用法?Python Calculation.find怎么用?Python Calculation.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bamboo.models.calculation.Calculation
的用法示例。
在下文中一共展示了Calculation.find方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: calculations
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def calculations(self, include_aggs=True, only_aggs=False):
"""Return the calculations for this dataset.
:param include_aggs: Include aggregations, default True.
:param only_aggs: Exclude non-aggregations, default False.
"""
return Calculation.find(self, include_aggs, only_aggs)
示例2: test_save
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def test_save(self):
record = self._save_observations_and_calculation()
self.assertTrue(isinstance(record, dict))
self.assertTrue(Calculation.FORMULA in record.keys())
self.assertTrue(Calculation.STATE in record.keys())
record = Calculation.find(self.dataset)[0].record
self.assertEqual(record[Calculation.STATE], Calculation.STATE_READY)
self.assertTrue(Calculation(record).is_ready)
示例3: test_save_set_aggregation_id
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def test_save_set_aggregation_id(self):
record = self._save_observations_and_calculation('max(amount)')
agg_id = self.dataset.aggregated_datasets_dict['']
calculation = Calculation.find(self.dataset)[0]
self.assertEqual(agg_id, calculation.aggregation_id)
示例4: test_save_set_aggregation
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def test_save_set_aggregation(self):
record = self._save_observations_and_calculation('max(amount)')
calculation = Calculation.find(self.dataset)[0]
self.assertEqual('max', calculation.aggregation)
示例5: test_find
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def test_find(self):
record = self._save_observations_and_calculation()
rows = Calculation.find(self.dataset)
new_record = rows[0].record
status = new_record.pop(Calculation.STATE)
self.assertEqual(status, Calculation.STATE_READY)
示例6: action
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def action(dataset):
result = Calculation.find(dataset)
return [x.clean_record for x in result]
示例7: calculations
# 需要导入模块: from bamboo.models.calculation import Calculation [as 别名]
# 或者: from bamboo.models.calculation.Calculation import find [as 别名]
def calculations(self):
"""Return the calculations for this dataset."""
return Calculation.find(self)