chore: remove print statements
This commit is contained in:
@@ -64,17 +64,10 @@ class RevitCarbonAnalyzer:
|
||||
"total_carbon": 0.0,
|
||||
}
|
||||
|
||||
# Debug: Print number of elements found
|
||||
element_count = 0
|
||||
# Process each element
|
||||
for element in self._iterate_elements(model_root):
|
||||
element_count += 1
|
||||
try:
|
||||
print(
|
||||
f"Processing element {getattr(element, 'id', 'unknown')}"
|
||||
) # Debug
|
||||
element_result = self._process_single_element(element)
|
||||
print(f"Result status: {element_result['status']}") # Debug
|
||||
if element_result["status"] == "processed":
|
||||
results["processed_elements"].append(element_result)
|
||||
results["total_carbon"] += element_result["total_carbon"]
|
||||
@@ -83,7 +76,6 @@ class RevitCarbonAnalyzer:
|
||||
else:
|
||||
results["errors"].append(element_result)
|
||||
except Exception as e:
|
||||
print(f"Error processing element: {str(e)}") # Debug
|
||||
results["errors"].append(
|
||||
{
|
||||
"id": getattr(element, "id", "unknown"),
|
||||
@@ -92,7 +84,6 @@ class RevitCarbonAnalyzer:
|
||||
}
|
||||
)
|
||||
|
||||
print(f"Total elements found: {element_count}") # Debug
|
||||
return results
|
||||
|
||||
def _process_single_element(self, element: Dict) -> Dict:
|
||||
|
||||
@@ -48,30 +48,20 @@ class ElementProcessor:
|
||||
|
||||
def _is_valid_element(self, element) -> bool:
|
||||
"""Validate if element should be processed."""
|
||||
element_id = getattr(element, "id", "unknown")
|
||||
|
||||
# Debug logs
|
||||
print(f"\nValidating element {element_id}")
|
||||
print(f"speckle_type: {getattr(element, 'speckle_type', None)}")
|
||||
print(f"has properties: {hasattr(element, 'properties')}")
|
||||
|
||||
# Skip geometry elements
|
||||
if getattr(element, "speckle_type", None) in self.SKIP_TYPES:
|
||||
print("Skipped: geometry element")
|
||||
return False
|
||||
|
||||
# Must have properties
|
||||
if not hasattr(element, "properties"):
|
||||
print("Skipped: no properties")
|
||||
return False
|
||||
|
||||
# Must have material quantities
|
||||
properties = getattr(element, "properties")
|
||||
if "Material Quantities" not in properties: # Changed from hasattr to dictionary access
|
||||
print("Skipped: no Material Quantities")
|
||||
if "Material Quantities" not in properties:
|
||||
return False
|
||||
|
||||
print(f"Material Quantities found: {properties['Material Quantities']}")
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
|
||||
@@ -14,9 +14,7 @@ class MaterialProcessor:
|
||||
properties = MaterialProperties(
|
||||
name=raw_material["materialName"],
|
||||
volume=raw_material["volume"]["value"],
|
||||
density=raw_material.get("density", {}).get(
|
||||
"value"
|
||||
), # Using .get() for optional fields
|
||||
density=raw_material.get("density", {}).get("value"),
|
||||
structural_asset=raw_material.get("structuralAsset"),
|
||||
compressive_strength=raw_material.get("compressiveStrength", {}).get(
|
||||
"value"
|
||||
|
||||
Reference in New Issue
Block a user