本文整理匯總了Python中bamboo.models.calculation.Calculation.save方法的典型用法代碼示例。如果您正苦於以下問題:Python Calculation.save方法的具體用法?Python Calculation.save怎麽用?Python Calculation.save使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bamboo.models.calculation.Calculation
的用法示例。
在下文中一共展示了Calculation.save方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _test_calculator
# 需要導入模塊: from bamboo.models.calculation import Calculation [as 別名]
# 或者: from bamboo.models.calculation.Calculation import save [as 別名]
def _test_calculator(self):
self.dframe = self.dataset.dframe()
columns = self.dframe.columns.tolist()
self.start_num_cols = len(columns)
self.added_num_cols = 0
column_labels_to_slugs = {
column_attrs[Dataset.LABEL]: (column_name) for
(column_name, column_attrs) in self.dataset.schema.items()
}
self.label_list, self.slugified_key_list = [
list(ary) for ary in zip(*column_labels_to_slugs.items())
]
for idx, formula in enumerate(self.calculations):
name = 'test-%s' % idx
self.parser.validate_formula(formula)
calculator = Calculator(self.dataset)
calculation = Calculation()
calculation.save(self.dataset, formula, name, self.group)
calculator.calculate_columns([calculation])
self.column_labels_to_slugs = self.dataset.schema.labels_to_slugs
self._test_calculation_results(name, formula)