honeybee-energy 1.116.106__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- honeybee_energy/__init__.py +24 -0
- honeybee_energy/__main__.py +4 -0
- honeybee_energy/_extend_honeybee.py +145 -0
- honeybee_energy/altnumber.py +21 -0
- honeybee_energy/baseline/__init__.py +2 -0
- honeybee_energy/baseline/create.py +608 -0
- honeybee_energy/baseline/data/__init__.py +1 -0
- honeybee_energy/baseline/data/constructions.csv +64 -0
- honeybee_energy/baseline/data/fen_ratios.csv +15 -0
- honeybee_energy/baseline/data/lpd_building.csv +21 -0
- honeybee_energy/baseline/data/pci_2016.csv +22 -0
- honeybee_energy/baseline/data/pci_2019.csv +22 -0
- honeybee_energy/baseline/data/pci_2022.csv +22 -0
- honeybee_energy/baseline/data/shw.csv +21 -0
- honeybee_energy/baseline/pci.py +512 -0
- honeybee_energy/baseline/result.py +371 -0
- honeybee_energy/boundarycondition.py +128 -0
- honeybee_energy/cli/__init__.py +69 -0
- honeybee_energy/cli/baseline.py +475 -0
- honeybee_energy/cli/edit.py +327 -0
- honeybee_energy/cli/lib.py +1154 -0
- honeybee_energy/cli/result.py +810 -0
- honeybee_energy/cli/setconfig.py +124 -0
- honeybee_energy/cli/settings.py +569 -0
- honeybee_energy/cli/simulate.py +380 -0
- honeybee_energy/cli/translate.py +1714 -0
- honeybee_energy/cli/validate.py +224 -0
- honeybee_energy/config.json +11 -0
- honeybee_energy/config.py +842 -0
- honeybee_energy/construction/__init__.py +1 -0
- honeybee_energy/construction/_base.py +374 -0
- honeybee_energy/construction/air.py +325 -0
- honeybee_energy/construction/dictutil.py +89 -0
- honeybee_energy/construction/dynamic.py +607 -0
- honeybee_energy/construction/opaque.py +460 -0
- honeybee_energy/construction/shade.py +319 -0
- honeybee_energy/construction/window.py +1096 -0
- honeybee_energy/construction/windowshade.py +847 -0
- honeybee_energy/constructionset.py +1655 -0
- honeybee_energy/dictutil.py +56 -0
- honeybee_energy/generator/__init__.py +5 -0
- honeybee_energy/generator/loadcenter.py +204 -0
- honeybee_energy/generator/pv.py +535 -0
- honeybee_energy/hvac/__init__.py +21 -0
- honeybee_energy/hvac/_base.py +124 -0
- honeybee_energy/hvac/_template.py +270 -0
- honeybee_energy/hvac/allair/__init__.py +22 -0
- honeybee_energy/hvac/allair/_base.py +349 -0
- honeybee_energy/hvac/allair/furnace.py +168 -0
- honeybee_energy/hvac/allair/psz.py +131 -0
- honeybee_energy/hvac/allair/ptac.py +163 -0
- honeybee_energy/hvac/allair/pvav.py +109 -0
- honeybee_energy/hvac/allair/vav.py +128 -0
- honeybee_energy/hvac/detailed.py +337 -0
- honeybee_energy/hvac/doas/__init__.py +28 -0
- honeybee_energy/hvac/doas/_base.py +345 -0
- honeybee_energy/hvac/doas/fcu.py +127 -0
- honeybee_energy/hvac/doas/radiant.py +329 -0
- honeybee_energy/hvac/doas/vrf.py +81 -0
- honeybee_energy/hvac/doas/wshp.py +91 -0
- honeybee_energy/hvac/heatcool/__init__.py +23 -0
- honeybee_energy/hvac/heatcool/_base.py +177 -0
- honeybee_energy/hvac/heatcool/baseboard.py +61 -0
- honeybee_energy/hvac/heatcool/evapcool.py +72 -0
- honeybee_energy/hvac/heatcool/fcu.py +92 -0
- honeybee_energy/hvac/heatcool/gasunit.py +53 -0
- honeybee_energy/hvac/heatcool/radiant.py +269 -0
- honeybee_energy/hvac/heatcool/residential.py +77 -0
- honeybee_energy/hvac/heatcool/vrf.py +54 -0
- honeybee_energy/hvac/heatcool/windowac.py +70 -0
- honeybee_energy/hvac/heatcool/wshp.py +62 -0
- honeybee_energy/hvac/idealair.py +699 -0
- honeybee_energy/internalmass.py +310 -0
- honeybee_energy/lib/__init__.py +1 -0
- honeybee_energy/lib/_loadconstructions.py +194 -0
- honeybee_energy/lib/_loadconstructionsets.py +117 -0
- honeybee_energy/lib/_loadmaterials.py +83 -0
- honeybee_energy/lib/_loadprogramtypes.py +125 -0
- honeybee_energy/lib/_loadschedules.py +87 -0
- honeybee_energy/lib/_loadtypelimits.py +64 -0
- honeybee_energy/lib/constructions.py +207 -0
- honeybee_energy/lib/constructionsets.py +95 -0
- honeybee_energy/lib/materials.py +67 -0
- honeybee_energy/lib/programtypes.py +125 -0
- honeybee_energy/lib/schedules.py +61 -0
- honeybee_energy/lib/scheduletypelimits.py +31 -0
- honeybee_energy/load/__init__.py +1 -0
- honeybee_energy/load/_base.py +190 -0
- honeybee_energy/load/daylight.py +397 -0
- honeybee_energy/load/dictutil.py +47 -0
- honeybee_energy/load/equipment.py +771 -0
- honeybee_energy/load/hotwater.py +543 -0
- honeybee_energy/load/infiltration.py +460 -0
- honeybee_energy/load/lighting.py +480 -0
- honeybee_energy/load/people.py +497 -0
- honeybee_energy/load/process.py +472 -0
- honeybee_energy/load/setpoint.py +816 -0
- honeybee_energy/load/ventilation.py +550 -0
- honeybee_energy/material/__init__.py +1 -0
- honeybee_energy/material/_base.py +166 -0
- honeybee_energy/material/dictutil.py +59 -0
- honeybee_energy/material/frame.py +367 -0
- honeybee_energy/material/gas.py +1087 -0
- honeybee_energy/material/glazing.py +854 -0
- honeybee_energy/material/opaque.py +1351 -0
- honeybee_energy/material/shade.py +1360 -0
- honeybee_energy/measure.py +472 -0
- honeybee_energy/programtype.py +723 -0
- honeybee_energy/properties/__init__.py +1 -0
- honeybee_energy/properties/aperture.py +333 -0
- honeybee_energy/properties/door.py +342 -0
- honeybee_energy/properties/extension.py +244 -0
- honeybee_energy/properties/face.py +274 -0
- honeybee_energy/properties/model.py +2640 -0
- honeybee_energy/properties/room.py +1747 -0
- honeybee_energy/properties/shade.py +314 -0
- honeybee_energy/properties/shademesh.py +262 -0
- honeybee_energy/reader.py +48 -0
- honeybee_energy/result/__init__.py +1 -0
- honeybee_energy/result/colorobj.py +648 -0
- honeybee_energy/result/emissions.py +290 -0
- honeybee_energy/result/err.py +101 -0
- honeybee_energy/result/eui.py +100 -0
- honeybee_energy/result/generation.py +160 -0
- honeybee_energy/result/loadbalance.py +890 -0
- honeybee_energy/result/match.py +202 -0
- honeybee_energy/result/osw.py +90 -0
- honeybee_energy/result/rdd.py +59 -0
- honeybee_energy/result/zsz.py +190 -0
- honeybee_energy/run.py +1577 -0
- honeybee_energy/schedule/__init__.py +1 -0
- honeybee_energy/schedule/day.py +626 -0
- honeybee_energy/schedule/dictutil.py +59 -0
- honeybee_energy/schedule/fixedinterval.py +1012 -0
- honeybee_energy/schedule/rule.py +619 -0
- honeybee_energy/schedule/ruleset.py +1867 -0
- honeybee_energy/schedule/typelimit.py +310 -0
- honeybee_energy/shw.py +315 -0
- honeybee_energy/simulation/__init__.py +1 -0
- honeybee_energy/simulation/control.py +214 -0
- honeybee_energy/simulation/daylightsaving.py +185 -0
- honeybee_energy/simulation/dictutil.py +51 -0
- honeybee_energy/simulation/output.py +646 -0
- honeybee_energy/simulation/parameter.py +606 -0
- honeybee_energy/simulation/runperiod.py +443 -0
- honeybee_energy/simulation/shadowcalculation.py +295 -0
- honeybee_energy/simulation/sizing.py +546 -0
- honeybee_energy/ventcool/__init__.py +5 -0
- honeybee_energy/ventcool/_crack_data.py +91 -0
- honeybee_energy/ventcool/afn.py +289 -0
- honeybee_energy/ventcool/control.py +269 -0
- honeybee_energy/ventcool/crack.py +126 -0
- honeybee_energy/ventcool/fan.py +493 -0
- honeybee_energy/ventcool/opening.py +365 -0
- honeybee_energy/ventcool/simulation.py +314 -0
- honeybee_energy/writer.py +1078 -0
- honeybee_energy-1.116.106.dist-info/METADATA +113 -0
- honeybee_energy-1.116.106.dist-info/RECORD +162 -0
- honeybee_energy-1.116.106.dist-info/WHEEL +5 -0
- honeybee_energy-1.116.106.dist-info/entry_points.txt +2 -0
- honeybee_energy-1.116.106.dist-info/licenses/LICENSE +661 -0
- honeybee_energy-1.116.106.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""Shade Construction."""
|
|
3
|
+
from __future__ import division
|
|
4
|
+
|
|
5
|
+
from honeybee._lockable import lockable
|
|
6
|
+
from honeybee.typing import valid_ep_string, float_in_range, clean_rad_string
|
|
7
|
+
|
|
8
|
+
from .window import WindowConstruction
|
|
9
|
+
from ..material.glazing import EnergyWindowMaterialGlazing
|
|
10
|
+
from ..writer import generate_idf_string
|
|
11
|
+
from ..properties.extension import ShadeConstructionProperties
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@lockable
|
|
15
|
+
class ShadeConstruction(object):
|
|
16
|
+
"""Construction for Shade objects.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
identifier: Text string for a unique Construction ID. Must be < 100 characters
|
|
20
|
+
and not contain any EnergyPlus special characters. This will be used to
|
|
21
|
+
identify the object across a model and in the exported IDF.
|
|
22
|
+
solar_reflectance: A number between 0 and 1 for the solar reflectance
|
|
23
|
+
of the construction. Default: 0.2.
|
|
24
|
+
visible_reflectance: A number between 0 and 1 for the visible reflectance
|
|
25
|
+
of the construction. Default: 0.2.
|
|
26
|
+
is_specular: A boolean to note whether the reflection off the shade
|
|
27
|
+
should be diffuse (False) or specular (True). Set to True if the
|
|
28
|
+
construction is representing a glass facade or a mirror material.
|
|
29
|
+
Default: False.
|
|
30
|
+
|
|
31
|
+
Properties:
|
|
32
|
+
* identifier
|
|
33
|
+
* display_name
|
|
34
|
+
* solar_reflectance
|
|
35
|
+
* visible_reflectance
|
|
36
|
+
* is_specular
|
|
37
|
+
* is_default
|
|
38
|
+
* inside_solar_reflectance
|
|
39
|
+
* inside_visible_reflectance
|
|
40
|
+
* outside_solar_reflectance
|
|
41
|
+
* outside_visible_reflectance
|
|
42
|
+
* user_data
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
__slots__ = ('_identifier', '_display_name', '_solar_reflectance',
|
|
46
|
+
'_visible_reflectance', '_is_specular',
|
|
47
|
+
'_locked', '_properties', '_user_data')
|
|
48
|
+
|
|
49
|
+
def __init__(self, identifier, solar_reflectance=0.2, visible_reflectance=0.2,
|
|
50
|
+
is_specular=False):
|
|
51
|
+
"""Initialize shade construction."""
|
|
52
|
+
self._locked = False # unlocked by default
|
|
53
|
+
self.identifier = identifier
|
|
54
|
+
self._display_name = None
|
|
55
|
+
self.solar_reflectance = solar_reflectance
|
|
56
|
+
self.visible_reflectance = visible_reflectance
|
|
57
|
+
self.is_specular = is_specular
|
|
58
|
+
self._user_data = None
|
|
59
|
+
self._properties = ShadeConstructionProperties(self)
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def identifier(self):
|
|
63
|
+
"""Get or set the text string for construction identifier."""
|
|
64
|
+
return self._identifier
|
|
65
|
+
|
|
66
|
+
@identifier.setter
|
|
67
|
+
def identifier(self, identifier):
|
|
68
|
+
self._identifier = valid_ep_string(identifier, 'construction identifier')
|
|
69
|
+
|
|
70
|
+
@property
|
|
71
|
+
def display_name(self):
|
|
72
|
+
"""Get or set a string for the object name without any character restrictions.
|
|
73
|
+
|
|
74
|
+
If not set, this will be equal to the identifier.
|
|
75
|
+
"""
|
|
76
|
+
if self._display_name is None:
|
|
77
|
+
return self._identifier
|
|
78
|
+
return self._display_name
|
|
79
|
+
|
|
80
|
+
@display_name.setter
|
|
81
|
+
def display_name(self, value):
|
|
82
|
+
if value is not None:
|
|
83
|
+
try:
|
|
84
|
+
value = str(value)
|
|
85
|
+
except UnicodeEncodeError: # Python 2 machine lacking the character set
|
|
86
|
+
pass # keep it as unicode
|
|
87
|
+
self._display_name = value
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def solar_reflectance(self):
|
|
91
|
+
"""Get or set the solar reflectance of the shade."""
|
|
92
|
+
return self._solar_reflectance
|
|
93
|
+
|
|
94
|
+
@solar_reflectance.setter
|
|
95
|
+
def solar_reflectance(self, value):
|
|
96
|
+
self._solar_reflectance = float_in_range(
|
|
97
|
+
value, 0, 1, 'shade construction solar reflectance')
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def visible_reflectance(self):
|
|
101
|
+
"""Get or set the visible reflectance of the shade."""
|
|
102
|
+
return self._visible_reflectance
|
|
103
|
+
|
|
104
|
+
@visible_reflectance.setter
|
|
105
|
+
def visible_reflectance(self, value):
|
|
106
|
+
self._visible_reflectance = float_in_range(
|
|
107
|
+
value, 0, 1, 'shade construction visible reflectance')
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def is_specular(self):
|
|
111
|
+
"""Get or set a boolean to note whether the reflection is diffuse or specular."""
|
|
112
|
+
return self._is_specular
|
|
113
|
+
|
|
114
|
+
@is_specular.setter
|
|
115
|
+
def is_specular(self, value):
|
|
116
|
+
try:
|
|
117
|
+
self._is_specular = bool(value)
|
|
118
|
+
except TypeError:
|
|
119
|
+
raise TypeError('Expected boolean for ShadeConstruction.is_specular. '
|
|
120
|
+
'Got {}.'.format(type(value)))
|
|
121
|
+
|
|
122
|
+
@property
|
|
123
|
+
def is_default(self):
|
|
124
|
+
"""Get a Boolean for whether all properties follow the EnergyPlus default."""
|
|
125
|
+
return self._solar_reflectance == 0.2 and \
|
|
126
|
+
self._visible_reflectance == 0.2 and not self._is_specular
|
|
127
|
+
|
|
128
|
+
@property
|
|
129
|
+
def inside_solar_reflectance(self):
|
|
130
|
+
"""Get the solar reflectance of the construction."""
|
|
131
|
+
return self._solar_reflectance
|
|
132
|
+
|
|
133
|
+
@property
|
|
134
|
+
def inside_visible_reflectance(self):
|
|
135
|
+
"""Get the visible reflectance of the construction."""
|
|
136
|
+
return self._visible_reflectance
|
|
137
|
+
|
|
138
|
+
@property
|
|
139
|
+
def outside_solar_reflectance(self):
|
|
140
|
+
"""Get the solar reflectance of the construction."""
|
|
141
|
+
return self._solar_reflectance
|
|
142
|
+
|
|
143
|
+
@property
|
|
144
|
+
def outside_visible_reflectance(self):
|
|
145
|
+
"""Get the visible reflectance of the construction."""
|
|
146
|
+
return self._visible_reflectance
|
|
147
|
+
|
|
148
|
+
@property
|
|
149
|
+
def user_data(self):
|
|
150
|
+
"""Get or set an optional dictionary for additional meta data for this object.
|
|
151
|
+
|
|
152
|
+
This will be None until it has been set. All keys and values of this
|
|
153
|
+
dictionary should be of a standard Python type to ensure correct
|
|
154
|
+
serialization of the object to/from JSON (eg. str, float, int, list, dict)
|
|
155
|
+
"""
|
|
156
|
+
if self._user_data is not None:
|
|
157
|
+
return self._user_data
|
|
158
|
+
|
|
159
|
+
@user_data.setter
|
|
160
|
+
def user_data(self, value):
|
|
161
|
+
if value is not None:
|
|
162
|
+
assert isinstance(value, dict), 'Expected dictionary for honeybee_energy' \
|
|
163
|
+
'object _user_data. Got {}.'.format(type(value))
|
|
164
|
+
self._user_data = value
|
|
165
|
+
|
|
166
|
+
@property
|
|
167
|
+
def properties(self):
|
|
168
|
+
"""Get properties for extensions."""
|
|
169
|
+
return self._properties
|
|
170
|
+
|
|
171
|
+
def glazing_construction(self):
|
|
172
|
+
"""Get a WindowConstruction that EnergyPlus uses for specular reflection.
|
|
173
|
+
|
|
174
|
+
Will be None if is_specular is False.
|
|
175
|
+
"""
|
|
176
|
+
if not self.is_specular:
|
|
177
|
+
return None
|
|
178
|
+
glz_mat = EnergyWindowMaterialGlazing(
|
|
179
|
+
self.identifier, solar_transmittance=0,
|
|
180
|
+
solar_reflectance=self.solar_reflectance,
|
|
181
|
+
visible_transmittance=0, visible_reflectance=self.visible_reflectance)
|
|
182
|
+
return WindowConstruction(self.identifier, [glz_mat])
|
|
183
|
+
|
|
184
|
+
@classmethod
|
|
185
|
+
def from_dict(cls, data):
|
|
186
|
+
"""Create a ShadeConstruction from a dictionary.
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
data: A python dictionary in the following format
|
|
190
|
+
|
|
191
|
+
.. code-block:: python
|
|
192
|
+
|
|
193
|
+
{
|
|
194
|
+
"type": 'ShadeConstruction',
|
|
195
|
+
"identifier": 'Diffuse Overhang Construction 035',
|
|
196
|
+
"display_name": 'Overhang Construction',
|
|
197
|
+
"solar_reflectance": 0.35,
|
|
198
|
+
"visible_reflectance": 0.35,
|
|
199
|
+
"is_specular": False
|
|
200
|
+
}
|
|
201
|
+
"""
|
|
202
|
+
assert data['type'] == 'ShadeConstruction', \
|
|
203
|
+
'Expected ShadeConstruction. Got {}.'.format(data['type'])
|
|
204
|
+
s_ref = data['solar_reflectance'] if 'solar_reflectance' in data else 0.2
|
|
205
|
+
v_ref = data['visible_reflectance'] if 'visible_reflectance' in data else 0.2
|
|
206
|
+
spec = data['is_specular'] if 'is_specular' in data else False
|
|
207
|
+
new_obj = cls(data['identifier'], s_ref, v_ref, spec)
|
|
208
|
+
if 'display_name' in data and data['display_name'] is not None:
|
|
209
|
+
new_obj.display_name = data['display_name']
|
|
210
|
+
if 'user_data' in data and data['user_data'] is not None:
|
|
211
|
+
new_obj.user_data = data['user_data']
|
|
212
|
+
if 'properties' in data and data['properties'] is not None:
|
|
213
|
+
new_obj.properties._load_extension_attr_from_dict(data['properties'])
|
|
214
|
+
return new_obj
|
|
215
|
+
|
|
216
|
+
def to_idf(self, host_shade_identifier):
|
|
217
|
+
"""IDF string for the ShadingProperty:Reflectance of this construction.
|
|
218
|
+
|
|
219
|
+
Note that, if is_specular is True, the glazing_construction() method must
|
|
220
|
+
be used to also write the glazing construction into the IDF.
|
|
221
|
+
|
|
222
|
+
Args:
|
|
223
|
+
host_shade_identifier: Text string for the identifier of a Shade object that
|
|
224
|
+
possesses this ShadeConstruction.
|
|
225
|
+
|
|
226
|
+
.. code-block:: shell
|
|
227
|
+
|
|
228
|
+
ShadingProperty:Reflectance,
|
|
229
|
+
Adjacent Glazed Facade, !- Name of Surface:Shading Object
|
|
230
|
+
0.3, !- Diffuse Solar Reflectance of Unglazed Part of Shading Surface
|
|
231
|
+
0.3, !- Diffuse Visible Reflectance of Unglazed Part of Shading Surface
|
|
232
|
+
0.7, !- Fraction of Shading Surface That Is Glazed
|
|
233
|
+
GlassCon-1; !- Name of Glazing Construction
|
|
234
|
+
"""
|
|
235
|
+
values = [host_shade_identifier, self.solar_reflectance,
|
|
236
|
+
self.visible_reflectance]
|
|
237
|
+
if self.is_specular:
|
|
238
|
+
values.extend([1, self.identifier])
|
|
239
|
+
comments = ('shading surface name', 'solar reflectance',
|
|
240
|
+
'visible reflectance',
|
|
241
|
+
'fraction of shading surface that is glazed',
|
|
242
|
+
'glazing construction name')
|
|
243
|
+
else:
|
|
244
|
+
comments = ('shading surface name', 'solar reflectance',
|
|
245
|
+
'visible reflectance')
|
|
246
|
+
return generate_idf_string('ShadingProperty:Reflectance', values, comments)
|
|
247
|
+
|
|
248
|
+
def to_radiance_solar(self):
|
|
249
|
+
"""Honeybee Radiance material with the solar reflectance."""
|
|
250
|
+
return self._to_radiance(self.solar_reflectance)
|
|
251
|
+
|
|
252
|
+
def to_radiance_visible(self):
|
|
253
|
+
"""Honeybee Radiance material with the visible reflectance."""
|
|
254
|
+
return self._to_radiance(self.visible_reflectance)
|
|
255
|
+
|
|
256
|
+
def to_dict(self):
|
|
257
|
+
"""Shade construction dictionary representation."""
|
|
258
|
+
base = {'type': 'ShadeConstruction'}
|
|
259
|
+
base['identifier'] = self.identifier
|
|
260
|
+
base['solar_reflectance'] = self.solar_reflectance
|
|
261
|
+
base['visible_reflectance'] = self.visible_reflectance
|
|
262
|
+
base['is_specular'] = self.is_specular
|
|
263
|
+
if self._display_name is not None:
|
|
264
|
+
base['display_name'] = self.display_name
|
|
265
|
+
if self._user_data is not None:
|
|
266
|
+
base['user_data'] = self.user_data
|
|
267
|
+
prop_dict = self.properties.to_dict()
|
|
268
|
+
if prop_dict is not None:
|
|
269
|
+
base['properties'] = prop_dict
|
|
270
|
+
return base
|
|
271
|
+
|
|
272
|
+
def duplicate(self):
|
|
273
|
+
"""Get a copy of this construction."""
|
|
274
|
+
return self.__copy__()
|
|
275
|
+
|
|
276
|
+
def _to_radiance(self, reflectance):
|
|
277
|
+
try:
|
|
278
|
+
from honeybee_radiance.modifier.material import Plastic
|
|
279
|
+
from honeybee_radiance.modifier.material import Mirror
|
|
280
|
+
except ImportError as e:
|
|
281
|
+
raise ImportError('honeybee_radiance library must be installed to use '
|
|
282
|
+
'to_radiance_* methods. {}'.format(e))
|
|
283
|
+
if not self.is_specular:
|
|
284
|
+
return Plastic.from_single_reflectance(
|
|
285
|
+
clean_rad_string(self.identifier), reflectance, roughness=0.15)
|
|
286
|
+
else:
|
|
287
|
+
return Mirror.from_single_reflectance(
|
|
288
|
+
clean_rad_string(self.identifier), reflectance)
|
|
289
|
+
|
|
290
|
+
def __copy__(self):
|
|
291
|
+
new_con = ShadeConstruction(
|
|
292
|
+
self.identifier, self._solar_reflectance, self._visible_reflectance,
|
|
293
|
+
self._is_specular)
|
|
294
|
+
new_con._display_name = self._display_name
|
|
295
|
+
new_con._user_data = None if self._user_data is None else self._user_data.copy()
|
|
296
|
+
new_con._properties._duplicate_extension_attr(self._properties)
|
|
297
|
+
return new_con
|
|
298
|
+
|
|
299
|
+
def __key(self):
|
|
300
|
+
"""A tuple based on the object properties, useful for hashing."""
|
|
301
|
+
return (self.identifier, self._solar_reflectance,
|
|
302
|
+
self._visible_reflectance, self._is_specular)
|
|
303
|
+
|
|
304
|
+
def __hash__(self):
|
|
305
|
+
return hash(self.__key())
|
|
306
|
+
|
|
307
|
+
def __eq__(self, other):
|
|
308
|
+
return isinstance(other, ShadeConstruction) and self.__key() == other.__key()
|
|
309
|
+
|
|
310
|
+
def __ne__(self, other):
|
|
311
|
+
return not self.__eq__(other)
|
|
312
|
+
|
|
313
|
+
def ToString(self):
|
|
314
|
+
"""Overwrite .NET ToString."""
|
|
315
|
+
return self.__repr__()
|
|
316
|
+
|
|
317
|
+
def __repr__(self):
|
|
318
|
+
return 'ShadeConstruction: {} [solar_ref: {}]'.format(
|
|
319
|
+
self.display_name, self.solar_reflectance)
|