Skip to content

Commit

Permalink
fix(results): Create zero array if grid array is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Jul 21, 2023
1 parent 0984f58 commit c092f4e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion honeybee_radiance_postprocess/results.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,10 @@ def annual_data(
array = self._array_from_states(grid_info, states=states, res_type=res_type)
indices = sensor_index[grid_id]
for idx in indices:
values = array[idx, :]
if np.any(array):
values = array[idx, :]
else:
values = np.zeros(len(self.sun_up_hours))
annual_array = Results.values_to_annual(
self.sun_up_hours, values, self.timestep)
header = Header(Illuminance(), 'lux', analysis_period)
Expand Down

0 comments on commit c092f4e

Please sign in to comment.