Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixt(windowshade): Ensure all window shade materials are in HBJSON #953

Merged
merged 1 commit into from May 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions honeybee_energy/construction/windowshade.py
Expand Up @@ -367,7 +367,7 @@ def u_value(self):

@property
def r_factor(self):
"""Bare window construction R-factor [m2-K/W] (with standard air film resistances).
"""Bare window construction R-factor [m2-K/W] (with standard air resistances).

Note that this excludes all effects of the shade layer.
Formulas for film coefficients come from EN673 / ISO10292.
Expand All @@ -376,7 +376,7 @@ def r_factor(self):

@property
def u_factor(self):
"""Bare window construction U-factor [W/m2-K] (with standard air film resistances).
"""Bare window construction U-factor [W/m2-K] (with standard air resistances).

Note that this excludes all effects of the shade layer.
Formulas for film coefficients come from EN673 / ISO10292.
Expand Down Expand Up @@ -559,12 +559,12 @@ def user_data(self, value):
assert isinstance(value, dict), 'Expected dictionary for honeybee_energy' \
'object user_data. Got {}.'.format(type(value))
self._user_data = value

@property
def properties(self):
"""Get properties for extensions."""
return self._properties

@classmethod
def from_dict(cls, data):
"""Create a WindowConstructionShade from a dictionary.
Expand Down
20 changes: 13 additions & 7 deletions honeybee_energy/properties/model.py
Expand Up @@ -94,9 +94,11 @@ def materials(self):
materials.extend(constr.materials)
if constr.has_frame:
materials.append(constr.frame)
if isinstance(constr, WindowConstructionShade) \
and constr.is_switchable_glazing:
materials.append(constr.switched_glass_material)
if isinstance(constr, WindowConstructionShade):
if constr.is_switchable_glazing:
materials.append(constr.switched_glass_material)
if constr.shade_location == 'Between':
materials.append(constr.window_construction.materials[-2])
except AttributeError:
pass # ShadeConstruction or AirBoundaryConstruction
return list(set(materials))
Expand Down Expand Up @@ -403,7 +405,7 @@ def remove_child_constructions(self):

def window_construction_by_orientation(
self, construction, orientation=0, offset=45, north_vector=Vector2D(0, 1)):
"""Set the construction of exterior Apertures in Walls facing a given orientation.
"""Set the construction of exterior Apertures facing a given orientation.

This is useful for testing orientation-specific energy conservation
strategies or creating ASHRAE baseline buildings.
Expand Down Expand Up @@ -1410,6 +1412,8 @@ def dump_properties_to_dict(
if constr.has_shade:
if constr.is_switchable_glazing:
misc_c_mats.append(constr.switched_glass_material)
if constr.shade_location == 'Between':
materials.append(constr.window_construction.materials[-2])
except AttributeError: # not a construction with materials
pass
all_mats = set(all_m + misc_c_mats)
Expand Down Expand Up @@ -1494,9 +1498,11 @@ def _add_constr_type_objs_to_dict(self, base):
materials.extend(cnstr.materials)
if cnstr.has_frame:
materials.append(cnstr.frame)
if isinstance(cnstr, WindowConstructionShade) \
and cnstr.is_switchable_glazing:
materials.append(cnstr.switched_glass_material)
if isinstance(cnstr, WindowConstructionShade):
if cnstr.is_switchable_glazing:
materials.append(cnstr.switched_glass_material)
if cnstr.shade_location == 'Between':
materials.append(cnstr.window_construction.materials[-2])
except AttributeError:
pass # ShadeConstruction
base['energy']['materials'] = [mat.to_dict() for mat in set(materials)]
Expand Down