本文整理匯總了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)