Skip to content

Commit

Permalink
fix(model): Resolve duplicate ID grids before visualization
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey committed Jan 10, 2025
1 parent 9340a8f commit 7cefcdc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions extras-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
honeybee-energy>=1.95.35
honeybee-radiance>=1.64.118
ladybug-vtk>=0.15.0
honeybee-radiance>=1.66.147
ladybug-vtk>=0.15.1
15 changes: 8 additions & 7 deletions honeybee_display/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,14 @@ def model_to_vis_set(

# add grid data if requested
if grid_data_path is not None and os.path.isdir(grid_data_path):
# first try to get all of the Model sensor grids
try:
grids = {g.full_identifier: g for g in
model.properties.radiance.sensor_grids}
except AttributeError: # honeybee-radiance is not installed
grids = {}
if len(grids) != 0:
if len(model.properties.radiance.sensor_grids) != 0:
# first try to get all of the Model sensor grids
model.properties.radiance.merge_duplicate_identifier_grids()
try:
grids = {g.full_identifier: g for g in
model.properties.radiance.sensor_grids}
except AttributeError: # honeybee-radiance is not installed
grids = {}
# gather all of the directories with results
gi_dirs, gi_file, act_data, cur_data = [], 'grids_info.json', 0, 0
root_gi_file = os.path.join(grid_data_path, gi_file)
Expand Down

0 comments on commit 7cefcdc

Please sign in to comment.