honeybee-openstudio 2.22.5 → 2.23.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: facc419b5d36dbaf133a0d28ad9b23c62f9118b3188f3c181427f12b35106a88
4
- data.tar.gz: c3a317bbb9c039e61faff574cbaa5d13c4a878fd67aed76d2e9e968ad41c36df
3
+ metadata.gz: 8b1713bd43ce02933e6b62917cfd588f51b34474ab42cc964fac0707892ef6cb
4
+ data.tar.gz: 1b63c7e6ef5ef775b1c6312170fc11cb2117685141e6e6c00d39bc14a4dcb7e9
5
5
  SHA512:
6
- metadata.gz: b7bae7a4d908596590889e1d3effeb73854d97745530c8ff07b71c5870a1e4b16decade9637bd85ed5eb1a7fea11334f6b27e38cb441566996e660ed02c539a5
7
- data.tar.gz: d97616471898b7d43fd6344725d684156471741a8729657d70a78f24c1efe42709e891833f09a9ec229d1c0594328e79a7cf4e6af80e2ee62ac319c3c59954d2
6
+ metadata.gz: b2ce15cb4c8761569e16fae90f1a378a34d4a662abe027458714ed2c11004e84d833dec91ab7795d14d019ada20803a96969ac08c9eb0e8b8f9f725d60911fd5
7
+ data.tar.gz: 2ed1a4870310d697989c9af03079522af38459cba61280b2053e8b2e59cade74318e5ec43380ca85512ec74258d02b2f13305206c2a3a24e97395de428a95266
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'honeybee-openstudio'
7
- spec.version = '2.22.5'
7
+ spec.version = '2.23.0'
8
8
  spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
9
9
  spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
10
10
 
@@ -61,7 +61,7 @@ module Honeybee
61
61
  hash[:solar_reflectance] = layer.solarReflectance.get
62
62
  end
63
63
  unless layer.visibleReflectance.empty?
64
- hash[:visible_reflectance] = layer.visibleReflectance
64
+ hash[:visible_reflectance] = layer.visibleReflectance.get
65
65
  end
66
66
  elsif layer.to_MasslessOpaqueMaterial.is_initialized
67
67
  layer = layer.to_MasslessOpaqueMaterial.get
@@ -46,6 +46,8 @@ require 'from_openstudio/construction/opaque'
46
46
  require 'from_openstudio/construction/window'
47
47
  require 'from_openstudio/construction/shade'
48
48
  require 'from_openstudio/construction_set'
49
+ require 'from_openstudio/schedule/type_limit'
50
+ require 'from_openstudio/schedule/ruleset'
49
51
 
50
52
  require 'openstudio'
51
53
 
@@ -131,6 +133,10 @@ module Honeybee
131
133
  hash[:materials] = materials_from_model(openstudio_model)
132
134
  hash[:construction_sets] = []
133
135
  hash[:construction_sets] = constructionsets_from_model(openstudio_model)
136
+ hash[:schedule_type_limits] = []
137
+ hash[:schedule_type_limits] = schedtypelimits_from_model(openstudio_model)
138
+ hash[:schedules] = []
139
+ hash[:schedules] = scheduleruleset_from_model(openstudio_model)
134
140
 
135
141
  hash
136
142
  end
@@ -266,5 +272,24 @@ module Honeybee
266
272
  result
267
273
  end
268
274
 
275
+ # Create HB Schedule Type Limits from OpenStudio Schedule Type Limits
276
+ def self.schedtypelimits_from_model(openstudio_model)
277
+ result = []
278
+ openstudio_model.getScheduleTypeLimitss.each do |sch_typ_lim|
279
+ result << ScheduleTypeLimit.from_schedule_type_limit(sch_typ_lim)
280
+ end
281
+
282
+ result
283
+ end
284
+
285
+ # Create HB Schedule Ruleset from OpenStudio Ruleset
286
+ def self.scheduleruleset_from_model(openstudio_model)
287
+ result = []
288
+ openstudio_model.getScheduleRulesets.each do |sch_ruleset|
289
+ result << ScheduleRulesetAbridged.from_schedule_ruleset(sch_ruleset)
290
+ end
291
+ result
292
+ end
293
+
269
294
  end # Model
270
295
  end # Honeybee
@@ -0,0 +1,114 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/schedule/ruleset'
33
+ require 'from_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class ScheduleRulesetAbridged < ModelObject
37
+
38
+ def self.from_schedule_ruleset(schedule_ruleset)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'ScheduleRulesetAbridged'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = schedule_ruleset.nameString
44
+ # check if boost optional object is empty
45
+ hash[:default_day_schedule] = schedule_ruleset.defaultDaySchedule.nameString
46
+ hash[:summer_designday_schedule] = schedule_ruleset.summerDesignDaySchedule.nameString
47
+ hash[:winter_designday_schedule] = schedule_ruleset.winterDesignDaySchedule.nameString
48
+ hash[:holiday_schedule] = schedule_ruleset.holidaySchedule.nameString
49
+
50
+ schedule_days = [schedule_ruleset.defaultDaySchedule, schedule_ruleset.summerDesignDaySchedule, schedule_ruleset.winterDesignDaySchedule, schedule_ruleset.holidaySchedule]
51
+ hash[:day_schedules] = []
52
+ schedule_days.each do |schedule_day|
53
+ hash[:day_schedules] << ScheduleRulesetAbridged.from_day_schedule(schedule_day)
54
+ end
55
+
56
+ hash[:schedule_rules] = []
57
+ schedule_ruleset.scheduleRules.each do |schedule_rule|
58
+ hash[:schedule_rules] << ScheduleRulesetAbridged.from_schedule_rule(schedule_rule)
59
+ end
60
+
61
+ hash
62
+ end
63
+
64
+ def self.from_day_schedule(day_schedule)
65
+ hash = {}
66
+ hash[:type] = 'ScheduleDay'
67
+ hash[:identifier] = day_schedule.nameString
68
+ hash[:interpolate] = day_schedule.interpolatetoTimestep
69
+ hash[:values] = day_schedule.values
70
+ time_until = [[0,0]]
71
+ day_schedule.times.each do |time|
72
+ time_until << [time.hours, time.minutes]
73
+ end
74
+ time_until.delete_at(-1)
75
+ hash[:times] = time_until
76
+
77
+ hash
78
+ end
79
+
80
+ def self.from_schedule_rule(schedule_rule)
81
+ hash = {}
82
+ hash[:type] = 'ScheduleRuleAbridged'
83
+ hash[:schedule_day] = schedule_rule.daySchedule.nameString
84
+ hash[:apply_sunday] = schedule_rule.applySunday
85
+ hash[:apply_monday] = schedule_rule.applyMonday
86
+ hash[:apply_tuesday] = schedule_rule.applyTuesday
87
+ hash[:apply_wednesday] = schedule_rule.applyWednesday
88
+ hash[:apply_thursday] = schedule_rule.applyThursday
89
+ hash[:apply_friday] = schedule_rule.applyFriday
90
+ hash[:apply_saturday] = schedule_rule.applySaturday
91
+
92
+ #boost optional
93
+ unless schedule_rule.startDate.empty?
94
+ start_date = schedule_rule.startDate.get
95
+ hash[:start_date] = [(start_date.monthOfYear).value, start_date.dayOfMonth]
96
+ if start_date.isLeapYear
97
+ hash[:start_date] << 1
98
+ end
99
+ end
100
+
101
+ #boost optional
102
+ unless schedule_rule.endDate.empty?
103
+ end_date = schedule_rule.endDate.get
104
+ hash[:end_date] = [(end_date.monthOfYear).value, end_date.dayOfMonth]
105
+ if start_date.isLeapYear
106
+ hash[:end_date] << 1
107
+ end
108
+ end
109
+
110
+ hash
111
+ end
112
+
113
+ end # ScheduleRulesetAbridged
114
+ end # Honeybee
@@ -0,0 +1,63 @@
1
+ # *******************************************************************************
2
+ # Honeybee OpenStudio Gem, Copyright (c) 2020, Alliance for Sustainable
3
+ # Energy, LLC, Ladybug Tools LLC and other contributors. All rights reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are met:
7
+ #
8
+ # (1) Redistributions of source code must retain the above copyright notice,
9
+ # this list of conditions and the following disclaimer.
10
+ #
11
+ # (2) Redistributions in binary form must reproduce the above copyright notice,
12
+ # this list of conditions and the following disclaimer in the documentation
13
+ # and/or other materials provided with the distribution.
14
+ #
15
+ # (3) Neither the name of the copyright holder nor the names of any contributors
16
+ # may be used to endorse or promote products derived from this software without
17
+ # specific prior written permission from the respective party.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21
+ # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
+ # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE
23
+ # UNITED STATES GOVERNMENT, OR THE UNITED STATES DEPARTMENT OF ENERGY, NOR ANY OF
24
+ # THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
+ # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
26
+ # OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+ # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
28
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29
+ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+ # *******************************************************************************
31
+
32
+ require 'honeybee/schedule/type_limit'
33
+ require 'to_openstudio/model_object'
34
+
35
+ module Honeybee
36
+ class ScheduleTypeLimit < ModelObject
37
+
38
+ def self.from_schedule_type_limit(schedule_type_limit)
39
+ # create an empty hash
40
+ hash = {}
41
+ hash[:type] = 'ScheduleTypeLimit'
42
+ # set hash values from OpenStudio Object
43
+ hash[:identifier] = schedule_type_limit.nameString
44
+ # check if boost optional object is empty
45
+ unless schedule_type_limit.lowerLimitValue.empty?
46
+ hash[:lower_limit] = schedule_type_limit.lowerLimitValue.get
47
+ end
48
+ # check if boost optional object is empty
49
+ unless schedule_type_limit.upperLimitValue.empty?
50
+ hash[:upper_limit] = schedule_type_limit.upperLimitValue.get
51
+ end
52
+ # check if boost optional object is empty
53
+ unless schedule_type_limit.numericType.empty?
54
+ numeric_type = schedule_type_limit.numericType.get
55
+ hash[:numeric_type] = numeric_type.titleize
56
+ end
57
+ hash[:unit_type] = schedule_type_limit.unitType
58
+
59
+ hash
60
+ end
61
+
62
+ end # ScheduleTypeLimit
63
+ end # Honeybee
@@ -63,4 +63,8 @@ require 'from_openstudio/material/window_simpleglazsys'
63
63
  # extend the simulation objects
64
64
  require 'from_openstudio/simulation/design_day'
65
65
  require 'from_openstudio/simulation/parameter_model'
66
- require 'from_openstudio/simulation/simulation_output'
66
+ require 'from_openstudio/simulation/simulation_output'
67
+
68
+ # extend the schedule objects
69
+ require 'from_openstudio/schedule/type_limit'
70
+ require 'from_openstudio/schedule/ruleset'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybee-openstudio
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.5
4
+ version: 2.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanushree Charan
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-09-12 00:00:00.000000000 Z
14
+ date: 2021-09-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -187,6 +187,8 @@ files:
187
187
  - lib/from_openstudio/material/window_simpleglazsys.rb
188
188
  - lib/from_openstudio/model.rb
189
189
  - lib/from_openstudio/model_object.rb
190
+ - lib/from_openstudio/schedule/ruleset.rb
191
+ - lib/from_openstudio/schedule/type_limit.rb
190
192
  - lib/from_openstudio/simulation/design_day.rb
191
193
  - lib/from_openstudio/simulation/parameter_model.rb
192
194
  - lib/from_openstudio/simulation/simulation_output.rb