From af4475fe4639380cb6764909167afab6b082235f Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sun, 1 Sep 2024 13:26:58 +1000 Subject: [PATCH] Run black --- .../ifcopenshell/util/cost.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/cost.py b/src/ifcopenshell-python/ifcopenshell/util/cost.py index bb3df756bb..1844c76eb0 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/cost.py +++ b/src/ifcopenshell-python/ifcopenshell/util/cost.py @@ -245,21 +245,27 @@ def get_cost_item_assignments( for product in get_cost_assignments_by_type(nested_cost_item, filter_by_type) ] + def get_cost_values(cost_item: ifcopenshell.entity_instance) -> list[dict[str, str]]: results = [] for cost_value in cost_item.CostValues or []: label = "{0:.2f}".format(calculate_applied_value(cost_item, cost_value)) label += " = {}".format(serialise_cost_value(cost_value)) - results.append({ - "id": cost_value.id(), - "label": label, - "name": cost_value.Name, - "category": cost_value.Category, - "applied_value": get_primitive_applied_value(cost_value.AppliedValue) if cost_value.AppliedValue else None, - }) + results.append( + { + "id": cost_value.id(), + "label": label, + "name": cost_value.Name, + "category": cost_value.Category, + "applied_value": ( + get_primitive_applied_value(cost_value.AppliedValue) if cost_value.AppliedValue else None + ), + } + ) print(results) return results + class CostValueUnserialiser: def parse(self, formula: str): l = lark.Lark(