Skip to content

Commit

Permalink
fix(results): Skip light path if already processed
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Dec 4, 2024
1 parent 80a670d commit af9f68e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion honeybee_radiance_postprocess/ies/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def dynamic_schedule_direct_illuminance(
shd_trans_dict = {}

for grid_info in grids_info:
grid_states_schedule = defaultdict(list)

grid_count = grid_info['count']
light_paths = []
for lp in grid_info['light_path']:
Expand Down Expand Up @@ -178,11 +180,16 @@ def dynamic_schedule_direct_illuminance(
max_indices = array_combinations_filter.argmax(axis=0)
# select the combination for each hour
combinations = [combinations[idx] for idx in max_indices]

# merge the combinations of dicts
for combination in combinations:
for light_path, value in combination.items():
if light_path != '__static_apertures__':
states_schedule[light_path].append(value)
grid_states_schedule[light_path].append(value)

for key, value in grid_states_schedule.items():
if key not in states_schedule:
states_schedule[key] = value

occupancy_hoys = schedule_to_hoys(schedule, results.sun_up_hours)

Expand Down
8 changes: 7 additions & 1 deletion honeybee_radiance_postprocess/results/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,13 @@ def _light_paths_from_grid_info(self, grid_info: Union[dict, str]) -> list:
break
else:
raise Exception(f'Grid info with full_id "{grid_info}" not found.')
light_paths = [elem for lp in grid_info['light_path'] for elem in lp]
light_paths = []
for lp in grid_info['light_path']:
for _lp in lp:
if _lp == '__static_apertures__' and len(lp) > 1:
pass
else:
light_paths.append(_lp)

return light_paths

Expand Down

0 comments on commit af9f68e

Please sign in to comment.