mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 02:31:09 +00:00
Run black
This commit is contained in:
@@ -245,21 +245,27 @@ def get_cost_item_assignments(
|
|||||||
for product in get_cost_assignments_by_type(nested_cost_item, filter_by_type)
|
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]]:
|
def get_cost_values(cost_item: ifcopenshell.entity_instance) -> list[dict[str, str]]:
|
||||||
results = []
|
results = []
|
||||||
for cost_value in cost_item.CostValues or []:
|
for cost_value in cost_item.CostValues or []:
|
||||||
label = "{0:.2f}".format(calculate_applied_value(cost_item, cost_value))
|
label = "{0:.2f}".format(calculate_applied_value(cost_item, cost_value))
|
||||||
label += " = {}".format(serialise_cost_value(cost_value))
|
label += " = {}".format(serialise_cost_value(cost_value))
|
||||||
results.append({
|
results.append(
|
||||||
"id": cost_value.id(),
|
{
|
||||||
"label": label,
|
"id": cost_value.id(),
|
||||||
"name": cost_value.Name,
|
"label": label,
|
||||||
"category": cost_value.Category,
|
"name": cost_value.Name,
|
||||||
"applied_value": get_primitive_applied_value(cost_value.AppliedValue) if cost_value.AppliedValue else None,
|
"category": cost_value.Category,
|
||||||
})
|
"applied_value": (
|
||||||
|
get_primitive_applied_value(cost_value.AppliedValue) if cost_value.AppliedValue else None
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
print(results)
|
print(results)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
class CostValueUnserialiser:
|
class CostValueUnserialiser:
|
||||||
def parse(self, formula: str):
|
def parse(self, formula: str):
|
||||||
l = lark.Lark(
|
l = lark.Lark(
|
||||||
|
|||||||
Reference in New Issue
Block a user