From 61503d9562c804b60908ee616eeb339862eeb8d9 Mon Sep 17 00:00:00 2001 From: Mikkel Pedersen Date: Tue, 20 Aug 2024 13:01:02 +0200 Subject: [PATCH] fix(multiphase): Use room display name for auto group naming --- honeybee_radiance/dynamic/multiphase.py | 10 ++++++---- honeybee_radiance/modifier/material/bsdf.py | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/honeybee_radiance/dynamic/multiphase.py b/honeybee_radiance/dynamic/multiphase.py index e1cdcd7b0..61a38a6f5 100644 --- a/honeybee_radiance/dynamic/multiphase.py +++ b/honeybee_radiance/dynamic/multiphase.py @@ -280,6 +280,7 @@ def cluster_orientation(room_apertures, apertures, room_based=True, vertical_tol for room_id, data in room_apertures.items(): _normal_list = [] grouped_apertures = [] + ap_groups[room_id] = {} for ap in data['apertures']: # check if normal is already in list n_bools = [ap.normal.is_equivalent(n, tolerance=0.01) @@ -310,7 +311,8 @@ def cluster_orientation(room_apertures, apertures, room_based=True, vertical_tol vertical_groups.extend(_ap_groups) grouped_apertures = vertical_groups - ap_groups[room_id] = grouped_apertures + ap_groups[room_id]['aperture_groups'] = grouped_apertures + ap_groups[room_id]['display_name'] = data['display_name'] else: _normal_list = [] grouped_apertures = [] @@ -352,10 +354,10 @@ def cluster_output(ap_groups, room_apertures, room_based=True): group_names = [] group_dict = {} if room_based: - for room_id, groups in ap_groups.items(): - for idx, group in enumerate(groups): + for room_id, data in ap_groups.items(): + for idx, group in enumerate(data['aperture_groups']): ap_ids = [ap.identifier for ap in group] - group_name = '{}_ApertureGroup_{}'.format(room_id, idx) + group_name = '{}_ApertureGroup_{}'.format(data['display_name'], idx) group_names.append( {'identifier': group_name, 'apertures': ap_ids} ) diff --git a/honeybee_radiance/modifier/material/bsdf.py b/honeybee_radiance/modifier/material/bsdf.py index 31b3f8ba2..d691a0ff2 100644 --- a/honeybee_radiance/modifier/material/bsdf.py +++ b/honeybee_radiance/modifier/material/bsdf.py @@ -83,7 +83,7 @@ def __init__(self, bsdf_file, identifier=None, up_orientation=None, thickness=0, self.thickness = thickness or 0 aBSDF.__init__(self, bsdf_file, identifier, up_orientation, modifier, function_file, transform, angle_basis, dependencies) - + def _update_values(self): "update value dictionaries." n_path = os.path.normpath(self.bsdf_file).replace('\\', '/')