Skip to content

Commit bd83064

Browse files
fix: add detailed message for loading results
This will be helpful for debugging the rare cases that fail on Pollination.
1 parent 1127475 commit bd83064

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

honeybee_display/model.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Method to translate a Model to a VisualizationSet."""
22
import os
3+
import pathlib
34
import json
45

56
from ladybug_geometry.geometry3d import Point3D, Face3D
@@ -510,9 +511,14 @@ def _read_sensor_grid_result(result_folder):
510511
result_file = os.path.join(result_folder, f)
511512
break
512513
if result_file is not None:
514+
print(f'Loading results for {grid_id} with {sensor_count} sensors. Starting from line {st_ln}.')
513515
with open(result_file) as inf:
514516
for _ in range(st_ln):
515517
next(inf)
516518
for _ in range(sensor_count):
517-
results.append(float(next(inf)))
519+
try:
520+
results.append(float(next(inf)))
521+
except StopIteration:
522+
content = pathlib.Path(result_file).read_text()
523+
raise ValueError(f'Failed to load the results. Here is the content of the file: {content}')
518524
return results

0 commit comments

Comments
 (0)