Skip to content

Commit

Permalink
feat(room): Add property for Room multiplier
Browse files Browse the repository at this point in the history
I know that multipliers clearly have a use in energy simulation but, after thinking about it, they are just as helpful in computing daylight metrics over buildings and so they really should live in honeybee-core. So this commit adds them as a property on the room.

I also took the opportunity to revise several of the docstrings to make it clear which core properties are set-able or not (following a convention that I originally saw in RhinoCommon). You don't really have to review these though, @mostaphaRoudsari . Just looking over the Room changes and letting me know if you agree is good.
  • Loading branch information
chriswmackey authored and Chris Mackey committed Oct 13, 2019
1 parent d316fa6 commit 2dcf1df
Show file tree
Hide file tree
Showing 14 changed files with 296 additions and 196 deletions.
4 changes: 2 additions & 2 deletions honeybee/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def name(self, value):

@property
def display_name(self):
"""Original input name by user.
"""Get the original input name by user.
If there are no illegal characters in name then name and display_name will
be the same. Legal characters are ., A-Z, a-z, 0-9, _ and -.
Expand All @@ -44,7 +44,7 @@ def display_name(self):

@property
def properties(self):
"""Object properties, including Radiance, Energy and other properties."""
"""Get object properties, including Radiance, Energy and other properties."""
return self._properties

def duplicate(self):
Expand Down
17 changes: 9 additions & 8 deletions honeybee/_basewithshade.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ class _BaseWithShade(_Base):
"""A base class for all objects that can have Shades nested on them.
Properties:
name
display_name
geometry
outdoor_shades
indoor_shades
* name
* display_name
* geometry
* outdoor_shades
* indoor_shades
* shades
"""
__slots__ = ('_outdoor_shades', '_indoor_shades')

Expand All @@ -28,17 +29,17 @@ def __init__(self, name):

@property
def outdoor_shades(self):
"""Array of all outdoor shades assigned to this object."""
"""Get an array of all outdoor shades assigned to this object."""
return tuple(self._outdoor_shades)

@property
def indoor_shades(self):
"""Array of all indoor shades assigned to this object."""
"""Get an array of all indoor shades assigned to this object."""
return tuple(self._indoor_shades)

@property
def shades(self):
"""Array of all shades (both indoor and outdoor) assigned to this object."""
"""Get an array of all shades (indoor + outdoor) assigned to this object."""
return self._outdoor_shades + self._indoor_shades

def remove_shades(self):
Expand Down
57 changes: 29 additions & 28 deletions honeybee/aperture.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ class Aperture(_BaseWithShade):
"""A single planar Aperture in a Face.
Properties:
name
display_name
boundary_condition
is_operable
indoor_shades
outdoor_shades
parent
has_parent
geometry
vertices
upper_left_vertices
triangulated_mesh3d
normal
center
area
perimeter
* name
* display_name
* boundary_condition
* is_operable
* indoor_shades
* outdoor_shades
* parent
* has_parent
* geometry
* vertices
* upper_left_vertices
* triangulated_mesh3d
* normal
* center
* area
* perimeter
"""
__slots__ = ('_geometry', '_parent', '_boundary_condition', '_is_operable')

Expand Down Expand Up @@ -108,7 +108,7 @@ def from_vertices(cls, name, vertices, boundary_condition=None, is_operable=Fals

@property
def boundary_condition(self):
"""Boundary condition of this aperture."""
"""Get or set the boundary condition of this aperture."""
return self._boundary_condition

@boundary_condition.setter
Expand All @@ -124,7 +124,8 @@ def boundary_condition(self, value):

@property
def is_operable(self):
"""Boolean to note whether the Aperture can be opened for ventilation."""
"""Get or set a boolean for whether the Aperture can be opened for ventilation.
"""
return self._is_operable

@is_operable.setter
Expand All @@ -137,35 +138,35 @@ def is_operable(self, value):

@property
def parent(self):
"""Parent Face if assigned. None if not assigned."""
"""Get the parent Face if assigned. None if not assigned."""
return self._parent

@property
def has_parent(self):
"""Boolean noting whether this Aperture has a parent Face."""
"""Get a boolean noting whether this Aperture has a parent Face."""
return self._parent is not None

@property
def geometry(self):
"""A ladybug_geometry Face3D object representing the aperture."""
"""Get a ladybug_geometry Face3D object representing the aperture."""
return self._geometry

@property
def vertices(self):
"""List of vertices for the aperture (in counter-clockwise order)."""
"""Get a list of vertices for the aperture (in counter-clockwise order)."""
return self._geometry.vertices

@property
def upper_left_vertices(self):
"""List of vertices starting from the upper-left corner.
"""Get a list of vertices starting from the upper-left corner.
This property should be used when exporting to EnergyPlus / OpenStudio.
"""
return self._geometry.upper_left_counter_clockwise_vertices

@property
def triangulated_mesh3d(self):
"""A ladybug_geometry Mesh3D of the aperture geometry composed of triangles.
"""Get a ladybug_geometry Mesh3D of the aperture geometry composed of triangles.
In EnergyPlus / OpenStudio workflows, this property is used to subdivide
the aperture when it has more than 4 vertices. This is necessary since
Expand All @@ -175,13 +176,13 @@ def triangulated_mesh3d(self):

@property
def normal(self):
"""A ladybug_geometry Vector3D for the direction the aperture is pointing.
"""Get a ladybug_geometry Vector3D for the direction the aperture is pointing.
"""
return self._geometry.normal

@property
def center(self):
"""A ladybug_geometry Point3D for the center of the aperture.
"""Get a ladybug_geometry Point3D for the center of the aperture.
Note that this is the center of the bounding rectangle around this geometry
and not the area centroid.
Expand All @@ -190,12 +191,12 @@ def center(self):

@property
def area(self):
"""The area of the aperture."""
"""Get the area of the aperture."""
return self._geometry.area

@property
def perimeter(self):
"""The perimeter of the aperture."""
"""Get the perimeter of the aperture."""
return self._geometry.perimeter

def set_adjacency(self, other_aperture):
Expand Down
28 changes: 14 additions & 14 deletions honeybee/boundarycondition.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ def __init__(self):

@property
def name(self):
"""Name of the boundary condition (ie. 'Outdoors', 'Ground')."""
"""Get the name of the boundary condition (ie. 'Outdoors', 'Ground')."""
return self.__class__.__name__

@property
def view_factor(self):
"""The view factor to the ground."""
"""Get the view factor to the ground."""
return 'autocalculate'

@property
def sun_exposure_idf(self):
"""Text string for sun exposure, which is write-able into an IDF."""
"""Get a text string for sun exposure, which is write-able into an IDF."""
return 'NoSun'

@property
def wind_exposure_idf(self):
"""Text string for wind exposure, which is write-able into an IDF."""
""" Get a text string for wind exposure, which is write-able into an IDF."""
return 'NoWind'

def to_dict(self):
"""Get boundary condition as a dictionary."""
"""Get the boundary condition as a dictionary."""
return {'type': self.name}

def ToString(self):
Expand Down Expand Up @@ -90,31 +90,31 @@ def from_dict(cls, data):

@property
def sun_exposure(self):
"""A boolean noting whether the boundary is exposed to sun."""
"""Get a boolean noting whether the boundary is exposed to sun."""
return self._sun_exposure

@property
def wind_exposure(self):
"""A boolean noting whether the boundary is exposed to wind."""
"""Get a boolean noting whether the boundary is exposed to wind."""
return self._wind_exposure

@property
def view_factor(self):
"""The view factor to the ground as a number or 'autocalculate'."""
"""Get the view factor to the ground as a number or 'autocalculate'."""
return self._view_factor

@property
def sun_exposure_idf(self):
"""Text string for sun exposure, which is write-able into an IDF."""
"""Get a text string for sun exposure, which is write-able into an IDF."""
return 'NoSun' if not self.sun_exposure else 'SunExposed'

@property
def wind_exposure_idf(self):
"""Text string for wind exposure, which is write-able into an IDF."""
"""Get a text string for wind exposure, which is write-able into an IDF."""
return 'NoWind' if not self.wind_exposure else 'WindExposed'

def to_dict(self, full=False):
"""Get boundary condition as a dictionary.
"""Get the boundary condition as a dictionary.
Args:
full: Set to True to get the full dictionary which includes energy
Expand Down Expand Up @@ -198,7 +198,7 @@ def from_other_object(cls, other_object, sub_face=False):

@property
def boundary_condition_objects(self):
"""A tuple of up to 3 object names that are adjacent to this one.
"""Get a tuple of up to 3 object names that are adjacent to this one.
The first object is always the one that is immediately adjacet and is of
the same object type (Face, Aperture, Door).
Expand All @@ -212,11 +212,11 @@ def boundary_condition_objects(self):

@property
def boundary_condition_object(self):
"""The name of the object adjacent to this one."""
"""Get the name of the object adjacent to this one."""
return self._boundary_condition_objects[0]

def to_dict(self):
"""Get boundary condition as a dictionary.
"""Get the boundary condition as a dictionary.
Args:
full: Set to True to get the full dictionary which includes energy
Expand Down
Loading

0 comments on commit 2dcf1df

Please # to comment.