honeybee-schema 1.59.1__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_schema/__init__.py +1 -0
- honeybee_schema/__main__.py +4 -0
- honeybee_schema/_base.py +42 -0
- honeybee_schema/altnumber.py +18 -0
- honeybee_schema/boundarycondition.py +81 -0
- honeybee_schema/cli.py +115 -0
- honeybee_schema/comparison.py +208 -0
- honeybee_schema/doe2/__init__.py +0 -0
- honeybee_schema/doe2/properties.py +75 -0
- honeybee_schema/energy/__init__.py +0 -0
- honeybee_schema/energy/_base.py +64 -0
- honeybee_schema/energy/construction.py +324 -0
- honeybee_schema/energy/constructionset.py +359 -0
- honeybee_schema/energy/daylight.py +62 -0
- honeybee_schema/energy/designday.py +212 -0
- honeybee_schema/energy/generator.py +140 -0
- honeybee_schema/energy/global_constructionset.py +129 -0
- honeybee_schema/energy/hvac/__init__.py +0 -0
- honeybee_schema/energy/hvac/_template.py +38 -0
- honeybee_schema/energy/hvac/allair.py +257 -0
- honeybee_schema/energy/hvac/detailed.py +20 -0
- honeybee_schema/energy/hvac/doas.py +248 -0
- honeybee_schema/energy/hvac/heatcool.py +309 -0
- honeybee_schema/energy/hvac/idealair.py +107 -0
- honeybee_schema/energy/internalmass.py +25 -0
- honeybee_schema/energy/load.py +627 -0
- honeybee_schema/energy/material.py +949 -0
- honeybee_schema/energy/programtype.py +117 -0
- honeybee_schema/energy/properties.py +382 -0
- honeybee_schema/energy/schedule.py +350 -0
- honeybee_schema/energy/shw.py +53 -0
- honeybee_schema/energy/simulation.py +440 -0
- honeybee_schema/energy/ventcool.py +337 -0
- honeybee_schema/geometry.py +161 -0
- honeybee_schema/model.py +473 -0
- honeybee_schema/projectinfo.py +94 -0
- honeybee_schema/radiance/__init__.py +0 -0
- honeybee_schema/radiance/_base.py +22 -0
- honeybee_schema/radiance/asset.py +191 -0
- honeybee_schema/radiance/global_modifierset.py +92 -0
- honeybee_schema/radiance/modifier.py +373 -0
- honeybee_schema/radiance/modifierset.py +296 -0
- honeybee_schema/radiance/properties.py +149 -0
- honeybee_schema/radiance/state.py +69 -0
- honeybee_schema/updater/__init__.py +0 -0
- honeybee_schema/updater/version_1_39_12.py +14 -0
- honeybee_schema/updater/version_1_40_1.py +153 -0
- honeybee_schema/updater/version_1_43_1.py +18 -0
- honeybee_schema/updater/version_1_43_2.py +12 -0
- honeybee_schema/updater/version_1_43_5.py +11 -0
- honeybee_schema/validation.py +205 -0
- honeybee_schema-1.59.1.dist-info/METADATA +108 -0
- honeybee_schema-1.59.1.dist-info/RECORD +57 -0
- honeybee_schema-1.59.1.dist-info/WHEEL +5 -0
- honeybee_schema-1.59.1.dist-info/entry_points.txt +2 -0
- honeybee_schema-1.59.1.dist-info/licenses/LICENSE +23 -0
- honeybee_schema-1.59.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,350 @@
|
|
1
|
+
"""Schedule Type Limit Schema"""
|
2
|
+
from pydantic import Field, validator, root_validator, constr, conlist
|
3
|
+
from typing import List, Union
|
4
|
+
from enum import Enum
|
5
|
+
import datetime
|
6
|
+
|
7
|
+
from ._base import IDdEnergyBaseModel, DatedBaseModel, EnergyBaseModel
|
8
|
+
from ..altnumber import NoLimit
|
9
|
+
|
10
|
+
|
11
|
+
class ScheduleNumericType (str, Enum):
|
12
|
+
"""Designates how the range values are validated."""
|
13
|
+
continuous = 'Continuous'
|
14
|
+
discrete = 'Discrete'
|
15
|
+
|
16
|
+
|
17
|
+
class ScheduleUnitType (str, Enum):
|
18
|
+
dimensionless = 'Dimensionless'
|
19
|
+
temperature = 'Temperature'
|
20
|
+
delta_temperature = 'DeltaTemperature'
|
21
|
+
precipitation_rate = 'PrecipitationRate'
|
22
|
+
angle = 'Angle'
|
23
|
+
convection_coefficient = 'ConvectionCoefficient'
|
24
|
+
activity_level = 'ActivityLevel'
|
25
|
+
velocity = 'Velocity'
|
26
|
+
capacity = 'Capacity'
|
27
|
+
power = 'Power'
|
28
|
+
availability = 'Availability'
|
29
|
+
percent = 'Percent'
|
30
|
+
control = 'Control'
|
31
|
+
mode = 'Mode'
|
32
|
+
|
33
|
+
|
34
|
+
class ScheduleTypeLimit(EnergyBaseModel):
|
35
|
+
"""Specifies the data types and limits for values contained in schedules."""
|
36
|
+
|
37
|
+
type: constr(regex='^ScheduleTypeLimit$') = 'ScheduleTypeLimit'
|
38
|
+
|
39
|
+
lower_limit: Union[NoLimit, float] = Field(
|
40
|
+
default=NoLimit(),
|
41
|
+
description='Lower limit for the schedule type or NoLimit.'
|
42
|
+
)
|
43
|
+
|
44
|
+
upper_limit: Union[NoLimit, float] = Field(
|
45
|
+
default=NoLimit(),
|
46
|
+
description='Upper limit for the schedule type or NoLimit.'
|
47
|
+
)
|
48
|
+
|
49
|
+
numeric_type: ScheduleNumericType = ScheduleNumericType.continuous
|
50
|
+
|
51
|
+
unit_type: ScheduleUnitType = ScheduleUnitType.dimensionless
|
52
|
+
|
53
|
+
|
54
|
+
class ScheduleDay(EnergyBaseModel):
|
55
|
+
"""Used to describe the daily schedule for a single simulation day."""
|
56
|
+
|
57
|
+
type: constr(regex='^ScheduleDay$') = 'ScheduleDay'
|
58
|
+
|
59
|
+
values: List[float] = Field(
|
60
|
+
...,
|
61
|
+
description='A list of floats or integers for the values of the schedule. '
|
62
|
+
'The length of this list must match the length of the times list.'
|
63
|
+
)
|
64
|
+
|
65
|
+
times: List[conlist(int, min_items=2, max_items=2)] = Field(
|
66
|
+
[[0, 0]],
|
67
|
+
description='A list of lists with each sub-list possessing 2 values for '
|
68
|
+
'[hour, minute]. The length of the master list must match the length '
|
69
|
+
'of the values list. Each time in the master list represents the time '
|
70
|
+
'of day that the corresponding value begins to take effect. For example '
|
71
|
+
'[(0,0), (9,0), (17,0)] in combination with the values [0, 1, 0] denotes a '
|
72
|
+
'schedule value of 0 from 0:00 to 9:00, a value of 1 from 9:00 to 17:00 '
|
73
|
+
'and 0 from 17:00 to the end of the day. Note that this representation '
|
74
|
+
'of times as the "time of beginning" is a different convention than '
|
75
|
+
'EnergyPlus, which uses "time until".'
|
76
|
+
)
|
77
|
+
|
78
|
+
@root_validator
|
79
|
+
def check_times_values_match(cls, values):
|
80
|
+
"Ensure the length of the times matches the length of the values."
|
81
|
+
times, vals = values.get('times'), values.get('values')
|
82
|
+
assert len(times) == len(vals), 'Length of schedule times must match ' \
|
83
|
+
'the schedule values. {} != {}.'.format(len(times), len(values['values']))
|
84
|
+
return values
|
85
|
+
|
86
|
+
interpolate: bool = Field(
|
87
|
+
False,
|
88
|
+
description='Boolean to note whether values in between times should be '
|
89
|
+
'linearly interpolated or whether successive values should take effect '
|
90
|
+
'immediately upon the beginning time corresponding to them.'
|
91
|
+
)
|
92
|
+
|
93
|
+
|
94
|
+
class ScheduleRuleAbridged(DatedBaseModel):
|
95
|
+
"""Schedule rule including a ScheduleDay and when it should be applied.."""
|
96
|
+
|
97
|
+
type: constr(regex='^ScheduleRuleAbridged$') = 'ScheduleRuleAbridged'
|
98
|
+
|
99
|
+
schedule_day: str = Field(
|
100
|
+
...,
|
101
|
+
min_length=1,
|
102
|
+
max_length=100,
|
103
|
+
description='The identifier of a ScheduleDay object associated with this rule.'
|
104
|
+
)
|
105
|
+
|
106
|
+
apply_sunday: bool = Field(
|
107
|
+
False,
|
108
|
+
description='Boolean noting whether to apply schedule_day on Sundays.'
|
109
|
+
)
|
110
|
+
|
111
|
+
apply_monday: bool = Field(
|
112
|
+
False,
|
113
|
+
description='Boolean noting whether to apply schedule_day on Mondays.'
|
114
|
+
)
|
115
|
+
|
116
|
+
apply_tuesday: bool = Field(
|
117
|
+
False,
|
118
|
+
description='Boolean noting whether to apply schedule_day on Tuesdays.'
|
119
|
+
)
|
120
|
+
|
121
|
+
apply_wednesday: bool = Field(
|
122
|
+
False,
|
123
|
+
description='Boolean noting whether to apply schedule_day on Wednesdays.'
|
124
|
+
)
|
125
|
+
|
126
|
+
apply_thursday: bool = Field(
|
127
|
+
False,
|
128
|
+
description='Boolean noting whether to apply schedule_day on Thursdays.'
|
129
|
+
)
|
130
|
+
|
131
|
+
apply_friday: bool = Field(
|
132
|
+
False,
|
133
|
+
description='Boolean noting whether to apply schedule_day on Fridays.'
|
134
|
+
)
|
135
|
+
|
136
|
+
apply_saturday: bool = Field(
|
137
|
+
False,
|
138
|
+
description='Boolean noting whether to apply schedule_day on Saturdays.'
|
139
|
+
)
|
140
|
+
|
141
|
+
start_date: List[int] = Field(
|
142
|
+
[1, 1],
|
143
|
+
min_items=2,
|
144
|
+
max_items=3,
|
145
|
+
description='A list of two integers for [month, day], representing the start '
|
146
|
+
'date of the period over which the schedule_day will be applied.'
|
147
|
+
'A third integer may be added to denote whether the date should be '
|
148
|
+
're-serialized for a leap year (it should be a 1 in this case).'
|
149
|
+
)
|
150
|
+
|
151
|
+
@validator('start_date')
|
152
|
+
def check_start_date(cls, v):
|
153
|
+
return cls.check_date(v)
|
154
|
+
|
155
|
+
end_date: List[int] = Field(
|
156
|
+
[12, 31],
|
157
|
+
min_items=2,
|
158
|
+
max_items=3,
|
159
|
+
description='A list of two integers for [month, day], representing the end '
|
160
|
+
'date of the period over which the schedule_day will be applied.'
|
161
|
+
'A third integer may be added to denote whether the date should be '
|
162
|
+
're-serialized for a leap year (it should be a 1 in this case).'
|
163
|
+
)
|
164
|
+
|
165
|
+
@validator('end_date')
|
166
|
+
def check_end_date(cls, v):
|
167
|
+
return cls.check_date(v)
|
168
|
+
|
169
|
+
|
170
|
+
class ScheduleRulesetAbridged(IDdEnergyBaseModel):
|
171
|
+
"""Used to define a schedule for a default day, further described by ScheduleRule."""
|
172
|
+
|
173
|
+
type: constr(regex='^ScheduleRulesetAbridged$') = 'ScheduleRulesetAbridged'
|
174
|
+
|
175
|
+
day_schedules: List[ScheduleDay] = Field(
|
176
|
+
...,
|
177
|
+
description='A list of ScheduleDays that are referenced in the other keys of '
|
178
|
+
'this ScheduleRulesetAbridged.'
|
179
|
+
)
|
180
|
+
|
181
|
+
default_day_schedule: str = Field(
|
182
|
+
...,
|
183
|
+
min_length=1,
|
184
|
+
max_length=100,
|
185
|
+
description='An identifier for the ScheduleDay that will be used for '
|
186
|
+
'all days when no ScheduleRule is applied. This ScheduleDay must be '
|
187
|
+
'in the day_schedules.'
|
188
|
+
)
|
189
|
+
|
190
|
+
schedule_rules: List[ScheduleRuleAbridged] = Field(
|
191
|
+
default=None,
|
192
|
+
description='A list of ScheduleRuleAbridged that note exceptions to the '
|
193
|
+
'default_day_schedule. These rules should be ordered from highest to '
|
194
|
+
'lowest priority.'
|
195
|
+
)
|
196
|
+
|
197
|
+
holiday_schedule: str = Field(
|
198
|
+
default=None,
|
199
|
+
min_length=1,
|
200
|
+
max_length=100,
|
201
|
+
description='An identifier for the ScheduleDay that will be used for holidays. '
|
202
|
+
'This ScheduleDay must be in the day_schedules.'
|
203
|
+
)
|
204
|
+
|
205
|
+
summer_designday_schedule: str = Field(
|
206
|
+
default=None,
|
207
|
+
min_length=1,
|
208
|
+
max_length=100,
|
209
|
+
description='An identifier for the ScheduleDay that will be used for '
|
210
|
+
'the summer design day. This ScheduleDay must be in the day_schedules.'
|
211
|
+
)
|
212
|
+
|
213
|
+
winter_designday_schedule: str = Field(
|
214
|
+
default=None,
|
215
|
+
min_length=1,
|
216
|
+
max_length=100,
|
217
|
+
description='An identifier for the ScheduleDay that will be used for the '
|
218
|
+
'winter design day. This ScheduleDay must be in the day_schedules.'
|
219
|
+
)
|
220
|
+
|
221
|
+
schedule_type_limit: str = Field(
|
222
|
+
default=None,
|
223
|
+
min_length=1,
|
224
|
+
max_length=100,
|
225
|
+
description='Identifier of a ScheduleTypeLimit that will be used to validate '
|
226
|
+
'schedule values against upper/lower limits and assign units to the '
|
227
|
+
'schedule values. If None, no validation will occur.'
|
228
|
+
)
|
229
|
+
|
230
|
+
|
231
|
+
class ScheduleRuleset(ScheduleRulesetAbridged):
|
232
|
+
"""Used to define a schedule for a default day, further described by ScheduleRule."""
|
233
|
+
|
234
|
+
type: constr(regex='^ScheduleRuleset$') = 'ScheduleRuleset'
|
235
|
+
|
236
|
+
schedule_type_limit: ScheduleTypeLimit = Field(
|
237
|
+
default=None,
|
238
|
+
description='ScheduleTypeLimit object that will be used to validate '
|
239
|
+
'schedule values against upper/lower limits and assign units to the '
|
240
|
+
'schedule values. If None, no validation will occur.'
|
241
|
+
)
|
242
|
+
|
243
|
+
|
244
|
+
class ScheduleFixedIntervalAbridged(IDdEnergyBaseModel):
|
245
|
+
"""Used to specify a start date and a list of values for a period of analysis."""
|
246
|
+
|
247
|
+
type: constr(regex='^ScheduleFixedIntervalAbridged$') = \
|
248
|
+
'ScheduleFixedIntervalAbridged'
|
249
|
+
|
250
|
+
values: List[float] = Field(
|
251
|
+
...,
|
252
|
+
min_items=24,
|
253
|
+
max_items=527040,
|
254
|
+
description='A list of timeseries values occurring at each timestep over '
|
255
|
+
'the course of the simulation.'
|
256
|
+
)
|
257
|
+
|
258
|
+
schedule_type_limit: str = Field(
|
259
|
+
default=None,
|
260
|
+
min_length=1,
|
261
|
+
max_length=100,
|
262
|
+
description='Identifier of a ScheduleTypeLimit that will be used to validate '
|
263
|
+
'schedule values against upper/lower limits and assign units to the '
|
264
|
+
'schedule values. If None, no validation will occur.'
|
265
|
+
)
|
266
|
+
|
267
|
+
timestep: int = Field(
|
268
|
+
1,
|
269
|
+
description='An integer for the number of steps per hour that the input '
|
270
|
+
'values correspond to. For example, if each value represents 30 '
|
271
|
+
'minutes, the timestep is 2. For 15 minutes, it is 4.'
|
272
|
+
)
|
273
|
+
|
274
|
+
@validator('timestep')
|
275
|
+
def check_timestep(cls, v):
|
276
|
+
"Ensure the timestep is acceptable by EnergyPlus."
|
277
|
+
valid_timesteps = (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60)
|
278
|
+
assert v in valid_timesteps, '"{}" is not a valid timestep. ' \
|
279
|
+
'Choose from {}'.format(v, valid_timesteps)
|
280
|
+
return v
|
281
|
+
|
282
|
+
start_date: List[int] = Field(
|
283
|
+
[1, 1],
|
284
|
+
min_items=2,
|
285
|
+
max_items=3,
|
286
|
+
description='A list of two integers for [month, day], representing the start '
|
287
|
+
'date when the schedule values begin to take effect.'
|
288
|
+
'A third integer may be added to denote whether the date should be '
|
289
|
+
're-serialized for a leap year (it should be a 1 in this case).'
|
290
|
+
)
|
291
|
+
|
292
|
+
@validator('start_date')
|
293
|
+
def check_start_date(cls, v):
|
294
|
+
if len(v) == 3 and v[2]:
|
295
|
+
try:
|
296
|
+
datetime.date(2016, v[0], v[1])
|
297
|
+
except ValueError:
|
298
|
+
raise ValueError('{}/{} is not a valid date.'.format(v[0], v[1]))
|
299
|
+
else:
|
300
|
+
try:
|
301
|
+
datetime.date(2017, v[0], v[1])
|
302
|
+
except ValueError:
|
303
|
+
raise ValueError('{}/{} is not a valid date.'.format(v[0], v[1]))
|
304
|
+
return v
|
305
|
+
|
306
|
+
placeholder_value: float = Field(
|
307
|
+
0,
|
308
|
+
description=' A value that will be used for all times not covered by the '
|
309
|
+
'input values. Typically, your simulation should not need to use this '
|
310
|
+
'value if the input values completely cover the simulation period.'
|
311
|
+
)
|
312
|
+
|
313
|
+
interpolate: bool = Field(
|
314
|
+
False,
|
315
|
+
description='Boolean to note whether values in between intervals should be '
|
316
|
+
'linearly interpolated or whether successive values should take effect '
|
317
|
+
'immediately upon the beginning time corresponding to them.'
|
318
|
+
)
|
319
|
+
|
320
|
+
@root_validator
|
321
|
+
def check_number_of_values(cls, values):
|
322
|
+
"Ensure an acceptable number of schedule values."
|
323
|
+
vals = values.get('values')
|
324
|
+
timestep = values.get('timestep')
|
325
|
+
start_date = values.get('start_date')
|
326
|
+
if len(vals) < 24 * timestep:
|
327
|
+
raise ValueError('Number of schedule values must be for at least one day, '
|
328
|
+
'with a length greater than 24 * timestep.')
|
329
|
+
max_l = timestep * 8760 if len(start_date) == 3 and start_date[2] \
|
330
|
+
else timestep * 8784
|
331
|
+
if len(vals) > max_l:
|
332
|
+
raise ValueError('Number of schedule values must not exceed a full year, '
|
333
|
+
'with a length greater than 8760 * timestep.')
|
334
|
+
if len(vals) % (24 * timestep) != 0:
|
335
|
+
raise ValueError(
|
336
|
+
'Number of schedule values must be for a whole number of days.')
|
337
|
+
return values
|
338
|
+
|
339
|
+
|
340
|
+
class ScheduleFixedInterval(ScheduleFixedIntervalAbridged):
|
341
|
+
"""Used to specify a start date and a list of values for a period of analysis."""
|
342
|
+
|
343
|
+
type: constr(regex='^ScheduleFixedInterval$') = 'ScheduleFixedInterval'
|
344
|
+
|
345
|
+
schedule_type_limit: ScheduleTypeLimit = Field(
|
346
|
+
default=None,
|
347
|
+
description='ScheduleTypeLimit object that will be used to validate '
|
348
|
+
'schedule values against upper/lower limits and assign units to the '
|
349
|
+
'schedule values. If None, no validation will occur.',
|
350
|
+
)
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"""Ideal Air Schema"""
|
2
|
+
from pydantic import Field, constr, confloat
|
3
|
+
from typing import Union
|
4
|
+
from enum import Enum
|
5
|
+
|
6
|
+
from ._base import IDdEnergyBaseModel
|
7
|
+
from ..altnumber import Autocalculate
|
8
|
+
|
9
|
+
|
10
|
+
class SHWEquipmentType(str, Enum):
|
11
|
+
gas_waterheater = 'Gas_WaterHeater'
|
12
|
+
electric_waterheater = 'Electric_WaterHeater'
|
13
|
+
heatpump_waterheater = 'HeatPump_WaterHeater'
|
14
|
+
gas_tanklessheater = 'Gas_TanklessHeater'
|
15
|
+
electric_tanklessheater = 'Electric_TanklessHeater'
|
16
|
+
|
17
|
+
|
18
|
+
class SHWSystem(IDdEnergyBaseModel):
|
19
|
+
"""Provides a model for a Service Hot Water system."""
|
20
|
+
|
21
|
+
type: constr(regex='^SHWSystem$') = 'SHWSystem'
|
22
|
+
|
23
|
+
equipment_type: SHWEquipmentType = Field(
|
24
|
+
SHWEquipmentType.gas_waterheater,
|
25
|
+
description='Text to indicate the type of air-side economizer used on the '
|
26
|
+
'ideal air system. Economizers will mix in a greater amount of outdoor '
|
27
|
+
'air to cool the zone (rather than running the cooling system) when '
|
28
|
+
'the zone needs cooling and the outdoor air is cooler than the zone.'
|
29
|
+
)
|
30
|
+
|
31
|
+
heater_efficiency: Union[confloat(gt=0), Autocalculate] = Field(
|
32
|
+
Autocalculate(),
|
33
|
+
description='A number for the efficiency of the heater within the system. '
|
34
|
+
'For Gas systems, this is the efficiency of the burner. For HeatPump '
|
35
|
+
'systems, this is the rated COP of the system. For electric systems, this '
|
36
|
+
'should usually be set to 1. If set to Autocalculate, this value will '
|
37
|
+
'automatically be set based on the equipment_type. Gas_WaterHeater - 0.8, '
|
38
|
+
'Electric_WaterHeater - 1.0, HeatPump_WaterHeater - 3.5, Gas_TanklessHeater '
|
39
|
+
'- 0.8, Electric_TanklessHeater - 1.0.'
|
40
|
+
)
|
41
|
+
|
42
|
+
ambient_condition: Union[float, str] = Field(
|
43
|
+
22,
|
44
|
+
description='A number for the ambient temperature in which the hot '
|
45
|
+
'water tank is located [C]. This can also be the identifier of a Room '
|
46
|
+
'in which the tank is located.'
|
47
|
+
)
|
48
|
+
|
49
|
+
ambient_loss_coefficient: float = Field(
|
50
|
+
6,
|
51
|
+
description='A number for the loss of heat from the water heater '
|
52
|
+
'tank to the surrounding ambient conditions [W/K].'
|
53
|
+
)
|