Skip to content

Commit f5233ec

Browse files
chriswmackeyChris Mackey
authored andcommitted
fix(model): Reformat invalid Python 2 syntax for IronPython/Grasshopper
1 parent 770011b commit f5233ec

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

honeybee_display/model.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Method to translate a Model to a VisualizationSet."""
22
import os
3-
import pathlib
43
import json
54

65
from ladybug_geometry.geometry3d import Point3D, Face3D
@@ -512,8 +511,8 @@ def _read_sensor_grid_result(result_folder):
512511
break
513512
if result_file is not None:
514513
print(
515-
f'Loading results for {grid_id} with {sensor_count} sensors. '
516-
f'Starting from line {st_ln}.'
514+
'Loading results for {} with {} sensors. '
515+
'Starting from line {}.'.format(grid_id, sensor_count, st_ln)
517516
)
518517
with open(result_file) as inf:
519518
for _ in range(st_ln):
@@ -522,13 +521,15 @@ def _read_sensor_grid_result(result_folder):
522521
try:
523522
value = float(next(inf))
524523
except (StopIteration, ValueError):
525-
content = pathlib.Path(result_file).read_text()
524+
with open(result_file, 'r') as rf:
525+
content = rf.read()
526526
ln_count = len(content.split())
527527
raise ValueError(
528-
f'Failed to load the results for {grid_id} '
529-
f'with {sensor_count} sensors. Sensor id: {count}\n'
530-
f'Here is the content of the file with {ln_count} values:\n'
531-
f'## Start of the file\n{content}\n## End of the file.'
528+
'Failed to load the results for {} '
529+
'with {} sensors. Sensor id: {}\n'
530+
'Here is the content of the file with {} values:\n'
531+
'## Start of the file\n{}\n## End of the file.'.format(
532+
grid_id, sensor_count, count, ln_count, content)
532533
)
533534
else:
534535
results.append(value)

0 commit comments

Comments
 (0)