Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- app/main.py +14 -0
app/main.py
CHANGED
|
@@ -526,6 +526,20 @@ class HVACCalculator:
|
|
| 526 |
if not summary:
|
| 527 |
return False, "Cooling load summary calculation failed. Check input data.", {}
|
| 528 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
# Format results for results_display.py
|
| 530 |
floor_area = building_info.get('floor_area', 100.0) or 100.0
|
| 531 |
results = {
|
|
|
|
| 526 |
if not summary:
|
| 527 |
return False, "Cooling load summary calculation failed. Check input data.", {}
|
| 528 |
|
| 529 |
+
# Ensure summary has all required keys
|
| 530 |
+
if 'total' not in summary:
|
| 531 |
+
# Calculate total if missing
|
| 532 |
+
if 'total_sensible' in summary and 'total_latent' in summary:
|
| 533 |
+
summary['total'] = summary['total_sensible'] + summary['total_latent']
|
| 534 |
+
else:
|
| 535 |
+
# Fallback to sum of design loads if needed
|
| 536 |
+
total_load = sum(value for key, value in design_loads.items() if key != 'design_hour')
|
| 537 |
+
summary = {
|
| 538 |
+
'total_sensible': total_load * 0.7, # Approximate sensible ratio
|
| 539 |
+
'total_latent': total_load * 0.3, # Approximate latent ratio
|
| 540 |
+
'total': total_load
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
# Format results for results_display.py
|
| 544 |
floor_area = building_info.get('floor_area', 100.0) or 100.0
|
| 545 |
results = {
|