Skip to content

Commit

Permalink
fix(results): Skip static if length of light path is > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkelkp committed Dec 4, 2024
1 parent 492ea83 commit d2be71e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 23 deletions.
24 changes: 8 additions & 16 deletions honeybee_radiance_postprocess/ies/lm.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
"""Functions for IES LM post-processing."""
from typing import Tuple, Union
from pathlib import Path
from collections import defaultdict
import json
import itertools
import numpy as np

from ladybug.analysisperiod import AnalysisPeriod
from ladybug.datatype.generic import GenericType
from ladybug.color import Colorset
from ladybug.datacollection import HourlyContinuousCollection
from ladybug.datatype.fraction import Fraction
from ladybug.datatype.time import Time
from ladybug.legend import LegendParameters
from ladybug.header import Header
from honeybee.model import Model
from honeybee.units import conversion_factor_to_meters
from honeybee_radiance.writer import _filter_by_pattern
from honeybee_radiance.postprocess.annual import filter_schedule_by_hours

from ..metrics import da_array2d, ase_array2d
from ..annual import schedule_to_hoys, occupancy_schedule_8_to_6
from ..results.annual_daylight import AnnualDaylight
from ..util import filter_array, recursive_dict_merge
from ..util import filter_array
from ..dynamic import DynamicSchedule, ApertureGroupSchedule
from .lm_schedule import shd_trans_schedule_descending, states_schedule_descending

Expand Down Expand Up @@ -124,7 +110,13 @@ def dynamic_schedule_direct_illuminance(

for grid_info in grids_info:
grid_count = grid_info['count']
light_paths = [lp[0] for lp in grid_info['light_path']]
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)

shade_transmittances, shd_trans_dict = (
shade_transmittance_per_light_path(
Expand Down
24 changes: 21 additions & 3 deletions honeybee_radiance_postprocess/leed/leed.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,13 @@ def leed_states_schedule(

for grid_info in grids_info:
grid_count = grid_info['count']
light_paths = [lp[0] for lp in grid_info['light_path']]
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)

shade_transmittances, shd_trans_dict = (
shade_transmittance_per_light_path(
Expand Down Expand Up @@ -525,7 +531,13 @@ def leed_option_one(
pass_ase_grids = []
ase_hr_pct = []
for (grid_info, grid_area) in zip(grids_info, grid_areas):
light_paths = [lp[0] for lp in grid_info['light_path']]
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)
arrays = []
# combine direct array for all light paths
for light_path in light_paths:
Expand Down Expand Up @@ -558,7 +570,13 @@ def leed_option_one(
pass_sda_blinds_up_grids = []
pass_sda_blinds_down_grids = []
for grid_info in grids_info:
light_paths = [lp[0] for lp in grid_info['light_path']]
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)
base_zero_array = np.apply_along_axis(filter_array, 1, np.zeros(
(grid_info['count'], len(results.sun_up_hours))), occ_mask)
arrays = [base_zero_array.copy()]
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 @@ -1188,7 +1188,13 @@ def _filter_grid_states(self, grid_info, states: DynamicSchedule = None) -> Dyna
Returns:
dict: A filtered states dictionary.
"""
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)
if states:
states = states.filter_by_identifiers(light_paths)
else:
Expand Down
10 changes: 7 additions & 3 deletions honeybee_radiance_postprocess/well/well.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""Functions for WELL post-processing."""
from typing import Tuple, Union
from pathlib import Path
from collections import defaultdict
import json
import itertools
import numpy as np

from ladybug.analysisperiod import AnalysisPeriod
Expand Down Expand Up @@ -239,7 +237,13 @@ def well_annual_daylight(
l01_pass_sda_blinds_up_grids = []
l01_pass_sda_blinds_down_grids = []
for grid_info in grids_info:
light_paths = [lp[0] for lp in grid_info['light_path']]
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)
base_zero_array = np.apply_along_axis(filter_array, 1, np.zeros(
(grid_info['count'], len(results.sun_up_hours))), occ_mask)
arrays_blinds_up = [base_zero_array.copy()]
Expand Down

0 comments on commit d2be71e

Please sign in to comment.