mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-23 12:22:37 +00:00
Running black
This commit is contained in:
committed by
Massimo Fabbro
parent
c6093430c2
commit
8a4739f9c9
@@ -103,9 +103,9 @@ def sum_child_root_elements(root_element: ifcopenshell.entity_instance, category
|
|||||||
for rel in root_element.IsNestedBy:
|
for rel in root_element.IsNestedBy:
|
||||||
for child_root_element in rel.RelatedObjects:
|
for child_root_element in rel.RelatedObjects:
|
||||||
if get_assigned_rate_cost_item(child_root_element):
|
if get_assigned_rate_cost_item(child_root_element):
|
||||||
new_child_root_element=get_assigned_rate_cost_item(child_root_element)
|
new_child_root_element = get_assigned_rate_cost_item(child_root_element)
|
||||||
else:
|
else:
|
||||||
new_child_root_element=child_root_element
|
new_child_root_element = child_root_element
|
||||||
if root_element.is_a("IfcCostItem"):
|
if root_element.is_a("IfcCostItem"):
|
||||||
values = new_child_root_element.CostValues
|
values = new_child_root_element.CostValues
|
||||||
elif root_element.is_a("IfcConstructionResource"):
|
elif root_element.is_a("IfcConstructionResource"):
|
||||||
@@ -130,11 +130,12 @@ def serialise_cost_value(cost_value: ifcopenshell.entity_instance) -> str:
|
|||||||
return result[1:-1]
|
return result[1:-1]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
def get_assigned_rate_cost_item(cost_item: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance:
|
def get_assigned_rate_cost_item(cost_item: ifcopenshell.entity_instance) -> ifcopenshell.entity_instance:
|
||||||
#same as in tool. Maybe just create one?
|
# same as in tool. Maybe just create one?
|
||||||
for assignment in cost_item.HasAssignments:
|
for assignment in cost_item.HasAssignments:
|
||||||
if assignment.RelatingControl.is_a() == "IfcCostItem":
|
if assignment.RelatingControl.is_a() == "IfcCostItem":
|
||||||
return assignment.RelatingControl
|
return assignment.RelatingControl
|
||||||
|
|
||||||
|
|
||||||
def _serialise_cost_value(cost_value: ifcopenshell.entity_instance) -> str:
|
def _serialise_cost_value(cost_value: ifcopenshell.entity_instance) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user