-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_analysis.py
More file actions
104 lines (85 loc) · 3.49 KB
/
Copy pathquick_analysis.py
File metadata and controls
104 lines (85 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
"""
Quick UTCI Analysis Runner
A minimal wrapper to run full day UTCI analysis with predefined parameters.
Modify the ANALYSIS_CONFIGS list below to run one or multiple analyses
with different settings in a single execution.
Usage:
python quick_analysis.py
"""
from run_analysis import run_analysis_core
# ============================================================================
# ANALYSIS CONFIGURATIONS
# ============================================================================
# Each configuration is a dictionary with parameters for run_analysis_core().
# Add/modify configurations below as needed.
ANALYSIS_CONFIGS = [
{
"month": 8,
"day": 15,
"grid_size": 2.0,
"model_file": "data/3d_models/Ness-Tziona/nes_tziona_unblock_2.glb",
"epw_file": "data/weather/ISR_TA_Tel.Aviv-Bet.Dagan.401790_TMYx/ISR_TA_Tel.Aviv-Bet.Dagan.401790_TMYx.epw",
"export_csv": False,
"verbose": True,
"project": "Ness-Tziona",
"category": "exploded"
},
# Uncomment below to run multiple analyses:
# {
# "month": 8,
# "day": 15,
# "grid_size": 5.0,
# "embree_quality": "medium",
# "intersects_any": True,
# "export_csv": False,
# "verbose": True
# },
]
def main():
"""Run analysis with predefined configurations."""
print("="*60)
print(f"QUICK UTCI ANALYSIS - {len(ANALYSIS_CONFIGS)} Configuration(s)")
print("="*60)
results = []
for i, config in enumerate(ANALYSIS_CONFIGS, 1):
print(f"\n{'='*60}")
print(f"RUNNING CONFIGURATION {i}/{len(ANALYSIS_CONFIGS)}")
print(f"{'='*60}")
print(f"Parameters: {config}")
try:
result = run_analysis_core(**config)
results.append({"config": config, "result": result, "success": True})
if config.get("verbose", True):
print(f"\n[OK] Configuration {i} completed successfully")
except Exception as e:
print(f"\n[ERROR] Configuration {i} failed: {e}")
import traceback
traceback.print_exc()
results.append({"config": config, "error": str(e), "success": False})
# Summary
print("\n" + "="*60)
print("QUICK ANALYSIS SUMMARY")
print("="*60)
print(f"Total configurations: {len(ANALYSIS_CONFIGS)}")
print(f"Successful: {sum(1 for r in results if r['success'])}")
print(f"Failed: {sum(1 for r in results if not r['success'])}")
for i, result in enumerate(results, 1):
if result["success"]:
res = result["result"]
print(f"\nConfig {i}: SUCCESS")
print(f" - Grid: {res['grid_size']}m")
print(f" - Date: {res['month']}/{res['day']}")
print(f" - UTCI: {res['utci_min']:.1f} to {res['utci_max']:.1f}C (mean: {res['utci_mean']:.1f}C)")
print(f" - Shading Index: {res['shading_min']:.3f} to {res['shading_max']:.3f} (mean: {res['shading_mean']:.3f})")
print(f" - Runtime: {res['total_time']:.1f}s")
if res.get('csv_path'):
print(f" - CSV: {res['csv_path']}")
print(f" - Binary: {res['binary_path']}")
print(f" - Metadata: {res['metadata_path']}")
else:
print(f"\nConfig {i}: FAILED")
print(f" - Error: {result['error']}")
print("="*60)
return 0 if all(r["success"] for r in results) else 1
if __name__ == "__main__":
exit(main())