From d74a0d05fdd4dc0c24d48bdd0c0176a8b6801665 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 11 Nov 2024 18:21:00 +0500 Subject: [PATCH] calculate_cost_item_resource_value - fix bug when 0 resource cost value would be misinterpreted as parent's cost value --- .../ifcopenshell/api/cost/calculate_cost_item_resource_value.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py b/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py index 1d95942c0e..edac53057a 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py +++ b/src/ifcopenshell-python/ifcopenshell/api/cost/calculate_cost_item_resource_value.py @@ -101,7 +101,7 @@ def calculate_cost_item_resource_value(file: ifcopenshell.file, cost_item: ifcop for resource in resources: cost, unit = ifcopenshell.util.resource.get_cost(resource) - if not cost: + if cost is None: # Concept to standardise - Not defined in schema, but this makes manual scheduling of resources 10x faster and less duplicate data. parent_cost = ifcopenshell.util.resource.get_parent_cost(resource) assert parent_cost